/* 
   Christians Need The Gospel - Theme
   Colors:
   - Deep Wine: #6D2532
   - Muted Rose: #9E5E65
   - Dark Grey: #333333
   - Soft Grey: #F2F2F2
   - Border Grey: #D1D1D1
*/

/* Search Bar Styles */
.search-container {
    margin: 30px 0;
}

.search-form {
    display: flex;
    gap: 10px;
    width: 100%;
}

.search-input {
    flex: 1;
    padding: 15px 20px;
    font-size: 1.1rem;
    border: 2px solid var(--border-grey);
    border-radius: 30px;
    outline: none;
    transition: border-color 0.2s;
}

.search-input:focus {
    border-color: var(--deep-wine);
}

.search-button {
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    background-color: var(--deep-wine);
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.search-button:hover {
    background-color: #5a1f2a;
}

:root {
    --deep-wine: #6D2532;
    --muted-rose: #9E5E65;
    --dark-grey: #333333;
    --soft-grey: #F2F2F2;
    --border-grey: #D1D1D1;
    --white: #ffffff;
    --text-color: #333333;
    --bg-color: #f9f9f9;
    --player-bg: rgba(255, 255, 255, 0.95);
    --highlight-bg: #fff5f5;
    --header-total-height: 180px; /* Default fallback; JS sets this precisely at runtime */
    --internal-banner-reveal-height: 260px; /* Default fallback; JS sets this precisely at runtime */
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    padding-bottom: 120px; /* Space for sticky player */
}

a {
    color: var(--muted-rose);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--deep-wine);
    text-decoration: underline;
}

/* Layout & Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header & Banner */
header {
    background-color: transparent;
    position: relative;
}

.banner-wrapper {
    width: 100%;
    background-color: var(--soft-grey);
    display: flex;
    justify-content: center;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1;
    height: auto;
}

.site-banner {
    width: 100%;
    height: 80vh;
    min-height: 500px;
    max-height: 100vh;
    object-fit: cover;
    object-position: center top;
    display: block;
    max-width: 100%;
}

/* Responsive banner heights for different screen sizes */
@media (min-width: 1200px) {
    .site-banner {
        height: 85vh;
        min-height: 600px;
    }
}

@media (min-width: 769px) and (max-width: 1199px) {
    .site-banner {
        height: 75vh;
        min-height: 500px;
    }
}

@media (max-width: 768px) {
    .site-banner {
        height: 70vh;
        min-height: 400px;
        max-height: 90vh;
    }
}

@media (max-width: 480px) {
    .site-banner {
        height: 65vh;
        min-height: 350px;
        max-height: 85vh;
    }
}

/* Landscape orientation on mobile devices - fill viewport */
@media (orientation: landscape) and (max-height: 600px) {
    .site-banner {
        height: 100vh;
        min-height: 100vh;
        max-height: 100vh;
    }
}

.nav-bar {
    background-color: var(--soft-grey);
    padding: 15px 0;
    border-bottom: 1px solid var(--border-grey);
    position: relative;
    z-index: 20;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

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

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

.nav-link {
    color: var(--dark-grey);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    position: relative;
}

.nav-link:hover {
    color: var(--deep-wine);
    text-decoration: none;
}

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

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

.dropdown-arrow {
    font-size: 0.7rem;
    transition: transform 0.2s ease;
}

.nav-dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--white);
    border: 1px solid var(--border-grey);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    z-index: 100;
    margin-top: 8px;
    padding: 8px 0;
}

