/* Base Styles */
:root {
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%);
    --primary-soft: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 50%, rgba(217, 70, 239, 0.1) 100%);
    --secondary-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --text-dark: #1e293b;
    --text-light: #64748b;
    --border-light: #e2e8f0;
    --white: #ffffff;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-primary: 0 5px 15px rgba(99, 102, 241, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.header {
    background: var(--primary-gradient);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--white);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.5rem;
}

.nav-links {
    display: flex;
    gap: 6rem;
    list-style: none;
    margin-left: auto;
    margin-right: 1rem;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    min-width: 48px;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    margin: auto;
}

.mobile-menu-btn svg {
    width: 24px;
    height: 24px;
}

.mobile-menu-btn:active {
    background: rgba(255, 255, 255, 0.1);
}

.nav-links a {
    color: var(--white);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s ease;
}

.nav-links a:hover {
    opacity: 0.8;
}

/* Mobile Navigation */
@media (max-width: 768px) {
    .nav-container {
        padding: 0 0 0 20px;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        background: var(--primary-gradient);
        padding: 1rem;
        gap: 1rem;
        box-shadow: var(--shadow-md);
        margin: 0;
    }

    .nav-links.active {
        display: flex;
        animation: slideDown 0.3s ease-out forwards;
    }

    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .nav-links li {
        width: 100%;
        text-align: center;
    }

    .nav-links a {
        display: block;
        padding: 1rem 2rem 1rem 1rem;
    }

    .mobile-menu-btn {
        width: 70px;
        height: 70px;
        border-radius: 8px;
        transition: background-color 0.2s ease;
    }

    .mobile-menu-btn:active {
        background: rgba(255, 255, 255, 0.1);
    }
}

/* Hero Section */
.hero {
    background: var(--primary-gradient);
    color: var(--white);
    padding: 8rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 50%);
    animation: rotate 30s linear infinite;
    pointer-events: none;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    letter-spacing: -1px;
}

.hero p {
    font-size: 1.25rem;
    opacity: 0.9;
}

/* Converter Section */
.converter-section {
    padding: 4rem 0;
    background: var(--white);
}

.converter-section .container {
    max-width: 800px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    padding: 3rem;
    border-radius: 24px;
    box-shadow: var(--shadow-lg),
                0 4px 16px rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transform: translateY(-50px);
    margin-top: 50px;
}

.upload-zone {
    border: 2px dashed var(--border-light);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
    animation: pulse 2s infinite;
}

.upload-zone input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}

.upload-zone:hover {
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.05);
    transform: translateY(-1px);
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.upload-icon {
    fill: #94a3b8;
    transition: all 0.3s ease;
    width: 48px;
    height: 48px;
}

.upload-zone:hover .upload-icon {
    fill: #6366f1;
    transform: scale(1.1);
}

#preview {
    max-width: 100%;
    max-height: 300px;
    margin: 1rem auto;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Format Selection and Quality Control */
.format-section {
    margin: 1.5rem 0;
}

.format-select {
    width: 100%;
    padding: 1rem;
    border-radius: 12px;
    border: 2px solid var(--border-light);
    font-size: 1rem;
    color: var(--text-dark);
    background-color: var(--white);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%234a5568' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1rem;
}

.quality-control {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

input[type="range"] {
    flex: 1;
    height: 6px;
    background: var(--border-light);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary-gradient);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.2);
}

/* Buttons */
button {
    width: 100%;
    padding: 1.25rem;
    border-radius: 12px;
    border: none;
    background: var(--primary-gradient);
    color: var(--white);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

button:disabled {
    background: var(--border-light);
    cursor: not-allowed;
    box-shadow: none;
}

button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-primary);
}

.download-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    margin-top: 2rem;
    padding: 1.25rem;
    background: var(--secondary-gradient);
    color: var(--white);
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
}

.download-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.25);
}

.download-button svg {
    width: 20px;
    height: 20px;
}

/* Features Section */
.features {
    padding: 6rem 0;
    background: #f8fafc;
}

