:root {
    --primary-color: #3b82f6;
    /* Bright Blue Accent */
    --primary-hover: #2563eb;
    --secondary-color: #64748b;
    /* Muted Slate */
    --bg-color: #0f172a;
    /* Deep Navy */
    --card-bg: rgba(30, 41, 59, 0.6);
    /* Glassy Dark */
    --text-color: #f8fafc;
    /* Off-white */
    --text-muted: #94a3b8;
    /* Slate Text */
    --border-radius: 16px;
    --shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    --border-light: rgba(255, 255, 255, 0.1);
    --container-width: 800px;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: #0f172a;
    color: white;
    margin: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}
img.emoji {
    height: 1.1em;       /* Yazı boyutuyla aynı boyda kalması için */
    width: 1.1em;
    margin: 0 .05em 0 .1em;
    vertical-align: -0.1em;
    display: inline-block;
}

/* Global Main Layout Container - Applied to all pages for symmetry */
.main-layout {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 2rem;
    box-sizing: border-box;
}

.container {
    width: 100%;
    max-width: var(--container-width);
    padding: 2rem;
    margin: 0 auto;
    text-align: center;
    box-sizing: border-box;
}

/* Home Page */
.home-container h1 {
    font-size: 3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.home-container p {
    color: var(--text-muted);
    font-size: 1.2rem;
    margin-bottom: 3rem;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Buttons */
.btn {
    border: none;
    outline: none;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn:active {
    transform: scale(0.98);
}

.btn-large {
    padding: 1.5rem;
    border-radius: var(--border-radius);
    font-size: 1.5rem;
    color: rgb(199, 181, 181);
    box-shadow: var(--shadow);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.5);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.5);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: white;
    border: 1px solid var(--border-light);
    backdrop-filter: blur(5px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Specific styling for Heart Sounds button on Home */
.menu-buttons .btn-secondary {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.icon {
    margin-right: 1rem;
    font-size: 2rem;
}

/* Flashcard Page */
.flashcard-container header {
    margin-bottom: 2rem;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.back-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--primary-color);
}

.flashcard-container h2 {
    margin: 0;
    font-size: 1.5rem;
}

.card {
    background: rgba(30, 41, 59, 0.6);
    border-radius: var(--border-radius);
    padding: 3rem 2rem;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 2rem;
    min-height: 400px;
    justify-content: space-between;
    transition: transform 0.3s, box-shadow 0.3s;
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-light);
}

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

.icon-display {
    font-size: 5rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    background-clip: text;
}


#listener-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.waveform-container {
    width: 100%;
    height: 128px;
    background: rgba(30, 41, 59, 0.4);
    border-radius: 8px;
    margin-bottom: 1.5rem;
    overflow: hidden;
    position: relative;
}

.btn-round {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    padding: 0;
    font-size: 1rem;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    background: var(--primary-color);
    border: none;
    box-shadow: 0 4px 10px rgba(74, 144, 226, 0.3);
    transition: transform 0.2s, background-color 0.2s;
}

.btn-round:hover {
    background-color: #357abd;
}

.btn-icon {
    font-size: 1.5rem;
    margin-left: 2px;
    /* Visual center adjustment for play triangle */
}

.instruction {
    margin-top: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.sound-name-display {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 1rem 0 0 0;
}

#answer-section {
    border-top: 1px solid var(--border-light);
    animation: fadeIn 0.5s;
}

.hidden {
    display: none !important;
}

.card-actions .btn-secondary {
    width: 100%;
    padding: 1rem;
    border-radius: 12px;
    font-size: 1.1rem;
    background: #f0f0f0;
    color: #333;
}

.card-actions .btn-secondary:hover {
    background: #e0e0e0;
}

.navigation-controls {
    margin-top: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
}

#answer-section .navigation-controls {
    margin-top: 1.5rem;
    border-top: 1px solid var(--border-light);
    padding-top: 1rem;
}

.btn-text {
    background: none;
    color: var(--text-muted);
    padding: 0.5rem 3rem;
    font-size: 1.8rem;
}

