/* /assets/css/style.css */

/* 1. CSS Variables & Theming */
:root {
    --bg-color: #f8f9fa;
    --text-color: #212529;
    --text-muted: #6c757d;
    --primary-color: #0d6efd;
    --primary-hover: #0b5ed7;
    --border-color: #dee2e6;
    --header-bg: #ffffff;
    --footer-bg: #212529;
    --footer-text: #f8f9fa;
    --success-color: #198754;
    --danger-color: #dc3545;
    --wave-color: var(--primary-color);
    --font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    --container-width: 1100px;
    --header-height: 70px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

[data-theme="dark"] {
    --bg-color: #0c0c0f;
    --text-color: #e0e0e0;
    --text-muted: #888;
    --primary-color: #3b82f6;
    --primary-hover: #60a5fa;
    --border-color: #2a2a30;
    --header-bg: #16161a;
    --footer-bg: #16161a;
    --footer-text: #e0e0e0;
    --wave-color: var(--primary-hover);
}

/* 2. Base & Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: var(--font-family);
    zoom: 0.70;
    color: var(--text-color);
    line-height: 1.7;
    transition: background-color 0.3s, color 0.3s;
    -webkit-font-smoothing: antialiased;
}
body.preload * { transition: none !important; }
h1, h2, h3 { line-height: 1.3; margin-bottom: 1rem; font-weight: 700; }
h1 { font-size: 2.75rem; }
h2 { font-size: 2.25rem; }
h3 { font-size: 1.5rem; }
a { color: var(--primary-color); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-hover); }
.container { max-width: var(--container-width); margin: 0 auto; padding: 0 1rem; }

/* 3. Header & Footer */
.site-header {
    background-color: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 0 1rem;
    box-shadow: var(--shadow-sm);
    position: sticky; top: 0; z-index: 500;
}
.site-header .container { display: flex; justify-content: space-between; align-items: center; height: var(--header-height); }
.logo { font-size: 1.5rem; font-weight: 700; color: var(--text-color); text-decoration: none; letter-spacing: -0.5px; transition: opacity 0.2s; }
.logo:hover { text-decoration: none; opacity: 0.8; }
.logo span { font-weight: 500; color: var(--primary-color); }
.main-nav ul, .footer-nav ul { list-style: none; display: inline-flex; gap: 1.5rem; }
.main-nav a { font-weight: 500; }
.main-nav a.active { font-weight: 700; color: var(--primary-color); }
.header-controls { display: flex; align-items: center; gap: 1rem; }
.site-footer {   padding: 2.5rem 0; text-align: center; }

/* Hero Section */
.hero {
    text-align: center;
    padding: 3rem 1rem 2rem;
}
.hero h1 {
    font-size: 2.8rem; /* Adjusted base size */
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -1px;
}
.hero .hero-subtitle {
    font-size: 1.25rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-weight: 500;
}
.hero .hero-description {
    font-size: 1.1rem;
    max-width: 650px;
    margin: 0 auto 2.5rem auto;
    color: var(--text-muted);
    line-height: 1.8;
}






/* --- REDESIGNED MIC TESTER UI --- */

.mic-tester-section {
    padding: 4rem 0;
    margin-top: -2rem;
    width: 100%;
}
.section-title {
    text-align: center;
    margin-bottom: 2.5rem;
}

/* Main UI Card */
.mic-tester-ui {
    position: relative;
    background: var(--header-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-areas: "visualizer info";
    gap: 2rem;
}

/* Left Column: Visualizer and main controls */
.visualizer-container {
    grid-area: visualizer;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
#mic-canvas {
    width: 100%;
    flex-grow: 1;
    background-color: var(--bg-color);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}
.meter {
    width: 100%;
    height: 12px;
    background-color: var(--bg-color);
    border-radius: 10px;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-color);
}
.level-bar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--success-color) 0%, #ffc107 80%, var(--danger-color) 95%);
    border-radius: 10px;
    transition: width 0.05s linear;
}
.preset-markers { display: none; } /* Simplified the meter */

