
/* ============================================
   1. CSS CUSTOM PROPERTIES
   ============================================ */
:root {
    --primary: #2196F3;
    --primary-dark: #1976d2;
    --primary-light: #64b5f6;
    --light-blue: #e3f2fd;
    --white: #ffffff;
    --gray-50: #fafafa;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    /* ✅ Removed unused --info variable */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ============================================
   2. RESET & BASE
   ✅ Removed duplicate — also defined inline in <head>
   Only non-critical base styles live here
   ============================================ */
html {
    font-size: 16px;
    scroll-behavior: smooth;
}

/* ============================================
   3. ACCESSIBILITY UTILITIES
   ============================================ */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary);
    color: var(--white);
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 1000;
    transition: top 0.2s;
}

.skip-to-content:focus {
    top: 6px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ============================================
   4. LAYOUT — CONTAINER
   ============================================ */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* ============================================
   5. HEADER & NAVIGATION
   ============================================ */
.site-header {
    background: var(--white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar {
    padding: 1rem 0;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.logo:hover {
    color: var(--primary-dark);
    transform: translateY(-1px);
}

.logo-icon {
    font-size: 1.75rem;
}

.logo-accent {
    color: var(--gray-700);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: var(--gray-700);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.nav-links a:hover,
.nav-links a.active,
.nav-links a[aria-current="page"] {
    color: var(--primary);
    background: var(--light-blue);
}

/* ============================================
   6. MAIN CONTENT WRAPPER
   ============================================ */
.main-container {
    flex: 1;
    padding: 2rem 0;
}

/* ============================================
   7. HERO SECTION
   ============================================ */
.hero-section {
    text-align: center;
    margin-bottom: 3rem;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--gray-600);
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* ============================================
   8. BREADCRUMB
   ============================================ */
.breadcrumb {
    margin-bottom: 2rem;
}

.breadcrumb ol {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    justify-content: center;
    color: var(--gray-500);
    font-size: 0.875rem;
}

.breadcrumb li:not(:last-child)::after {
    content: "›";
    margin-left: 0.5rem;
    color: var(--gray-400);
}

.breadcrumb a {
    color: var(--primary);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* ============================================
   9. UPLOAD / DROP ZONE SECTION
   ============================================ */
.upload-section {
    max-width: 600px;
    margin: 0 auto 4rem;
}

.drop-zone {
    border: 2px dashed var(--gray-300);
    border-radius: var(--border-radius-lg);
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 2rem;
    background: var(--white);
    position: relative;
    overflow: hidden;
}

.drop-zone::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(33, 150, 243, 0.1), transparent);
    transition: left 0.5s;
}

.drop-zone:hover,
.drop-zone.dragover,
.drop-zone:focus {
    border-color: var(--primary);
    background: var(--light-blue);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.drop-zone:hover::before,
.drop-zone:focus::before {
    left: 100%;
}

.drop-zone-content {
    position: relative;
    z-index: 1;
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.drop-zone-text {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.5rem;
}

.drop-zone-subtext {
    color: var(--gray-500);
    font-size: 0.875rem;
}

.file-input {
    display: none;
}

/* ============================================
   10. FILE INFO INPUTS
   ============================================ */
.file-info {
    margin: 2rem 0;
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-label {
    display: block;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.input-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--gray-300);
    border-radius: var(--border-radius);
    font-size: 1rem;
    background: var(--white);
    transition: var(--transition);
    color: var(--gray-800);
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.input-group input:read-only {
    background: var(--gray-100);
    color: var(--gray-600);
    cursor: default;
}

/* ============================================
   11. DOWNLOAD BUTTON
   ============================================ */
.download-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    border: none;
    padding: 1rem 2rem;
    font-size: 1.125rem;
    font-weight: 600;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.download-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.download-btn:hover:not(:disabled)::before {
    width: 300px;
    height: 300px;
}

.download-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.download-btn:disabled {
    background: var(--gray-400);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-icon {
    font-size: 1.25rem;
}

.disclaimer {
    font-size: 0.875rem;
    color: var(--gray-500);
    text-align: center;
    margin-top: 1rem;
    line-height: 1.5;
}

/* ============================================
   12. SHARED SECTION TITLE
   ============================================ */
.section-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    text-align: center;
    color: var(--gray-900);
    margin-bottom: 3rem;
}

/* ============================================
   13. FEATURES SECTION
   ============================================ */
.features-section {
    padding: 4rem 0;
    background: var(--white);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-card {
    text-align: center;
    padding: 2rem;
    border-radius: var(--border-radius-lg);
    background: var(--gray-50);
    transition: var(--transition);
    border: 1px solid var(--gray-200);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 1rem;
}

.feature-description {
    color: var(--gray-600);
    line-height: 1.6;
}

/* ============================================
   14. HOW IT WORKS SECTION
   ============================================ */
.how-it-works {
    padding: 4rem 0;
    background: var(--gray-50);
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.step {
    text-align: center;
    position: relative;
}

.step-number {
    width: 4rem;
    height: 4rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 auto 1rem;
    box-shadow: var(--shadow-md);
}

.step-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.step-description {
    color: var(--gray-600);
}

/* ============================================
   15. FORMATS SECTION
   ============================================ */
.formats-section {
    padding: 4rem 0;
    background: var(--white);
}

.formats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.format-category {
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--gray-200);
    background: var(--gray-50);
}

.category-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--light-blue);
}

.format-list {
    list-style: none;
    color: var(--gray-600);
}

.format-list li {
    padding: 0.25rem 0;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
}

.formats-note {
    text-align: center;
    font-style: italic;
    color: var(--gray-500);
    font-size: 1.125rem;
}

/* Author Box */
.author-box {
    padding: 2.5rem 0;
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
    border-bottom: 1px solid var(--gray-200);
}

.author-inner {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    max-width: 750px;
}

.author-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 3px solid var(--primary);
}

.author-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gray-500);
    margin-bottom: 0.25rem;
}

.author-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.author-bio {
    font-size: 0.9rem;
    color: var(--gray-600);
    line-height: 1.65;
    margin-bottom: 0.75rem;
}

.author-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.author-link {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.author-link:hover {
    border-bottom-color: var(--primary);
}

@media (max-width: 520px) {
    .author-inner {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .author-links {
        justify-content: center;
    }
}

/* ============================================
   16. FOOTER
   ============================================ */
.site-footer {
    background: var(--gray-900);
    color: var(--gray-200);
    padding: 3rem 0 1rem;
    margin-top: auto;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1rem;
}

.footer-title {
    color: var(--white);
    font-size: 1.25rem;
}

.footer-subtitle {
    color: var(--white);
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-description {
    color: var(--gray-400);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--gray-300);
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--primary-light);
    text-decoration: underline;
}

/* ============================================
   17. LANGUAGE SWITCHER
   ============================================ */
.language-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.language-column {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.language-link {
    color: var(--gray-300);
    text-decoration: none;
    padding: 0.4rem 0.6rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
    font-size: 0.875rem;
    text-align: center;
    display: block;
}

.language-link:hover,
.language-link.active {
    color: var(--white);
    background: var(--primary);
    transform: translateX(2px);
}

/* ============================================
   18. FOOTER BOTTOM BAR
   ============================================ */
.footer-bottom {
    border-top: 1px solid var(--gray-700);
    padding-top: 1rem;
    text-align: center;
}

.copyright {
    color: var(--gray-400);
    font-size: 0.875rem;
}

/* ============================================
   19. NOTIFICATION TOAST
   ✅ Moved from JS inline styles to CSS
   ============================================ */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    color: var(--white);
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    z-index: 10000;
    box-shadow: var(--shadow-lg);
    font-weight: 500;
    max-width: 300px;
    word-wrap: break-word;
    opacity: 0;
    transform: translateX(110%);
    transition: var(--transition);
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.notification--visible {
    opacity: 1;
    transform: translateX(0);
}

.notification--success { background: var(--success); }
.notification--error   { background: var(--danger); }
.notification--info    { background: #17a2b8; }

.notification__close {
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.2rem;
    cursor: pointer;
    margin-left: auto;
    line-height: 1;
    padding: 0;
    flex-shrink: 0;
}

.notification__close:hover {
    opacity: 0.8;
}

/* ============================================
   20. RESPONSIVE — TABLET (max 992px)
   ============================================ */
@media (max-width: 992px) {
    .language-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .language-column:last-child {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }
}

/* ============================================
   21. RESPONSIVE — MOBILE (max 768px)
   ✅ MERGED: Was two separate duplicate blocks
   ============================================ */
@media (max-width: 768px) {
    /* Layout */
    .container {
        padding: 0 1rem;
    }

    /* Navigation */
    .nav-links {
        gap: 1rem;
    }

    .nav-links a {
        padding: 0.25rem 0.5rem;
        font-size: 0.875rem;
    }

    /* Upload */
    .drop-zone {
        padding: 2rem 1rem;
    }

    /* Steps arrow — hidden on mobile */
    .step:not(:last-child)::after {
        display: none;
    }

    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    /* Language grid */
    .language-grid {
        grid-template-columns: 1fr;
    }

    .language-column {
        align-items: center;
    }

    .language-column:last-child {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    /* Notifications */
    .notification {
        top: auto;
        bottom: 20px;
        right: 1rem;
        left: 1rem;
        max-width: 100%;
        transform: translateY(120%);
    }

    .notification--visible {
        transform: translateY(0);
    }
}

/* ============================================
   22. RESPONSIVE — DESKTOP (min 769px)
   ============================================ */
@media (min-width: 769px) {
    .step:not(:last-child)::after {
        content: "→";
        position: absolute;
        top: 2rem;
        right: -1rem;
        font-size: 2rem;
        color: var(--primary);
        display: block;
    }
}

/* ============================================
   23. DARK MODE
   ✅ Fixed: body uses --gray-100 consistently
   ============================================ */
@media (prefers-color-scheme: dark) {
    :root {
        --gray-50: #1a1a1a;
        --gray-100: #2d2d2d;
        --gray-200: #3d3d3d;
        --gray-300: #555555;
        --white: #1e1e1e;
        --gray-900: #f0f0f0;
        --gray-800: #e0e0e0;
        --gray-700: #cccccc;
        --gray-600: #aaaaaa;
    }
}

/* ============================================
   24. ACCESSIBILITY — REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ============================================
   25. ACCESSIBILITY — HIGH CONTRAST
   ============================================ */
@media (prefers-contrast: high) {
    .drop-zone {
        border-width: 3px;
    }

    .input-group input:focus {
        box-shadow: 0 0 0 4px rgba(33, 150, 243, 0.4);
    }

    .download-btn:not(:disabled) {
        border: 2px solid var(--white);
    }
}