@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

:root {
    --primary-color: #6a11cb;
    --secondary-color: #2575fc;
    --background-color: #f0f2f5;
    --card-background: #ffffff;
    --text-color: #333;
    --light-text-color: #777;
    --border-color: #e0e0e0;
    --drop-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #e0c3fc 0%, #8ec5fc 100%);
    color: var(--text-color);
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding: 0;
    box-sizing: border-box;
    overflow-x: hidden;
    position: relative;
    z-index: 1; /* Ensure body content is above background objects */
}

/* Background Objects */
.background-objects {
    position: fixed; /* Changed to fixed to stay in viewport */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
}

.object {
    position: absolute;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    opacity: 0.3;
    filter: blur(30px);
    animation: float 15s infinite ease-in-out alternate;
}

.object-1 { width: 100px; height: 100px; top: 10%; left: 15%; animation-delay: 0s; }
.object-2 { width: 150px; height: 150px; top: 40%; left: 80%; animation-delay: 3s; }
.object-3 { width: 80px; height: 80px; top: 70%; left: 30%; animation-delay: 6s; }
.object-4 { width: 120px; height: 120px; top: 20%; left: 60%; animation-delay: 9s; }
.object-5 { width: 90px; height: 90px; top: 85%; left: 50%; animation-delay: 12s; }

@keyframes float {
    0% { transform: translate(0, 0); }
    50% { transform: translate(20px, 30px); }
    100% { transform: translate(0, 0); }
}

/* Main Header */
.main-header {
    width: 100%;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 10px 0; /* Reduced padding */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05); /* Lighter shadow */
}

.header-content {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.logo img {
    height: 40px; /* Adjusted logo size */
    width: auto;
}

.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 25px;
}

.main-nav a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem; /* Slightly smaller font */
    transition: color 0.3s ease;
}

.main-nav a:hover {
    color: var(--primary-color);
}

main {
    width: 100%;
    max-width: 1000px;
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-grow: 1; /* Allow main content to grow */
}

.container {
    width: 100%;
    background: var(--card-background);
    border-radius: 20px;
    box-shadow: var(--drop-shadow);
    padding: 40px;
    text-align: center;
    transition: all 0.3s ease;
    margin-bottom: 30px;
    box-sizing: border-box;
}

/* Removed old header styling */
header h1, header p {
    display: none;
}

/* Converter Section Styling (replaces hero-section for main upload) */
.converter-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px; /* Give it some height */
    margin-bottom: 50px;
    text-align: center;
    background: var(--card-background);
    border-radius: 20px;
    box-shadow: var(--drop-shadow);
    padding: 40px;
    width: 100%;
    box-sizing: border-box;
}

.converter-header h1 {
    font-size: 2.8rem;
    font-weight: 700;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
}

.converter-header p {
    font-size: 1.1rem;
    color: var(--light-text-color);
    margin-bottom: 30px;
}

.upload-area-main {
    width: 80%; /* Make upload area more central */
    max-width: 500px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 15px;
    padding: 40px;
    transition: all 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

.upload-area.dragover {
    border-color: var(--primary-color);
    background-color: #f7f5ff;
}

.upload-label {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.upload-icon svg {
    width: 50px;
    height: 50px;
    color: var(--primary-color);
    transition: transform 0.3s ease;
}

.upload-label:hover .upload-icon svg {
    transform: scale(1.1);
}

.upload-label p {
    color: var(--light-text-color);
    font-weight: 300;
    margin: 0;
}

#preview-area {
    margin-top: 30px;
    width: 100%;
    box-sizing: border-box;
}

#preview-area img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

#preview-area audio {
    width: 100%;
}

#preview-area p {
    font-size: 1.1rem;
    font-weight: 400;
    background: var(--background-color);
    padding: 15px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

#conversion-options {
    margin-top: 30px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

#conversion-options.visible {
    opacity: 1;
    transform: translateY(0);
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.option-btn {
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 15px;
    font-size: 1rem;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.3s ease;
}

.option-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(106, 17, 203, 0.2);
}

.download-area {
    margin-top: 30px;
}

#download-btn {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 10px;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(37, 117, 252, 0.3);
}

#download-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(37, 117, 252, 0.4);
}

.hidden {
    display: none;
}

#loading-indicator {
    margin-top: 30px;
    display: none; /* Hidden by default */
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Description Section Styling */
.description-section {
    background: var(--card-background);
    border-radius: 20px;
    box-shadow: var(--drop-shadow);
    padding: 40px;
    text-align: left;
    margin-top: 30px;
    width: 100%;
    max-width: 1000px;
    box-sizing: border-box;
}

.description-section h2 {
    font-size: 2rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 20px;
    text-align: center;
}

.description-section p {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-color);
    margin-bottom: 15px;
}

.description-section p:last-child {
    margin-bottom: 0;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .converter-section {
        padding: 20px;
    }

    .main-header .header-content {
        flex-direction: column;
        gap: 10px;
    }

    .main-nav ul {
        justify-content: center;
    }

    .converter-header h1 {
        font-size: 2rem;
    }

    .description-section h2 {
        font-size: 1.5rem;
    }
}