.nav-dropdown:hover .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-dropdown-link {
    display: block;
    padding: 12px 20px;
    color: var(--dark-grey);
    font-weight: 500;
    font-size: 0.9rem;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.nav-dropdown-link:hover {
    background-color: var(--soft-grey);
    color: var(--deep-wine);
    text-decoration: none;
}

.nav-link-auth {
    margin-left: auto;
}

.nav-link-login {
    background: linear-gradient(135deg, #6D2532, #9E5E65);
    color: white;
    padding: 8px 18px;
    border-radius: 20px;
}

.nav-link-login:hover {
    color: white;
    text-decoration: none;
}

/* Mobile Menu Toggle Button (Hamburger) */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
    position: relative;
}

.hamburger-line {
    width: 100%;
    height: 3px;
    background-color: var(--dark-grey);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle:hover .hamburger-line {
    background-color: var(--deep-wine);
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    overflow-y: auto;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-content {
    position: fixed;
    top: 0;
    right: 0;
    width: 85%;
    max-width: 320px;
    height: 100%;
    background-color: var(--white);
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.2);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    padding: 20px;
}

.mobile-menu-overlay.active .mobile-menu-content {
    transform: translateX(0);
}

/* Mobile Menu Close Button (X) */
.mobile-menu-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    font-size: 2.5rem;
    color: var(--dark-grey);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    padding: 0;
    line-height: 1;
}

.mobile-menu-close:hover {
    background-color: var(--soft-grey);
    color: var(--deep-wine);
    transform: rotate(90deg);
}

.close-icon {
    display: block;
    font-weight: 300;
}

/* Mobile Navigation Links */
.mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 60px;
}

.mobile-nav-link {
    display: block;
    padding: 18px 20px;
    color: var(--dark-grey);
    font-weight: 600;
    font-size: 1.1rem;
    text-decoration: none;
    border-bottom: 1px solid var(--soft-grey);
    transition: all 0.2s ease;
}

.mobile-nav-section {
    border-bottom: 1px solid var(--soft-grey);
}

.mobile-nav-section-header {
    font-weight: 700;
    color: var(--deep-wine);
    background-color: var(--soft-grey);
}

.mobile-nav-sub-link {
    padding-left: 40px;
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--muted-rose);
}

.mobile-nav-link:hover {
    color: var(--deep-wine);
    background-color: var(--soft-grey);
    text-decoration: none;
    padding-left: 25px;
}

.mobile-nav-link-auth {
    margin-top: 20px;
    border-top: 2px solid var(--border-grey);
    border-bottom: 2px solid var(--border-grey);
    background-color: var(--soft-grey);
}