.features h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--text-dark);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: var(--white);
    padding: 2.5rem;
    border-radius: 20px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(99, 102, 241, 0.1);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-soft);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.feature-card:hover::before {
    opacity: 1;
}

.feature-card > * {
    position: relative;
    z-index: 1;
}

.feature-icon {
    width: 48px;
    height: 48px;
    fill: #6366f1;
    margin-bottom: 1.5rem;
}

.feature-card h3 {
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.feature-card p {
    color: var(--text-light);
}

/* How It Works */
.how-it-works {
    padding: 6rem 0;
    background: var(--white);
}

.how-it-works h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.step {
    text-align: center;
    padding: 2.5rem;
    position: relative;
    background: var(--white);
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.step:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-primary);
}

.step::after {
    content: '';
    position: absolute;
    top: 2.5rem;
    right: -2rem;
    width: 4rem;
    height: 2px;
    background: linear-gradient(90deg, var(--border-light) 50%, transparent);
    display: none;
}

@media (min-width: 768px) {
    .step::after {
        display: block;
    }
    
    .steps > *:last-child .step::after {
        display: none;
    }
}

.step-number {
    width: 48px;
    height: 48px;
    background: var(--primary-gradient);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-weight: 600;
    font-size: 1.25rem;
    box-shadow: var(--shadow-primary);
}

/* FAQ Section */
.faq {
    padding: 6rem 0;
    background: #f8fafc;
}

.faq h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
}

.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.faq-item {
    background: var(--white);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(99, 102, 241, 0.1);
    transition: all 0.3s ease;
}

.faq-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-primary);
    background: linear-gradient(to right bottom, var(--white), rgba(255, 255, 255, 0.95));
}

.faq-item h3 {
    color: var(--text-dark);
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.faq-item p {
    color: var(--text-light);
}

/* Footer */
.footer {
    background: var(--text-dark);
    color: var(--white);
    padding: 4rem 0 2rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-info p {
    margin-top: 1rem;
    opacity: 0.8;
}

.footer-links h4,
.footer-contact h4 {
    margin-bottom: 1rem;
}

.footer-links ul {
    list-style: none;
}

.footer-links a,
.footer-contact a {
    color: var(--white);
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.footer-links a:hover,
.footer-contact a:hover {
    opacity: 1;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
    opacity: 0.6;
}

/* Animations */
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.1); }
    70% { box-shadow: 0 0 0 10px rgba(99, 102, 241, 0); }
    100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
}

/* Loading Spinner */
.loading-spinner {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Ad Containers */
.ad-container {
    margin: 2rem 0;
    text-align: center;
    clear: both;
}

/* Native Banner 2:1 */
.ad-container-native {
    max-width: 100%;
    margin: 3rem auto;
}

/* 728x90 Banner */
.ad-container-leaderboard {
    width: 100%;
    max-width: 728px;
    margin: 2rem auto;
    overflow: hidden;
}

.ad-container-leaderboard iframe {
    max-width: 100%;
    width: 728px;
    margin: 0 auto;
    display: block;
}

/* 300x250 Banner */
.ad-container-medium {
    max-width: 300px;
    margin: 2rem auto;
    overflow: hidden;
}

/* 320x50 Mobile Banner */
.ad-container-mobile {
    display: none; /* Hidden by default on desktop */
    width: 100%;
    max-width: 320px;
    margin: 1.5rem auto;
    overflow: hidden;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .container {
        padding: 0 1rem;
    }
    
    .features-grid,
    .faq-grid {
        grid-template-columns: 1fr;
    }

    .ad-container-leaderboard {
        display: none; /* Hide leaderboard on mobile */
    }

    .ad-container-mobile {
        display: block; /* Show mobile banner */
    }

    .ad-container iframe {
        margin: 0 auto !important;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .upload-zone {
        padding: 1.5rem;
    }
    
    .feature-card,
    .faq-item {
        padding: 1.5rem;
    }
}