.btn-text:hover {
    color: var(--text-color);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Homepage Redesign --- */
.home-body {
    background-color: #0f172a;
    /* Dark navy/slate background */
    color: white;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
}

.hero-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 1200px;
    padding: 0 4rem;
    gap: 1rem;
    margin: auto;
    flex: 1;
    /* Take up available space between header and footer */
}

.hero-content {
    flex: 1;
    max-width: 600px;
}

.hero-title {
    font-size: 4.5rem;
    /* Scaled 1.3x */
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    letter-spacing: -1px;
}

.hero-title .highlight {
    color: #3b82f6;
    /* Bright Blue */
}

.hero-subtitle {
    font-size: 1.5rem;
    /* Scaled 1.3x */
    color: #94a3b8;
    /* Muted text */
    margin-bottom: 2.5rem;
    font-weight: 400;
}

.hero-buttons {
    display: flex;
    gap: 1.5rem;
}

.btn-hero {
    display: inline-block;
    padding: 1.75rem 3.5rem;
    /* Scaled 1.75x */
    border-radius: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s, opacity 0.2s;
    font-size: 1.7rem;
    /* Scaled 1.75x */
    border: none;
}

.btn-hero:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

.btn-lung {
    background-color: #1e293b;
    /* Darker slate */
    color: white;
}

.btn-heart {
    background-color: #1e293b;
    /* Darker slate */
    color: white;
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
}

.hero-image img {
    max-width: 100%;
    height: auto;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.3));
    max-height: 600px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .hero-container {
        flex-direction: column;
        padding: 2rem;
        text-align: center;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-buttons {
        justify-content: center;
    }
}

/* --- Category Page Redesign --- */
.category-body {
    background: #0f172a;
    color: white;
    font-family: 'Outfit', sans-serif;
    min-height: 100vh;
    margin: 0;
    padding: 2rem;
    box-sizing: border-box;
}

/* Tüm ana bölümleri (header, section vb.) ortalayan ana kural */
/* Category Page Wrapper */
.category-body>*:not(.sidebar):not(.sidebar-backdrop):not(.site-header):not(script) {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

.app-header {
    display: flex;
    flex-direction: column;
    /* Link ve başlığı alt alta düzgün dizmek için */
    align-items: flex-start;
    /* İçeriği sola yasla (Çünkü kapsayıcı zaten ortalı) */
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* header-left içindeki kısıtlamayı kaldırıyoruz */
.header-left {
    width: 100%;
}

.title-section {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    width: 100%;
}

.category-icon {
    font-size: 3rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 70px;
    /* İkonun sabit durması için */
    height: 70px;
}

/* Başlık ve alt metin stilini netleştiriyoruz */
.title-section h1 {
    margin: 0;
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.title-section p {
    margin: 0.2rem 0 0;
    color: #94a3b8;
    font-size: 1.1rem;
}

/* Progress Card Placeholder */
.progress-card {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(59, 130, 246, 0.3);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    display: flex;
    gap: 1rem;
    align-items: center;
    backdrop-filter: blur(10px);
}

.progress-icon {
    font-size: 1.5rem;
    color: #3b82f6;
}

.progress-card h3 {
    margin: 0;
    font-size: 0.9rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.progress-card p {
    margin: 0.2rem 0;
    font-size: 0.9rem;
    font-weight: 600;
}

.progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin-top: 0.5rem;
    width: 150px;
    overflow: hidden;
}

.progress-bar .fill {
    height: 100%;
    background: #3b82f6;
    box-shadow: 0 0 10px #3b82f6;
}

/* Subfolder Grid */
.subfolder-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 4rem;
}

@media (max-width: 1200px) {
    .subfolder-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

.subfolder-card {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
    /* Fixed dimensions */
    min-height: 180px;
    max-height: 180px;
    display: flex;
    flex-direction: column;
}

.subfolder-card:hover {
    background: rgba(30, 41, 59, 0.7);
    border-color: rgba(59, 130, 246, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

/* Card Glow Effect (Pseudo-element optional, kept simple for now) */

.card-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.5rem;
}

.card-icon {
    font-size: 1.5rem;
}

.subfolder-card h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
}

.card-desc {
    font-size: 0.9rem;
    color: #94a3b8;
    margin-bottom: 1.5rem;
    line-height: 1.4;
    flex: 1;
    /* Push button to bottom */
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.btn-start {
    display: inline-block;
    background: rgba(255, 255, 255, 0.05);
    color: white;
    text-decoration: none;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s;
}

.subfolder-card:hover .btn-start {
    background: rgba(59, 130, 246, 0.2);
    border-color: #3b82f6;
}

/* Training Modes */
.training-modes {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
}

.training-modes h3 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    color: #94a3b8;
}

.modes-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.mode-card {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: white;
    transition: all 0.2s;
}

.mode-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
}

.mode-quiz {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
}

.mode-quiz:hover {
    background: rgba(59, 130, 246, 0.2);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.2);
}

.mode-icon {
    font-size: 1.5rem;
}

.mode-info h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.mode-info p {
    margin: 0.2rem 0 0;
    font-size: 0.8rem;
    color: #94a3b8;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .modes-grid {
        grid-template-columns: 1fr;
    }

    .app-header {
        flex-direction: column;
        gap: 2rem;
    }
}

