:root {
    --primary-color: #FF0033;
    --primary-hover: #CC0029;
    --secondary-color: #FFDADA;
    --bg-color: #EDF2FA;
    --card-bg: #FFFFFF;
    --text-main: #344050;
    --text-muted: #4A5568;
    --border-radius: 12px;
    --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.mobile-menu-btn,
.mobile-drawer,
.drawer-overlay,
.mobile-icons {
    display: none;
}

/* Dark Mode Variables */
body.dark-mode {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.15);
}

body.dark-mode .header,
body.dark-mode .dropdown-menu,
body.dark-mode .hero-card,
body.dark-mode .search-wrapper,
body.dark-mode .autocomplete-dropdown,
body.dark-mode .feature-card,
body.dark-mode .info-card,
body.dark-mode .faq-card,
body.dark-mode .faq-item,
body.dark-mode .grid-dropdown,
body.dark-mode .footer {
    background-color: var(--card-bg);
    border-color: #334155;
    color: var(--text-main);
}

body.dark-mode .search-input {
    color: var(--text-main);
}

body.dark-mode .search-input::placeholder {
    color: #64748b;
    opacity: 1;
}

body.dark-mode .btn-paste {
    background-color: #334155;
    color: #e2e8f0;
}

body.dark-mode .autocomplete-item {
    color: var(--text-main);
    border-bottom-color: #334155;
    background-color: transparent;
}

body.dark-mode .autocomplete-item:hover {
    background-color: #334155;
    color: #f8fafc;
}

body.dark-mode .dropdown-menu a:hover,
body.dark-mode .grid-item:hover,
body.dark-mode .faq-item:hover {
    background-color: #334155;
}

body.dark-mode .list-item {
    background: var(--card-bg);
}

body.dark-mode .logo span {
    color: white;
    /* Ensure 'Down' is white in dark mode */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Accessibility Utilities */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    font-weight: 600;
    z-index: 10000;
    border-radius: 0 0 4px 0;
}

.skip-to-content:focus {
    top: 0;
}

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

/* Improved Focus Indicators */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.icon-btn:focus-visible,
.btn-download:focus-visible,
.btn-paste:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

body.dark-mode a:focus-visible,
body.dark-mode button:focus-visible,
body.dark-mode input:focus-visible {
    outline-color: #FF6B9D;
}


/* Header Styles */
.header {
    background-color: var(--card-bg);
    padding: 0.5rem 0;
    box-shadow: var(--box-shadow);
    position: sticky;
    top: 0;
    z-index: 1020;
    /* Ensure header is above search wrapper (1002) and its dropdown (1005) if scrolled */
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 40px;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
}

.logo-container img {
    height: 32px;
}

.nav-links {
    display: flex;
    gap: 25px;
    align-items: center;
}

.nav-links a {
    font-weight: 500;
    color: var(--text-muted);
    transition: color 0.2s;
    font-size: 0.95rem;
}

/* Dropdown Styles */
.dropdown {
    position: relative;
}

.dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 5px;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 180px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    padding: 10px 0;
    display: none;
    z-index: 1001;
    margin-top: 5px;
    /* Reduced gap */
}

/* Pseudo-element bridge to prevent hover loss */
.dropdown::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 15px;
    display: block;
}

.dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu a {
    display: block;
    padding: 10px 20px;
    color: var(--text-main);
    transition: background 0.2s;
    font-size: 0.9rem;
}

.dropdown-menu a:hover {
    background: #f8fafc;
    color: var(--primary-color);
}

.nav-links a:hover,
.dropdown:hover .dropdown-trigger,
.dropdown:hover .dropdown-trigger i {
    color: var(--primary-color);
}

.header-icons {
    display: flex;
    gap: 15px;
    align-items: center;
}

.icon-btn {
    background: #f0f4f8;
    border: none;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-muted);
    transition: background 0.2s, color 0.2s;
}

.icon-btn:hover {
    background: var(--primary-color);
    color: white;
}

body.dark-mode .icon-btn {
    background: #334155;
    color: #94a3b8;
}

body.dark-mode .icon-btn:hover {
    background: var(--primary-color);
    color: white;
}



/* Grid Menu Styles */
.header-icons {
    position: relative;
    display: flex;
    gap: 15px;
    align-items: center;
}

.grid-menu-container {
    position: relative;
}