.main-controls {
    display: flex;
    gap: 1rem;
    margin-top: auto; /* Push buttons to the bottom */
}
.mic-tester-ui button {
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--border-color);
    background: var(--header-bg);
    color: var(--text-color);
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.2s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
.mic-tester-ui button:hover:not(:disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: var(--bg-color);
}
.cta-button { /* Start/Stop Button */
    flex-grow: 1;
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}
.cta-button:hover:not(:disabled) {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
#record-btn { flex-grow: 1; }
.mic-tester-ui button:disabled { cursor: not-allowed; opacity: 0.6; }

/* Right Column: Info Dashboard */
.controls-grid {
    grid-area: info;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.device-selection {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.device-selection label { font-weight: 600; font-size: 0.9rem; color: var(--text-muted); }
.mic-tester-ui select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    background-color: transparent; /* Changed */
    color: var(--text-color);
    border-radius: 8px;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    font-size: 1rem;
}

.info-panel { padding: 0; }
.info-panel h3 { display: none; } /* Hide old h3 titles */
#status-text {
    font-weight: 600;
    text-align: center;
    color: var(--text-muted); /* Added for better style */
    padding: 1rem 0; /* Adjusted padding */
}
.mic-tester-ui[data-status="active"] #status-text {
    background-color: var(--success-color);
    color: white;
    border-color: var(--success-color);
}

.info-panel ul {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 10px;
}


.info-panel ul li:nth-child(3) {
    grid-column: 1 / -1; /* This makes the third item span both columns */
}

.info-panel li {
 
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid var(--border-color);
    text-align: center;
}
.info-panel li span {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 0.25rem;
}
#snr-info { color: var(--danger-color); }
#download-link {
    display: block;
    margin-top: 1rem;
    text-align: center;
    font-weight: 600;
}

/* --- END REDESIGNED MIC TESTER --- */


@media (max-width: 992px) {
    .mic-tester-ui {
        grid-template-columns: 1fr;
        grid-template-areas:
            "visualizer"
            "info";
    }
}


/* FAQ Section */
.faq-section { padding: 4rem 0; background: var(--header-bg); }
.faq-list { max-width: 800px; margin: 0 auto; }
.faq-list details { border-bottom: 1px solid var(--border-color); padding: 1.5rem 0; }
.faq-list summary { font-weight: 600; cursor: pointer; list-style: none; position: relative; padding-right: 2rem; font-size: 1.1rem; }
.faq-list p { margin-top: 1rem; opacity: 0.8; }


/* 5. Media Queries */
@media (min-width: 768px) {
    h1 { font-size: 3.5rem; }
    .hero h1 { font-size: 3.8rem; }
    .controls-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-areas:
            "main device"
            "info info";
    }
    .main-controls { grid-area: main; }
    .device-selection { grid-area: device; }
    .info-panel { grid-area: info; }
    .site-footer .container { flex-direction: row; justify-content: space-between; align-items: center; }
}

/* 7. Permission Warning */
#permission-warning {
    display: none;
    padding: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    color: #664d03;
}
[data-theme="dark"] #permission-warning {
    background-color: #332701;
    border-color: #b38f00;
    color: #ffeca7;
}
.warning-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    margin-top: 5px;
}
.warning-text h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    color: #664d03;
}
[data-theme="dark"] .warning-text h3 {
    color: #ffeca7;
}
.warning-text p {
    margin: 0;
    font-size: 0.9rem;
}
.mic-tester-ui.permission-denied .visualizer-container,
.mic-tester-ui.permission-denied .controls-grid {
    display: none;
}