/* ========================================
   GLOBAL HEADER & FOOTER
   ======================================== */

/* --- Site Header --- */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: #0f172a;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.site-header .header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.8rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.menu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.hamburger-icon {
    font-size: 1.5rem;
    color: white;
}

.site-logo {
    font-size: 1.3rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
    letter-spacing: -0.5px;
}

.logo-accent {
    color: #3b82f6;
}

/* Language Selector */
.lang-selector {
    position: relative;
    display: inline-block;
}

.lang-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

.lang-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 0.5rem;
    min-width: 140px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    transform-origin: top right;
    transition: all 0.2s;
}

.lang-dropdown.hidden {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
}

.lang-option {
    background: none;
    border: none;
    color: #e2e8f0;
    padding: 0.6rem 1rem;
    text-align: left;
    cursor: pointer;
    border-radius: 6px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    transition: background 0.2s;
}

.lang-option:hover {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.lang-option .flag-icon {
    font-size: 1.2rem;
}

/* --- Site Footer --- */
.site-footer {
    background-color: #0f172a;
    color: white;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: auto;
}

.site-footer .footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.footer-columns {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
}

.footer-brand {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0 0 1rem 0;
}

.footer-tagline {
    font-size: 0.85rem;
    color: #94a3b8;
    line-height: 1.6;
    max-width: 300px;
}

.footer-heading {
    font-size: 0.75rem;
    font-weight: 600;
    color: #3b82f6;
    letter-spacing: 1px;
    margin: 0 0 1rem 0;
    text-transform: uppercase;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

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

.footer-links a {
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: white;
}

.footer-coffee-btn {
    display: inline-block;
    padding: 0.15rem;
    border: none;
    border-radius: 8px;
    color: #fbbf24 !important;
    font-weight: 600;
    transition: all 0.2s;
}

.footer-coffee-btn:hover {
    background: rgba(245, 158, 11, 0.15);
    color: #fcd34d !important;
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.25);
}

/* Footer Bottom Bar */
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom .footer-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
}

.copyright {
    font-size: 0.8rem;
    color: #64748b;
    margin: 0;
}

.footer-social {
    display: flex;
    gap: 1.5rem;
}

.footer-social a {
    color: #64748b;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color 0.2s;
}

.footer-social a:hover {
    color: white;
}