.grid-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 280px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 20px;
    display: none;
    z-index: 1002;
    margin-top: 15px;
    border: 1px solid #e2e8f0;
}

.grid-dropdown.show {
    display: block;
}

.grid-items {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 20px;
    border-bottom: 1px solid #edf2f7;
    padding-bottom: 20px;
}

.grid-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}

.grid-item:hover {
    transform: translateY(-3px);
}

.grid-item img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.grid-item i {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: white;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Specific icon colors */
.bg-fb {
    background: linear-gradient(135deg, #18acfe 0%, #0163e0 100%);
}

.bg-tw {
    background: linear-gradient(135deg, #1da1f2 0%, #0d8bd9 100%);
}

.bg-chrome {
    background: white;
}

.bg-user {
    background: #E2E8F0;
    color: #4A5568 !important;
}

.bg-shield {
    background: #E2E8F0;
    color: #4A5568 !important;
}

.bg-info {
    background: #E2E8F0;
    color: #4A5568 !important;
}

.grid-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 15px;
}

.contact-btn-full {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s;
}

.contact-btn-full:hover {
    background: var(--primary-color);
    color: white;
}

/* Feature Section Styles */
.features-container {
    padding: 60px 0;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.feature-card {
    background: var(--card-bg);
    padding: 40px 30px;
    border-radius: 16px;
    text-align: center;
    box-shadow: var(--box-shadow);
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-10px);
}

.feature-card img {
    height: 120px;
    margin-bottom: 25px;
}

.feature-card h3 {
    font-size: 1.25rem;
    color: var(--text-main);
    margin-bottom: 15px;
    font-weight: 700;
}

.feature-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
}

@media (max-width: 768px) {

    .features-grid,
    .info-faq-grid {
        grid-template-columns: 1fr;
    }

    .info-card,
    .faq-card {
        min-height: auto;
    }

    .header-left {
        gap: 15px;
    }

    .nav-links,
    #themeToggle {
        display: none;
    }

    .hero-card {
        padding: 30px 15px;
    }
}

/* Main Content */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

main.container {
    margin-top: 40px;
}

.hero {
    text-align: center;
    margin-bottom: 40px;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: var(--text-main);
    font-weight: 500;
}

.hero .subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 30px;
}

.hero-card {
    background: white;
    padding: 60px 40px;
    border-radius: 20px;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.03);
    margin-bottom: 40px;
}

/* Search Box */
.search-container {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    z-index: 1003;
}

.search-wrapper {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 0;
    position: relative;
    z-index: 1002;
    /* Higher than before */
    overflow: visible;
    /* Changed from hidden to allow dropdown overlap if needed, though strictly strictly dropdown is outside */
}

/* Autocomplete Dropdown - Single Source of Truth */
.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    max-height: 300px;
    overflow-y: auto;
    display: none;
    z-index: 1010;
    /* Above search-wrapper (1002) and header (1000) */
    margin-top: 5px;
    padding: 10px 0;
    border: 1px solid #e2e8f0;
}

.autocomplete-dropdown.show {
    display: block !important;
}

.autocomplete-item {
    display: block;
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    color: var(--text-main);
    font-weight: 500;
    transition: background-color 0.2s;
    text-align: left;
}

.autocomplete-item:hover {
    background-color: #f8fafc;
    color: var(--primary-color);
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.search-input-group {
    display: flex;
    flex: 1;
    align-items: center;
    padding: 5px;
}


.search-input {
    flex: 1;
    border: none;
    padding: 15px 20px;
    font-size: 1rem;
    outline: none;
    border-radius: 8px;
    background: transparent;
}

.btn-paste {
    background-color: #ffdada;
    /* Lighter red for paste */
    color: var(--primary-color);
    border: none;
    padding: 8px 18px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    margin-right: 10px;
}

.btn-download {
    background-color: var(--primary-color);
    color: white;
    border: none;
    /* Combine with input */
    padding: 12px 30px;
    border-radius: 0 10px 10px 0;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    height: 100%;
    transition: background-color 0.2s;
}

.btn-download i {
    background: white;
    color: var(--primary-color);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.btn-download:hover {
    background-color: var(--primary-hover);
}

/* Buy Me a Coffee Button */
.coffee-button-container {
    text-align: center;
    margin: 25px 0 15px;
}

.btn-coffee {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 12px 32px;
    background-color: #FFFFFF;
    color: #000000;
    border: 2px solid #000000;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-coffee i {
    font-size: 1.2rem;
}

.btn-coffee:hover {
    background-color: #000000;
    color: #FFFFFF;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

body.dark-mode .btn-coffee {
    background-color: #1e293b;
    color: #f8fafc;
    border-color: #64748b;
}

body.dark-mode .btn-coffee:hover {
    background-color: #f8fafc;
    color: #0f172a;
    border-color: #f8fafc;
}

.copyright-notice {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 20px 0 30px;
}

#download-frame-container {
    margin-top: 30px;
    width: 100%;
    scroll-margin-top: 100px;
}

#download-frame {
    width: 100%;
    height: 800px;
    /* Use a large fixed height to avoid inner scroll */
    border: none;
    border-radius: 15px;
    background: #1a1c23;
    box-shadow: var(--box-shadow);
}

/* Results Section */
.results-container {
    margin-top: 40px;
    scroll-margin-top: 100px;
}

.result-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--box-shadow);
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 30px;
    margin-bottom: 30px;
}