/* 8. Content Section */
.content-section {
    padding: 4rem 0;
}
.content-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
    margin-bottom: 2.5rem;
}
@media (min-width: 768px) {
    .content-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
.content-block h2 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
    display: inline-block;
}
.content-block p {
    margin-bottom: 1rem;
    opacity: 0.9;
}
.steps-list, .features-list, .why-test ul {
    list-style-position: outside;
    padding-left: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.steps-list li::marker {
    font-weight: bold;
    color: var(--primary-color);
}
.steps-list p {
    margin-top: 0.25rem;
    margin-bottom: 0;
    opacity: 0.8;
}
.features-list li, .why-test li {
    padding-left: 0.5rem;
}

/* 9. PROFESSIONAL Language Switcher Design */
.lang-switcher {
    position: relative;
}

.lang-switcher-button {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-family: var(--font-family);
    color: var(--text-color);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    min-width: 80px;
}

.lang-switcher-button:hover {
    border-color: var(--primary-color);
    background-color: var(--header-bg);
}

.lang-switcher-button .globe-icon {
    color: var(--text-muted);
    flex-shrink: 0;
}

.lang-switcher-button .current-lang {
    font-weight: 600;
    letter-spacing: 0.5px;
    width: 100px;
}

.lang-switcher-button .chevron-icon {
    color: var(--text-muted);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.lang-switcher.open .lang-switcher-button .chevron-icon {
    transform: rotate(180deg);
}

.lang-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background-color: var(--header-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    min-width: 180px;
    z-index: 1000;
    overflow: hidden;
    
    /* Animation */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

[data-theme="dark"] .lang-dropdown {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.lang-switcher.open .lang-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-dropdown ul {
    list-style: none;
    padding: 8px;
    margin: 0;
}

.lang-dropdown ul li {
    margin: 0;
}

.lang-dropdown .lang-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    color: var(--text-color);
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 14px;
}

.lang-dropdown .lang-option:hover {
    background-color: var(--bg-color);
    color: var(--primary-color);
    transform: translateX(2px);
}

.lang-dropdown .lang-option.active {
    background-color: var(--primary-color);
    color: white;
}

.lang-dropdown .lang-option.active:hover {
    background-color: var(--primary-hover);
    color: white;
    transform: translateX(0);
}

.lang-dropdown .flag {
    font-size: 16px;
    flex-shrink: 0;
}

/* Theme Toggle Button */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.theme-toggle:hover {
    border-color: var(--primary-color);
    background-color: var(--header-bg);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
    color: var(--text-color);
    transition: all 0.2s ease;
}

.theme-toggle .sun {
    display: block;
}

.theme-toggle .moon {
    display: none;
}

[data-theme="dark"] .theme-toggle .sun {
    display: none;
}

[data-theme="dark"] .theme-toggle .moon {
    display: block;
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
    .header-controls {
        gap: 0.5rem;
    }
    
    .lang-switcher-button {
        padding: 6px 10px;
        font-size: 13px;
        min-width: 70px;
    }
    
    .lang-dropdown {
        right: -10px;
        min-width: 160px;
    }
    
    .theme-toggle {
        width: 36px;
        height: 36px;
    }
    
    .theme-toggle svg {
        width: 18px;
        height: 18px;
    }
}










/* 10. Legal Content Page Styles */
.legal-content {
    max-width: 800px;
    margin: 2rem auto 4rem auto;
}

.legal-content h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

.legal-content h2 {
    font-size: 1.75rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.legal-content p, .legal-content li {
    line-height: 1.8;
    color: var(--text-muted);
}

.legal-content ul {
    list-style-position: inside;
    padding-left: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.legal-content a {
    text-decoration: underline;
}

/* Add these styles to your /assets/css/style.css file */

.lang-list-wrapper {
    max-height: 260px; /* Limits the height, showing about 5 languages */
    overflow-y: auto;  /* Adds a scrollbar ONLY when needed */
    padding: 8px;      /* Moves the padding from the UL to here */
}

/* Remove padding from the original UL */
.lang-dropdown ul {
    padding: 0;
}

/* --- Optional: Custom Scrollbar Styling (Highly Recommended) --- */
.lang-list-wrapper::-webkit-scrollbar {
    width: 8px;
}

.lang-list-wrapper::-webkit-scrollbar-track {
    background: transparent;
    margin: 8px 0;
}

.lang-list-wrapper::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 10px;
    border: 2px solid var(--header-bg);
}

.lang-list-wrapper::-webkit-scrollbar-thumb:hover {
    background-color: var(--text-muted);
}











/* 11. Mobile Navigation Styles */
.mobile-nav-toggle {
    display: none; /* Hidden on desktop */
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001; /* Ensure it's on top */
}

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

.mobile-nav-toggle svg {
    width: 28px;
    height: 28px;
    color: var(--text-color);
}

.mobile-nav-toggle .icon-close {
    display: none;
}

/* Styles for when the menu is open */
.site-header.nav-open .mobile-nav-toggle .icon-hamburger {
    display: none;
}

.site-header.nav-open .mobile-nav-toggle .icon-close {
    display: block;
}

/* Media Query for mobile screens */
@media (max-width: 768px) {
    /* Show the hamburger button */
    .mobile-nav-toggle {
        display: block;
        order: 3; /* Move toggle to the end */
    }

    /* Move the controls next to the logo */
    .header-controls {
        order: 2;
    }
    .logo {
        order: 1;
    }
    
    /* Hide the original navigation */
    .main-nav {
        display: none;
        order: 4; /* Place the nav last */
        flex-basis: 100%; /* Make nav take full width */
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;
        background-color: var(--header-bg);
        border-bottom: 1px solid var(--border-color);
        box-shadow: var(--shadow-md);
        padding: 1rem;
    }

    /* When the menu is open, show the navigation */
    .site-header.nav-open .main-nav {
        display: block;
    }

    /* Style the list for vertical layout */
    .main-nav ul {
        flex-direction: column;
        gap: 0;
        width: 100%;
    }

    .main-nav li a {
        display: block;
        padding: 1rem;
        text-align: center;
        border-radius: 8px;
    }
    .main-nav li a:hover {
        background-color: var(--bg-color);
    }
}