.mobile-nav-link-login {
    background: linear-gradient(135deg, #6D2532, #9E5E65);
    color: white;
    border-radius: 8px;
    text-align: center;
    margin-top: 20px;
    border: none;
}

.mobile-nav-link-login:hover {
    background: linear-gradient(135deg, #5a1f2a, #8a4d52);
    color: white;
    padding-left: 20px;
}

/* Scroll Indicator */
.scroll-indicator {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    text-align: center;
    cursor: pointer;
    opacity: 0.9;
    animation: bounce 2s infinite;
    color: var(--white);
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.scroll-indicator .arrow {
    width: 24px;
    height: 24px;
    border-right: 4px solid var(--white);
    border-bottom: 4px solid var(--white);
    transform: rotate(45deg);
    margin: 0 auto 5px;
    box-shadow: 2px 2px 2px rgba(0,0,0,0.3);
}

.scroll-indicator .scroll-text {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    display: block;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
    40% { transform: translateX(-50%) translateY(-10px); }
    60% { transform: translateX(-50%) translateY(-5px); }
}

/* Ensure main content has background to cover fixed banner */
main {
    position: relative;
    z-index: 10;
    background-color: rgba(249, 249, 249, 0.95); /* More opaque (95% opacity) */
    padding-top: 30px;
    min-height: 80vh;
}

footer {
    position: relative;
    z-index: 10;
    background-color: var(--bg-color);
}

.logo-text {
    font-family: 'Georgia', serif;
    color: var(--deep-wine);
    font-size: 1.5rem;
    font-weight: bold;
}

.subtitle-text {
    color: var(--muted-rose);
    font-size: 0.9rem;
    font-style: italic;
}

/* Stats Bar */
.stats-bar {
    display: flex;
    justify-content: center;
    gap: 40px;
    padding: 20px;
    background-color: var(--white);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-bottom: 30px;
    border: 1px solid var(--border-grey);
}

.stat-item { text-align: center; }
.stat-number { display: block; font-size: 1.8rem; font-weight: bold; color: var(--deep-wine); }
.stat-label { font-size: 0.9rem; color: var(--muted-rose); text-transform: uppercase; letter-spacing: 0.5px; }

/* Cards & Grids */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.card {
    background: var(--white);
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border: 1px solid #eee;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-color: var(--muted-rose);
}

/* Welcome Banner */
.welcome-banner {
    background: #fdf5f6;
    border: 1px solid var(--muted-rose);
    border-radius: 10px;
    padding: 18px 20px;
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--deep-wine);
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(109, 37, 50, 0.08);
}

.welcome-banner__emoji {
    font-size: 1.3rem;
    line-height: 1;
}

.welcome-banner__text {
    margin: 0;
}

.card-thumbnail {
    width: 100%;
    height: 180px;
    margin-bottom: 15px;
    border-radius: 6px;
    overflow: hidden;
    background: var(--soft-grey);
}

.card-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.card:hover .card-thumbnail img { transform: scale(1.05); }

.card-title {
    font-family: 'Georgia', serif;
    font-size: 1.4rem;
    color: var(--deep-wine);
    margin-bottom: 10px;
}

.card-description {
    color: #555;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 15px;
    flex-grow: 1;
}

.card-meta {
    border-top: 1px solid var(--soft-grey);
    padding-top: 15px;
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #777;
}

.meta-badge {
    background-color: var(--soft-grey);
    color: var(--dark-grey);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.purpose-badge { background-color: #e8eaf6; color: var(--deep-wine); }

/* Breadcrumbs */
.breadcrumb { padding: 15px 0; margin-bottom: 20px; color: #666; font-size: 0.9rem; }
.breadcrumb a { color: var(--muted-rose); }
.breadcrumb span { margin: 0 5px; color: #ccc; }

/* Detail Pages */
.page-header {
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border-grey);
    padding-bottom: 20px;
}

.page-title {
    font-family: 'Georgia', serif;
    font-size: 2.2rem;
    color: var(--deep-wine);
    margin-bottom: 10px;
}

.page-description { 
    font-size: 1.1rem; 
    color: #555; 
    max-width: 800px; 
    margin: 0 auto;
    line-height: 1.8;
    text-align: left;
}
.back-link { display: inline-flex; align-items: center; gap: 5px; margin-bottom: 20px; font-weight: 500; }

/* Clip Styles */
.clip-card {
    background: var(--white);
    border-radius: 12px; /* More rounded */
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05); /* Softer shadow */
    margin-bottom: 30px;
    border: 1px solid rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.clip-card.active-clip {
    border: 2px solid var(--muted-rose);
    box-shadow: 0 8px 24px rgba(109, 37, 50, 0.15);
    background-color: #fffdfd;
}

.clip-header {
    padding: 20px 25px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    background-color: #fafafa;
}

.clip-number {
    background-color: var(--deep-wine);
    color: var(--white);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

.clip-title {
    font-size: 1.4rem;
    color: var(--dark-grey);
    font-weight: 600;
    margin: 5px 0 10px 0;
    font-family: 'Georgia', serif;
}

.clip-original-title {
    font-size: 0.9rem;
    color: #888;
    font-style: italic;
}

.clip-body {
    padding: 25px;
    display: flex;
    gap: 30px;
}

.clip-controls {
    flex: 0 0 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 10px;
}

.play-button {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background-color: var(--deep-wine);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
    border: none;
    box-shadow: 0 4px 10px rgba(109, 37, 50, 0.3);
}

.play-button:hover {
    transform: scale(1.1);
    background-color: #8a2f40;
}

.play-button svg {
    width: 24px;
    height: 24px;
    margin-left: 4px; /* Optical adjustment for play icon */
    fill: currentColor;
}

.play-button.playing {
    background-color: var(--muted-rose);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(158, 94, 101, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(158, 94, 101, 0); }
    100% { box-shadow: 0 0 0 0 rgba(158, 94, 101, 0); }
}

.clip-content {
    flex: 1;
}

.clip-description-box {
    background-color: transparent;
    border-left: none;
    padding: 0;
    margin: 0;
    color: #555;
    font-size: 1rem;
    line-height: 1.7;
}

.clip-meta-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(0,0,0,0.05);
    font-size: 0.85rem;
    color: #999;
}

.transcript-toggle {
    background: none;
    border: none;
    color: var(--muted-rose);
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

.transcript-toggle:hover { text-decoration: underline; }

.transcript-box {
    background-color: #fdfdfd;
    border: 1px solid #eee;
    padding: 20px;
    border-radius: 8px;
    max-height: 300px;
    overflow-y: auto;
    font-size: 0.95rem;
    color: #444;
    margin-top: 15px;
    display: none; /* Hidden by default */
    line-height: 1.8;
}

.transcript-box.visible { display: block; }

/* Sticky Player */
#audio-player-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--deep-wine);
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 15px 0;
    z-index: 100;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.2);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#audio-player-bar.visible {
    transform: translateY(0);
}

#audio-player-bar.minimized {
    transform: translateY(calc(100% - 50px));
}

#audio-player-bar.minimized .player-content {
    display: none;
}

.player-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    gap: 20px;
}

.player-info {
    flex: 1;
    min-width: 0; /* For ellipsis */
}

.player-title {
    font-weight: 700;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 1rem;
}

.player-subtitle {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.player-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: white;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-btn:hover { opacity: 0.8; }
.player-btn svg { width: 20px; height: 20px; fill: currentColor; }
.player-btn.main-play svg { width: 32px; height: 32px; }

.player-progress {
    flex: 2;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.9);
    font-variant-numeric: tabular-nums;
}

.progress-bar-container {
    flex: 1;
    height: 6px;
    background-color: rgba(255,255,255,0.3);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    overflow: hidden; /* For simple fill */
}

.progress-fill {
    height: 100%;
    background-color: white;
    width: 0%;
    border-radius: 3px;
    transition: width 0.1s linear;
}

/* Minimize/Maximize Handle */
.player-minimize-btn {
    position: absolute;
    top: 8px;
    right: 20px;
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 101;
}

.player-minimize-btn:hover {
    background: rgba(255,255,255,0.3);
}

.player-minimize-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

#audio-player-bar.minimized .player-minimize-btn {
    display: none;
}