.thumbnail-area {
    position: relative;
}

.thumbnail-area img {
    width: 100%;
    border-radius: 10px;
}

.thumbnail-area .duration {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.info-area h3 {
    font-size: 1.3rem;
    margin-bottom: 8px;
    color: var(--text-main);
}

.info-area .channel {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.download-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.format-selector {
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    font-size: 1rem;
    outline: none;
    background: #f8fafc;
}

.file-size {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.btn-final-download {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* List Results (Keywords) */
.list-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.list-item {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: transform 0.2s;
    cursor: pointer;
}

.list-item:hover {
    transform: translateY(-5px);
}

.list-item img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
}

.list-item-content {
    padding: 15px;
}

.list-item-content h4 {
    font-size: 1rem;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-item-content p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Two-Column Info/FAQ Section */
.info-faq-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 40px;
    align-items: start;
}

/* Subpage Specific Layout */
.subpage-header-intro {
    grid-column: 1 / -1;
    text-align: center;
    max-width: 900px;
    margin: 0 auto 40px;
    background: var(--card-bg);
    padding: 40px;
    border-radius: 16px;
    box-shadow: var(--box-shadow);
}

.subpage-header-intro h2 {
    font-size: 2rem;
    margin-bottom: 20px;
    color: var(--text-main);
}

.subpage-header-intro p {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text-muted);
}

.subpage-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    grid-column: 1 / -1;
}

.subpage-col {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 16px;
    box-shadow: var(--box-shadow);
    height: 100%;
}

.subpage-col h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--text-main);
    border-bottom: 2px solid var(--primary-color);
    display: inline-block;
    padding-bottom: 5px;
}

.subpage-col-list {
    text-align: left;
}

.subpage-col-list p {
    margin-bottom: 15px;
    color: var(--text-muted);
    font-size: 1rem;
}

@media (max-width: 768px) {
    .subpage-cols {
        grid-template-columns: 1fr;
    }
}

.info-card,
.faq-card {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
    min-height: 500px;
}

.info-card h2,
.faq-card h2 {
    font-size: 1.4rem;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-main);
}