/* Body adjustments for fixed header */
body.has-header-footer {
    padding-top: 60px;
    /* Height of header */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body.has-header-footer>.container,
body.has-header-footer>main {
    flex: 1;
}

/* Mobile footer */
@media (max-width: 768px) {
    .footer-columns {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .footer-bottom .footer-container {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    /* Fixed Homepage Mobile Layout */
    .hero-container {
        padding: 2rem 1rem;
        /* Reduce padding */
        overflow-x: hidden;
        /* Prevent overflow */
    }

    .hero-content {
        width: 100%;
        padding: 0 1rem;
        /* Add internal spacing */
        box-sizing: border-box;
    }

    .hero-buttons {
        flex-direction: column;
        width: 100%;
        gap: 1rem;
    }

    .btn-hero {
        width: 100%;
        box-sizing: border-box;
        text-align: center;
        padding: 1.2rem;
        /* Reduced padding for mobile */
        font-size: 1.3rem;
        /* Slightly smaller text */
        display: flex;
        /* Ensure flex centering works */
        justify-content: center;
    }

    /* Fixed Flashcard Mobile Navigation */
    .flashcard-container {
        padding: 1rem;
        /* Reduce container padding */
    }

    .card {
        padding: 1.5rem 1rem;
        /* Compact card padding */
        min-height: auto;
        /* Allow height to adjust */
    }

    .navigation-controls {
        flex-direction: row;
        /* Keep row but use wrap if needed, or scale down */
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }

    .btn-text {
        padding: 0.5rem 1rem;
        /* Drastically reduce side padding (was 3rem) */
        font-size: 1.2rem;
        /* Smaller font */
        flex: 1;
        /* Distribute space evenly */
        min-width: 100px;
        /* Ensure clickability */
        text-align: center;
    }

    #counter {
        width: 100%;
        /* Force counter to its own line or center it */
        text-align: center;
        order: -1;
        /* Move counter to top or keep in middle? Let's keep distinct */
        margin-bottom: 0.5rem;
    }

    /* Re-order for better mobile flow: Counter Top, Buttons Below */
    .navigation-controls {
        flex-direction: row;
        gap: 0.5rem;
    }

    /* Make buttons essentially 50% each side */
    #btn-prev,
    #btn-next {
        flex: 1;
        background: rgba(255, 255, 255, 0.05);
        /* Add slight background for touch target visibility */
        border-radius: 8px;
    }
}

/* Modern Input & Select Styling */
select,
input[type="text"],
input[type="email"] {
    width: 100%;
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid var(--border-light);
    background: rgba(15, 23, 42, 0.6);
    color: white;
    font-family: inherit;
    font-size: 1rem;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' 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: 1em;
    transition: border-color 0.2s, box-shadow 0.2s;
}

select:focus,
input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #0f172a;
}

::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* --- Compare Page Styles --- */
.comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.compare-box {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    backdrop-filter: blur(10px);
}

.compare-box .controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* --- Learn/Quiz Page Styles --- */
.quiz-container {
    max-width: 800px;
    /* Slightly narrower for focus */
    margin: 0 auto;
}

.question-box {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    text-align: center;
    backdrop-filter: blur(10px);
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.option-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    position: relative;
    border: 2px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-height: 80px;
    transition: transform 0.2s, border-color 0.2s, background 0.2s;
    color: white;
}

.option-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(30, 41, 59, 0.8);
}

.option-text {
    font-size: 1.2rem;
    font-weight: 600;
}

.option-index {
    color: var(--text-muted);
    font-weight: 600;
    margin-right: 1rem;
}

.clue-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border-light);
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 0.8rem;
    color: var(--text-muted);
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s;
}

.clue-btn:hover,
.clue-btn.active {
    background: white;
    color: #333;
}

.question-box .action-bar {
    margin-top: 2rem;
    border-top: 1px solid var(--border-light);
    padding-top: 1rem;
}

.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* height removed to allow content to dictate */
}

.btn-pass {
    background: transparent;
    color: var(--text-muted);
    font-size: 1rem;
    padding: 0.5rem 1rem;
    transition: color 0.2s;
}

.btn-pass:hover {
    color: white;
}

.btn-next {
    margin-left: auto;
}

/* Quiz State Classes */
.option-correct {
    border-color: #2ecc71 !important;
    background-color: rgba(46, 204, 113, 0.2) !important;
}

.option-wrong {
    border-color: #e74c3c !important;
    background-color: rgba(231, 76, 60, 0.2) !important;
}

.disabled {
    pointer-events: none;
    opacity: 0.8;
}