#audio-player-bar.minimized .player-minimize-handle {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    height: 50px;
    padding: 0 20px;
    cursor: pointer;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

.player-minimize-handle-text {
    color: white;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    margin-right: 10px;
}

.player-minimize-handle:hover {
    background-color: rgba(255,255,255,0.05);
}

#audio-player-bar.minimized #player-maximize-btn {
    position: static !important;
    background: rgba(255,255,255,0.2) !important;
    display: flex !important;
}

/* Toggle Switch for View Mode */
.view-toggle-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.view-toggle-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #777;
    cursor: pointer;
    padding: 0 10px;
    transition: color 0.2s;
}

.view-toggle-label.active {
    color: var(--deep-wine);
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    -webkit-transition: .4s;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    -webkit-transition: .4s;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--deep-wine);
}

input:focus + .slider {
    box-shadow: 0 0 1px var(--deep-wine);
}

input:checked + .slider:before {
    -webkit-transform: translateX(24px);
    -ms-transform: translateX(24px);
    transform: translateX(24px);
}

/* View Mode Styles */
.topic-first-view .card-title {
    font-size: 1.2rem; /* Original size for topic title */
    color: var(--deep-wine);
    margin-bottom: 10px;
}

.topic-first-view .meta-badge {
    display: inline-block; /* Ensure badges are visible */
}

/* .question-first-view .meta-badge uses default styling */

.topic-first-view .hybrid-elements {
    display: none;
}

.question-first-view .original-elements {
    display: none;
}

/* Media Queries */
@media (max-width: 768px) {
    /* Mobile Navigation */
    .mobile-menu-toggle {
        display: flex;
    }

    .nav-links {
        display: none;
    }

    .nav-content {
        justify-content: flex-end;
    }

    .stats-bar { flex-direction: column; gap: 20px; }
    .page-title { font-size: 1.8rem; }
    .grid { grid-template-columns: 1fr; }
    
    .clip-body { flex-direction: column; padding: 20px; }
    .clip-controls { flex-direction: row; justify-content: space-between; flex: auto; margin-bottom: 15px; width: 100%; }
    .play-button { width: 48px; height: 48px; }
    .player-content { flex-direction: column; padding-bottom: 15px; }
    .player-progress { width: 100%; }
    body { padding-bottom: 180px; }
}