.info-card p {
    color: var(--text-muted);
    line-height: 1.8;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.faq-item {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: white;
}

.faq-question {
    padding: 18px 20px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1rem;
    color: var(--text-main);
}

.faq-question i {
    font-size: 0.8rem;
    color: var(--text-muted);
    transition: transform 0.3s;
}

.faq-item.active .faq-question i {
    transform: rotate(180deg);
}

.faq-answer {
    padding: 0 20px 20px;
    color: var(--text-muted);
    line-height: 1.6;
    display: none;
}

.faq-item.active .faq-answer {
    display: block;
}

/* Loading Spinner */
.loader {
    display: none;
    text-align: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 0, 51, 0.1);
    border-left-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: inline-block;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsiveness */
@media (max-width: 768px) {

    /* Header Mobile */
    .desktop-icons,
    .grid-menu-container {
        display: none !important;
    }

    .mobile-icons {
        display: flex !important;
        align-items: center;
        gap: 10px;
    }

    .outline-btn {
        background: transparent;
        border: 1px solid #e2e8f0;
        color: var(--text-main);
        width: 38px;
        height: 38px;
        border-radius: 6px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        background-color: var(--primary-color);
        color: white;
        border: none;
        width: 38px;
        height: 38px;
        border-radius: 6px;
        cursor: pointer;
        font-size: 1.1rem;
    }

    .header-icons {
        gap: 10px;
    }

    /* Mobile Drawer */
    .mobile-drawer {
        position: fixed;
        top: 0;
        right: -100%;
        width: 85%;
        max-width: 320px;
        height: 100%;
        background-color: var(--card-bg);
        z-index: 2000;
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        display: flex;
        flex-direction: column;
        box-shadow: -5px 0 25px rgba(0, 0, 0, 0.1);
    }

    .mobile-drawer.show {
        right: 0;
    }

    .drawer-header {
        padding: 10px 20px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px solid #e2e8f0;
        height: 70px;
    }

    .drawer-header-actions {
        display: flex;
        gap: 10px;
        align-items: center;
    }

    .drawer-theme-toggle,
    .close-drawer {
        background: white;
        border: 1px solid #e2e8f0;
        width: 44px;
        height: 44px;
        border-radius: 6px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        font-size: 1.2rem;
        color: var(--text-main);
        transition: all 0.2s;
    }

    .close-drawer {
        font-size: 1.5rem;
        color: var(--text-muted);
    }

    body.dark-mode .drawer-theme-toggle,
    body.dark-mode .close-drawer {
        background: var(--card-bg);
        border-color: #334155;
    }

    .drawer-content {
        padding: 20px;
        flex: 1;
        overflow-y: auto;
    }

    .drawer-link {
        display: block;
        padding: 12px 0;
        font-size: 1.1rem;
        font-weight: 500;
        color: var(--text-main);
    }

    .drawer-divider {
        height: 1px;
        background-color: #f1f5f9;
        margin: 0;
    }

    body.dark-mode .drawer-divider {
        background-color: #334155;
    }

    .drawer-submenu-wrapper {
        display: flex;
        flex-direction: column;
    }

    .drawer-submenu {
        display: none;
        flex-direction: column;
    }

    .drawer-submenu.show {
        display: flex;
    }

    .submenu-item {
        padding-left: 25px !important;
        font-size: 1rem !important;
        color: var(--text-muted) !important;
    }

    .caret-icon {
        font-size: 0.8rem;
        transition: transform 0.3s;
        margin-left: 8px;
        pointer-events: none;
    }

    .drawer-link.active .caret-icon {
        transform: rotate(180deg);
    }


    .drawer-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 1999;
        display: none;
        opacity: 0;
        transition: opacity 0.3s;
    }

    .drawer-overlay.show {
        display: block;
        opacity: 1;
    }

    /* Hero Section Mobile */
    .hero-card {
        padding: 40px 20px;
        margin-bottom: 30px;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    /* Search Interface Mobile */
    .search-wrapper {
        flex-direction: column;
        background: transparent;
        border: none;
        gap: 15px;
        padding: 0;
    }

    .search-input-group {
        background: white;
        border: 1px solid #e2e8f0;
        border-radius: 10px;
        width: 100%;
        padding: 5px;
        position: relative;
    }

    .search-input {
        padding: 15px;
        font-size: 0.95rem;
    }

    .btn-paste {
        padding: 8px 12px;
        font-size: 0.85rem;
        margin-right: 5px;
    }

    .btn-download {
        width: auto;
        min-width: 180px;
        height: 50px;
        border-radius: 10px;
        justify-content: center;
        box-shadow: 0 4px 15px rgba(255, 0, 51, 0.2);
        margin: 0 auto;
    }

    /* Content Stacking Mobile */
    .info-faq-grid {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }

    .info-card,
    .faq-card {
        padding: 30px 20px;
        background: var(--card-bg) !important;
        box-shadow: var(--box-shadow) !important;
        border-radius: 16px;
        min-height: auto;
    }

    .info-card h2,
    .faq-card h2 {
        font-size: 1.25rem;
        margin-bottom: 20px;
    }

    .faq-question {
        padding: 15px;
        font-size: 0.95rem;
    }

    .result-card {
        grid-template-columns: 1fr;
    }

    /* Dark Mode Mobile Overrides */
    body.dark-mode .search-input-group {
        background: var(--card-bg);
        border-color: #334155;
    }

    body.dark-mode .outline-btn {
        border-color: #334155;
        color: var(--text-main);
    }

    /* Mobile Autocomplete Fix - Use flexbox order */
    .search-wrapper {
        position: relative;
    }

    .search-input-group {
        position: relative;
        order: 1;
    }

    .autocomplete-dropdown {
        position: relative !important;
        order: 2;
        z-index: 1;
        margin-top: -5px;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
    }

    .btn-download {
        order: 3;
    }
}

/* How to Use - Timeline */
.how-to-header {
    margin: 40px 0 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e2e8f0;
}

.how-to-header h1 {
    font-size: 1.8rem;
    color: var(--text-main);
    font-weight: 500;
}

.timeline-card {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 16px;
    box-shadow: var(--box-shadow);
    margin-bottom: 40px;
}

.timeline {
    position: relative;
    max-width: 900px;
    margin: 40px auto;
    padding: 20px 0;
}

.timeline::after {
    content: '';
    position: absolute;
    width: 2px;
    background-color: #e2e8f0;
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -1px;
}

body.dark-mode .how-to-header {
    border-color: #334155;
}

body.dark-mode .timeline::after {
    background-color: #334155;
}

.timeline-item {
    padding: 10px 40px;
    position: relative;
    background-color: inherit;
    width: 50%;
}

.timeline-item::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    right: -7px;
    background-color: #FF0033;
    top: 15px;
    border-radius: 50%;
    z-index: 1;
}