/* --- Quiz Setup Screen --- */
.quiz-setup {
    display: flex;
    justify-content: center;
    padding: 2rem 0;
}

.quiz-setup-card {
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    padding: 3rem 2.5rem;
    text-align: center;
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
    max-width: 400px;
    width: 100%;
}

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

.quiz-setup-card h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #e2e8f0;
}

.quiz-setup-input-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.quiz-setup-adj {
    width: 44px;
    height: 44px;
    font-size: 1.4rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-light);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.quiz-setup-adj:hover {
    background: rgba(255, 255, 255, 0.15);
}

.quiz-setup-input {
    width: 80px;
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    background: rgba(15, 23, 42, 0.6);
    border: 2px solid var(--border-light);
    border-radius: 12px;
    color: white;
    padding: 0.5rem;
    -moz-appearance: textfield;
}

.quiz-setup-input::-webkit-outer-spin-button,
.quiz-setup-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.quiz-setup-hint {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 2rem;
}

.quiz-setup-start {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
}

/* --- Quiz Progress --- */
.quiz-progress {
    text-align: center;
    margin-bottom: 1rem;
}

.quiz-progress span {
    display: inline-block;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
    padding: 0.4rem 1.2rem;
    border-radius: 99px;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* --- Quiz Report --- */
.quiz-report {
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

.quiz-report-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.quiz-report-header h3 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #e2e8f0;
}

.quiz-report-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
}

.quiz-report-table th,
.quiz-report-table td {
    padding: 0.75rem 1rem;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.quiz-report-table th {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-bottom: 1rem;
}

.quiz-report-table td.report-folder,
.quiz-report-table th:first-child {
    text-align: left;
}

.quiz-report-table td.report-folder {
    font-weight: 600;
    color: #e2e8f0;
}

.col-correct {
    color: #2ecc71;
}

.col-incorrect {
    color: #e74c3c;
}

.col-passed {
    color: #f39c12;
}

.report-total-row {
    border-top: 2px solid rgba(255, 255, 255, 0.15);
}

.report-total-row td {
    padding-top: 1rem;
}

.quiz-score-summary {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    color: #a5b4fc;
    margin: 1rem 0 1.5rem;
}

.quiz-report-restart {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
}

@media (max-width: 768px) {

    .comparison-grid,
    .options-grid {
        grid-template-columns: 1fr;
    }

    .quiz-container {
        padding: 0 1rem;
    }

    .quiz-setup-card {
        padding: 2rem 1.5rem;
    }
}

/* --- Sidebar Menu --- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 300px;
    height: 100vh;
    background: #0a0f1e;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 1001;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    overflow-y: auto;
}

.sidebar.open {
    transform: translateX(0);
}

.sidebar-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1.2rem;
    box-sizing: border-box;
}

/* Header: MENU + Close */
.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.sidebar-title {
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 3px;
    color: #3b82f6;
    text-transform: uppercase;
}

.sidebar-close {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.25rem;
    transition: color 0.2s;
}

.sidebar-close:hover {
    color: white;
}

/* Top Navigation */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1.25rem;
    color: white;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    border-radius: 12px;
    transition: all 0.2s;
}

.sidebar-link:hover {
    background: rgba(30, 41, 59, 0.6);
}

.sidebar-link-active {
    background: rgba(30, 41, 59, 0.8);
}

.sidebar-link-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.sidebar-link-text {
    flex: 1;
}

/* Bottom Section */
.sidebar-footer {
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.7rem 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    color: white;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    transition: all 0.2s;
    background: transparent;
}

.sidebar-btn:hover {
    background: rgba(30, 41, 59, 0.5);
    border-color: rgba(255, 255, 255, 0.2);
}

.sidebar-btn-icon {
    font-size: 1.1rem;
}

.sidebar-btn-accent {
    background: #3b82f6;
    border-color: #3b82f6;
}

.sidebar-btn-accent:hover {
    background: #2563eb;
    border-color: #2563eb;
}

/* Backdrop Overlay */
.sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

.sidebar-backdrop.show {
    opacity: 1;
    visibility: visible;
}