/* Utilities */
.text-center { text-align: center; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }

/* Summary Box */
.summary-box {
    background-color: var(--white);
    border: 1px solid var(--border-grey);
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 30px;
}

.summary-section h3 {
    color: var(--deep-wine);
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.summary-section { margin-bottom: 20px; }

/* SVG Icon Utility Class */
.icon {
    display: inline-block;
    width: 1em;
    height: 1em;
    stroke-width: 0;
    stroke: currentColor;
    fill: currentColor;
}

/* Play All Clips Button */
.play-all-button:hover {
    background: #8a2f3f !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15) !important;
}

.play-all-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
}

/* Jump to Quiz Button */
#jump-to-quiz-btn:hover {
    background: #388e3c !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15) !important;
}

#jump-to-quiz-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
}

#banner-quiz-btn:hover {
    background: #f5f5f5 !important;
    transform: scale(1.05);
}

#banner-quiz-btn:active {
    transform: scale(0.98);
}

/* Real-time Word Display */
.word-display {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    max-height: 200px;
    overflow-y: auto;
    overflow-x: hidden;
    /* Smooth scrolling within container */
    scroll-behavior: smooth;
    /* Ensure container doesn't exceed parent width */
    width: 100%;
    box-sizing: border-box;
}

.word-display-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333;
    word-spacing: 0.2em;
    /* Make words wrap instead of going off to the right */
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    width: 100%;
    display: block;
    /* Ensure content respects container width */
    max-width: 100%;
    box-sizing: border-box;
}

.word-display-content .word {
    display: inline;
    margin-right: 0.3em;
    transition: all 0.2s ease;
    padding: 2px 4px;
    border-radius: 3px;
    /* Allow words to wrap naturally - remove nowrap */
    white-space: normal;
    /* Prevent individual words from being too long */
    max-width: 100%;
    word-break: break-word;
}

.word-display-content .word.active {
    background: var(--deep-wine);
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(138, 47, 63, 0.3);
}

.word-display-content .word.past {
    color: #999;
}

/* Quiz Styles */
.quiz-section {
    background-color: var(--white);
    border: 1px solid var(--border-grey);
    border-radius: 12px;
    padding: 30px;
    margin: 40px 0 80px 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.quiz-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-grey);
}

.quiz-header h2 {
    color: var(--deep-wine);
    font-size: 1.8rem;
    font-family: 'Georgia', serif;
    margin-bottom: 10px;
}

.quiz-header p {
    color: #666;
    font-size: 1rem;
}

.quiz-question {
    background-color: #fafafa;
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 25px;
    transition: all 0.3s ease;
}

.quiz-question:last-child {
    margin-bottom: 0;
}

.question-header {
    margin-bottom: 15px;
}

.question-number {
    background-color: var(--deep-wine);
    color: var(--white);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
    letter-spacing: 0.5px;
}

.question-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark-grey);
    margin-bottom: 20px;
    line-height: 1.6;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quiz-option {
    display: flex;
    align-items: flex-start;
    padding: 15px;
    background-color: var(--white);
    border: 2px solid var(--border-grey);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 12px;
}

.quiz-option:hover {
    border-color: var(--muted-rose);
    background-color: #fff5f5;
}

.quiz-option input[type="radio"] {
    margin: 0;
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 2px;
}

.quiz-option.correct {
    background-color: #e8f5e9;
    border-color: #4caf50;
    color: #2e7d32;
}

.quiz-option.incorrect {
    background-color: #ffebee;
    border-color: #f44336;
    color: #c62828;
}

.quiz-option.correct .option-label,
.quiz-option.incorrect .option-label {
    font-weight: 700;
}

.option-label {
    font-weight: 600;
    color: var(--deep-wine);
    flex-shrink: 0;
    min-width: 24px;
}