.left-timeline {
    left: 0;
}

.right-timeline {
    left: 50%;
}

.right-timeline::after {
    left: -7px;
}

.timeline-content {
    padding: 10px 30px;
    position: relative;
}

.left-timeline .timeline-content {
    text-align: right;
}

.timeline-step {
    font-size: 2rem;
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 5px;
}

.timeline-title {
    color: #FF0033;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.timeline-desc {
    font-size: 0.95rem;
    color: var(--text-muted);
}

@media screen and (max-width: 768px) {
    .timeline::after {
        left: 31px;
    }

    .timeline-item {
        width: 100%;
        padding-left: 70px;
        padding-right: 25px;
    }

    .timeline-item::after {
        left: 24px;
        top: 15px;
    }

    .right-timeline {
        left: 0%;
    }

    .left-timeline .timeline-content {
        text-align: left;
    }
}

/* Language Dropdown */
.lang-dropdown-container {
    position: relative;
    display: flex;
}

.lang-dropdown {
    position: absolute;
    top: calc(100% + 15px);
    right: 0;
    background: white;
    min-width: 260px;
    max-height: 320px;
    overflow-y: auto;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    padding: 6px;
    display: none;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    z-index: 2000;
    border: 1px solid #e2e8f0;
}

.lang-dropdown.show {
    display: grid;
}

body.dark-mode .lang-dropdown {
    background: var(--card-bg);
    border-color: #334155;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.lang-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--text-main);
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
}

.lang-item:hover {
    background: #f8fafc;
    color: var(--primary-color);
}

body.dark-mode .lang-item:hover {
    background: #334155;
}

.lang-item.active {
    background: #FF0033;
    color: white !important;
}

.lang-code {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    opacity: 0.7;
    width: 25px;
    background: #f1f5f9;
    padding: 2px 4px;
    border-radius: 4px;
    text-align: center;
    color: #475569;
}

.lang-item.active .lang-code {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    opacity: 1;
}

@media screen and (max-width: 768px) {
    .lang-dropdown {
        position: absolute;
        top: calc(100% + 15px);
        right: 0;
        width: 300px;
        max-height: 400px;
        background: var(--card-bg);
        border: 1px solid #e2e8f0;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
        z-index: 2000;
        display: none;
        grid-template-columns: 1fr 1fr;
        transform: none;
        left: auto;
    }

    body.dark-mode .lang-dropdown {
        border-color: #334155;
    }

    .lang-dropdown.show {
        display: grid;
    }

    .drawer-section-title {
        padding: 20px 0 10px;
        font-size: 0.9rem;
        font-weight: 700;
        text-transform: uppercase;
        color: var(--text-muted);
        letter-spacing: 0.05em;
    }

    .mobile-lang-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        padding-bottom: 20px;
    }

    .mobile-lang-grid .lang-item {
        padding: 8px 12px;
        background: #f1f5f9;
        border-radius: 8px;
    }

    body.dark-mode .mobile-lang-grid .lang-item {
        background: #334155;
    }

    .mobile-lang-grid .lang-item.active {
        background: var(--primary-color);
    }
}

/* Flag Icon Styles */
.lang-item .fi {
    width: 20px;
    height: 15px;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}