/* ========================================
   CLINICAL PEARL BUTTON & OVERLAY
   ======================================== */

.pearl-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, filter 0.2s;
}

.pearl-btn img {
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.35)) drop-shadow(0 0 12px rgba(255, 215, 0, 0.25));
    transition: filter 0.2s, transform 0.2s;
}

.pearl-btn:hover img {
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.55)) drop-shadow(0 0 18px rgba(255, 215, 0, 0.45));
    transform: scale(1.1);
}

.pearl-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.97);
    border-radius: var(--border-radius);
    z-index: 20;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s;
    overflow: hidden;
}

.pearl-overlay.show {
    opacity: 1;
    visibility: visible;
}

.pearl-overlay-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
}

.pearl-overlay-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #ffd700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pearl-close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.pearl-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.pearl-overlay-body {
    flex: 1;
    overflow-y: auto;
    color: #e2e8f0;
    font-size: 0.95rem;
    line-height: 1.7;
    white-space: pre-line;
    padding-right: 0.5rem;
}

.pearl-overlay-body-lg {
    font-size: 1.15rem;
    line-height: 1.8;
}

.pearl-overlay-body::-webkit-scrollbar {
    width: 4px;
}

.pearl-overlay-body::-webkit-scrollbar-track {
    background: transparent;
}

.pearl-overlay-body::-webkit-scrollbar-thumb {
    background: rgba(255, 215, 0, 0.3);
    border-radius: 2px;
}

/* ===== About Page Sections ===== */
.about-section-card {
    margin-top: 2rem;
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
}

.about-section-gold {
    background: linear-gradient(135deg, rgba(161, 140, 30, 0.25) 0%, rgba(161, 140, 30, 0.08) 100%);
    border-color: rgba(161, 140, 30, 0.3);
}

.about-section-title {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--primary-color);
    margin: 0 0 1rem 0;
}

.about-section-text {
    color: #94a3b8;
    font-size: 0.95rem;
    line-height: 1.7;
    margin: 0 0 1.5rem 0;
}

.about-support-btn {
    display: block;
    text-align: center;
    padding: 1rem 2rem;
    background: rgba(161, 140, 30, 0.55);
    border-radius: 12px;
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: none;
    transition: background 0.2s;
}

.about-support-btn:hover {
    background: rgba(161, 140, 30, 0.75);
}

.about-source-box {
    padding: 1rem 1.25rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
}

.about-source-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 0.25rem;
}

.about-source-link {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    font-size: 1rem;
}

.about-source-link:hover {
    text-decoration: underline;
}

.about-privacy-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
}

.about-privacy-status {
    color: #ef4444;
    font-weight: 600;
    font-size: 0.95rem;
}

.about-privacy-toggle {
    padding: 0.55rem 1.2rem;
    border-radius: 8px;
    border: none;
    background: #16a34a;
    color: #fff;
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}

.about-privacy-toggle:hover {
    background: #15803d;
}

.about-privacy-toggle-disable {
    background: #dc2626;
}

.about-privacy-toggle-disable:hover {
    background: #b91c1c;
}

.about-privacy-toggle-enable {
    background: #16a34a;
}

.about-privacy-toggle-enable:hover {
    background: #15803d;
}

.about-contact-row {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.about-contact-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s;
}

.about-contact-linkedin {
    background: #0e7490;
    color: #fff;
}

.about-contact-linkedin:hover {
    background: #0c6578;
}

.about-contact-email {
    background: transparent;
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.about-contact-email:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.3);
}

@media (max-width: 500px) {
    .about-contact-row {
        flex-direction: column;
    }

    .about-privacy-box {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ===== Site Guide Page ===== */
.guide-hero {
    margin-bottom: 2.5rem;
}

.guide-title {
    font-size: 3rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 0.75rem 0;
    line-height: 1.1;
}

.guide-subtitle {
    color: #94a3b8;
    font-size: 1.05rem;
    line-height: 1.7;
    max-width: 800px;
    margin: 0;
}

.guide-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-bottom: 3rem;
}

.guide-card {
    display: flex;
    flex-direction: column;
    padding: 1.75rem 1.5rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(255, 255, 255, 0.03);
    transition: border-color 0.25s, transform 0.25s;
}

.guide-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.guide-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    font-size: 1.5rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    margin-bottom: 1rem;
}