.quiz-option.correct .option-label {
    color: #2e7d32;
}

.quiz-option.incorrect .option-label {
    color: #c62828;
}

.option-text {
    flex: 1;
    line-height: 1.5;
}

.quiz-option input[type="radio"]:disabled {
    cursor: not-allowed;
}

.quiz-option:has(input[type="radio"]:disabled) {
    cursor: not-allowed;
}

.question-feedback {
    margin-top: 15px;
    padding: 15px;
    border-radius: 8px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes quizPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(46, 125, 50, 0.4);
    }
    50% {
        box-shadow: 0 0 0 15px rgba(46, 125, 50, 0);
    }
}

.question-feedback-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.feedback-correct {
    background-color: #e8f5e9;
    border: 1px solid #4caf50;
    color: #2e7d32;
}

.feedback-incorrect {
    background-color: #ffebee;
    border: 1px solid #f44336;
    color: #c62828;
}

.feedback-icon {
    font-size: 1.2rem;
    font-weight: 700;
    margin-right: 8px;
}

.feedback-message {
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
}

.feedback-explanation {
    margin-top: 8px;
    padding-top: 10px;
    border-top: 1px solid rgba(0,0,0,0.1);
    font-size: 0.95rem;
    line-height: 1.6;
    opacity: 0.9;
}

.feedback-correct .feedback-explanation {
    border-top-color: rgba(46, 125, 50, 0.2);
}

.feedback-incorrect .feedback-explanation {
    border-top-color: rgba(198, 40, 40, 0.2);
}

.quiz-actions {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-grey);
    text-align: center;
}

.quiz-reset-btn {
    padding: 12px 24px;
    background-color: var(--muted-rose);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.quiz-reset-btn:hover {
    background-color: var(--deep-wine);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.quiz-reset-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Topic Navigation Arrows */
.topic-nav-arrow {
    position: fixed;
    top: 50vh;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px;
    background-color: var(--deep-wine);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    z-index: 100;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(109, 37, 50, 0.3);
    white-space: nowrap;
}

.topic-nav-arrow:hover {
    background-color: #5a1f2a;
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 6px 16px rgba(109, 37, 50, 0.4);
    text-decoration: none;
    color: white;
}

.topic-nav-arrow:active {
    transform: translateY(-50%) scale(0.98);
}

.topic-nav-arrow-left {
    left: 20px;
}

.topic-nav-arrow-right {
    right: 20px;
    flex-direction: row-reverse;
}

.topic-nav-label {
    font-size: 0.95rem;
    letter-spacing: 0.5px;
}

.topic-nav-arrow svg {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .quiz-section {
        padding: 20px;
        margin: 30px 0 60px 0;
    }
    
    .quiz-header h2 {
        font-size: 1.5rem;
    }
    
    .question-text {
        font-size: 1rem;
    }
    
    .quiz-option {
        padding: 12px;
    }
    
    /* Adjust navigation arrows for mobile */
    .topic-nav-arrow {
        padding: 12px 14px;
        font-size: 0.9rem;
    }
    
    .topic-nav-arrow-left {
        left: 10px;
    }
    
    .topic-nav-arrow-right {
        right: 10px;
    }
    
    .topic-nav-label {
        display: none; /* Hide text label on mobile, show only arrow */
    }
    
    .topic-nav-arrow svg {
        width: 20px;
        height: 20px;
    }
    
    /* Scroll to Top Button - Mobile */
    .scroll-to-top-btn {
        width: 48px;
        height: 48px;
        padding: 12px;
        right: 20px;
        bottom: 30px; /* Lower position, will adjust for audio player */
    }
    
    .scroll-to-top-btn svg {
        width: 20px;
        height: 20px;
    }
}

/* Scroll to Top Button */
.scroll-to-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 56px;
    height: 56px;
    background-color: var(--deep-wine);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(109, 37, 50, 0.3);
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    padding: 0;
}

.scroll-to-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top-btn:hover {
    background-color: #5a1f2a;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(109, 37, 50, 0.4);
}

.scroll-to-top-btn:active {
    transform: translateY(0);
}

.scroll-to-top-btn svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}