.guide-card-icon-img {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    padding: 6px;
    margin-bottom: 1rem;
    object-fit: contain;
}

.guide-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 1rem 0;
}

.guide-card-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--primary-color);
    margin: 0 0 0.5rem 0;
}

.guide-card-quote {
    color: #94a3b8;
    font-size: 0.85rem;
    line-height: 1.65;
    margin: 0 0 1.25rem 0;
}

.guide-card-tip {
    flex: 1;
    padding: 1.1rem 1rem;
    border-radius: 10px;
    background: rgba(59, 130, 246, 0.06);
    border: 1px solid rgba(59, 130, 246, 0.1);
    margin-bottom: 1rem;
}

.guide-card-tip p {
    color: #cbd5e1;
    font-size: 0.82rem;
    line-height: 1.6;
    margin: 0;
}

.guide-card-link {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--primary-color);
    text-decoration: none;
    margin-top: auto;
    transition: color 0.2s;
}

.guide-card-link:hover {
    color: #60a5fa;
}

@media (max-width: 900px) {
    .guide-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 560px) {
    .guide-grid {
        grid-template-columns: 1fr;
    }

    .guide-title {
        font-size: 2.2rem;
    }
}

/* ===== Citations Page ===== */
.cite-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.cite-card {
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(255, 255, 255, 0.03);
}

.cite-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.35rem 0.9rem;
    border-radius: 6px;
    margin-bottom: 1.25rem;
}

.cite-badge-heart {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.cite-badge-lung {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.25);
}

.cite-article-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: #e2e8f0;
    line-height: 1.5;
    margin: 0 0 0.75rem 0;
}

.cite-authors {
    color: #94a3b8;
    font-size: 0.9rem;
    margin: 0 0 0.25rem 0;
}

.cite-journal {
    color: #64748b;
    font-size: 0.9rem;
    margin: 0 0 1.25rem 0;
}

.cite-links {
    gap: 0.75rem;
    flex-wrap: wrap;
}

.cite-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.6rem 1.1rem;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s;
}

.cite-link-doi {
    background: rgba(255, 255, 255, 0.05);
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.cite-link-doi:hover {
    background: rgba(255, 255, 255, 0.1);
}

.cite-link-dataset {
    background: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.15);
}

.cite-link-dataset:hover {
    background: rgba(59, 130, 246, 0.2);
}

/* ===== Coming Soon Page ===== */
.coming-badge {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 0.3rem 0.75rem;
    border-radius: 6px;
    background: rgba(168, 85, 247, 0.15);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.25);
    margin-bottom: 1rem;
}

.coming-card {
    border-color: rgba(168, 85, 247, 0.12);
}

.coming-card:hover {
    border-color: rgba(168, 85, 247, 0.3);
}

.btn-ai-support {
    display: block;
    width: 630px;
    /* Matches the combined width of .hero-buttons + gap in desktop view */
    max-width: 85%;
    margin: 1.5rem 0rem;
    text-align: center;
    background: linear-gradient(135deg, rgba(85, 85, 247, 0.15) 0%, rgba(107, 85, 247, 0.05) 100%);
    border: 1px solid rgba(85, 131, 247, 0.643);
    color: #cfcfe2;
    font-size: 1.4rem;
    padding: 1.7rem 2rem;
}

.btn-ai-support:hover {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.25) 0%, rgba(168, 85, 247, 0.1) 100%);
    border-color: rgba(168, 85, 247, 0.5);
    color: #e9d5ff;
    box-shadow: 0 4px 20px rgba(168, 85, 247, 0.15);
}
@media (max-width: 768px) {
    .btn-ai-support {
        width: 100%;
        max-width: 100%;
        padding: 1.2rem;
        font-size: 1.2rem;
        margin: 1rem 0;
    }
}