/**
 * Vault Viewer Styles
 * Professional presentation viewer styling
 */

/* Font Definitions */
@font-face {
    font-family: "Rockwell";
    src: url("/fonts/Rockwell.ttc") format("truetype");
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: "DINCondensedBold";
    src: url("/fonts/DINCondensedBold.ttf") format("truetype");
    font-weight: bold;
    font-style: normal;
}

:root {
    --primary-color: #C90C0F;
    --secondary-color: #FAB719;
    --text-color: #1D1D1B;
    --bg-color: #000000;
    --control-bg: rgba(0, 0, 0, 0.8);
    --control-hover: rgba(255, 255, 255, 0.1);
}

.vault-viewer-body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: var(--bg-color);
    font-family: "Rockwell", "Rockwell Nova", "Roboto Slab", serif;
    height: 100vh;
    width: 100vw;
}

.viewer-container {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Icons inline with slide titles */
.slide-title-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 90%;
    margin: 20px auto 0 auto;
    padding: 0;
    box-sizing: border-box;
    line-height: 1;
    height: auto;
    min-height: 0;
}

.slide-title {
    font-family: "DINCondensedBold", "Arial Black", "Arial", sans-serif;
    font-size: 3rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--primary-color);
    text-align: center;
    text-shadow: 
        -2px -2px 0 white,
        2px -2px 0 white,
        -2px 2px 0 white,
        2px 2px 0 white,
        -2px 0 0 white,
        2px 0 0 white,
        0 -2px 0 white,
        0 2px 0 white,
        -3px -3px 0 white,
        3px -3px 0 white,
        -3px 3px 0 white,
        3px 3px 0 white;
    margin: 0;
    padding: 0;
    flex: 1;
    line-height: 1;
    height: auto;
    display: inline-block;
}

.slide-subtitle {
    font-family: "Rockwell", "Rockwell Nova", "Roboto Slab", serif;
    font-size: 1.5rem;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
    text-shadow: 
        -1px -1px 0 black,
        1px -1px 0 black,
        -1px 1px 0 black,
        1px 1px 0 black,
        -1px 0 0 black,
        1px 0 0 black,
        0 -1px 0 black,
        0 1px 0 black,
        2px 2px 4px rgba(0, 0, 0, 0.7);
    margin: 10px 0 0 0;
    padding: 0;
    line-height: 1.2;
}

.slide-title-icon {
    width: auto;
    height: 60px;
    object-fit: contain;
    flex-shrink: 0;
}

.slide-title-icon-left {
    position: fixed;
    left: calc(200px + 2%); /* Position after vocab box (200px) + small margin */
    top: 20px;
    margin: 0;
    z-index: 101; /* Higher than vocab box (z-index: 100) */
}

.slide-title-icon-right {
    position: fixed;
    right: 1cm; /* 1cm from right edge of screen */
    top: 0.6cm; /* 0.6cm from top of screen */
    margin: 0;
    z-index: 100;
}

/* Slide Display */
.slide-display {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-color); /* Base black/white background - layer 1 (back) */
    overflow-y: auto; /* Allow scrolling if content is taller */
    overflow-x: hidden;
    position: relative;
}

/* Override slide-display centering for I/We/You, Prior Learning, etc. - align to top */
.slide-display:has(.i-do-slide),
.slide-display:has(.we-do-slide),
.slide-display:has(.you-do-slide),
.slide-display:has(.formulae-slide),
.slide-display:has(.prior-learning-slide),
.slide-display:has(.independent-task-slide) {
    align-items: flex-start !important; /* Top align */
    justify-content: flex-start !important; /* Left align */
    padding-top: 0 !important;
}

/* App slide: top-left like other teaching slides, but stretch vertically for full-height iframe */
.slide-display:has(.app-slide) {
    align-items: stretch !important;
    justify-content: flex-start !important;
    padding-top: 0 !important;
}

/* Fallback for browsers that don't support :has() - use class on parent */
.slide-display.top-aligned {
    align-items: flex-start !important;
    justify-content: flex-start !important;
    padding-top: 0 !important;
}

/* Bokeh bubbles - individual circular elements that move independently */
.bokeh-bubble {
    position: fixed; /* Fixed positioning relative to viewport */
    border-radius: 50%;
    pointer-events: none;
    z-index: 2; /* Directly above gradient overlay (z-index: 1), below logo and content */
    filter: blur(60px);
    opacity: 1;
}

/* Bubble 1 - Primary color, top left */
.bokeh-1 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, var(--bokeh-primary-20) 0%, var(--bokeh-primary-10) 40%, transparent 70%);
    top: 10%;
    left: 15%;
    animation: bokehMove1 25s ease-in-out infinite;
}

/* Bubble 2 - Secondary color, bottom right */
.bokeh-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--bokeh-secondary-20) 0%, var(--bokeh-secondary-10) 40%, transparent 70%);
    bottom: 15%;
    right: 20%;
    animation: bokehMove2 30s ease-in-out infinite;
}

/* Bubble 3 - Primary color, center */
.bokeh-3 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, var(--bokeh-primary-18) 0%, var(--bokeh-primary-09) 40%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: bokehMove3 35s ease-in-out infinite;
}

/* Bubble 4 - Secondary color, bottom left */
.bokeh-4 {
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, var(--bokeh-secondary-19) 0%, var(--bokeh-secondary-095) 40%, transparent 70%);
    bottom: 20%;
    left: 10%;
    animation: bokehMove4 28s ease-in-out infinite;
}

/* Bubble 5 - Primary color, top right */
.bokeh-5 {
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, var(--bokeh-primary-19) 0%, var(--bokeh-primary-095) 40%, transparent 70%);
    top: 15%;
    right: 15%;
    animation: bokehMove5 32s ease-in-out infinite;
}

/* Dark mode - slightly brighter bubbles */
.dark-mode .bokeh-1 {
    background: radial-gradient(circle, var(--bokeh-primary-25) 0%, var(--bokeh-primary-12) 40%, transparent 70%);
}

.dark-mode .bokeh-2 {
    background: radial-gradient(circle, var(--bokeh-secondary-25) 0%, var(--bokeh-secondary-12) 40%, transparent 70%);
}

.dark-mode .bokeh-3 {
    background: radial-gradient(circle, var(--bokeh-primary-22) 0%, var(--bokeh-primary-11) 40%, transparent 70%);
}

.dark-mode .bokeh-4 {
    background: radial-gradient(circle, var(--bokeh-secondary-24) 0%, var(--bokeh-secondary-12) 40%, transparent 70%);
}

.dark-mode .bokeh-5 {
    background: radial-gradient(circle, var(--bokeh-primary-24) 0%, var(--bokeh-primary-12) 40%, transparent 70%);
}

/* Light mode - lighter bubbles */
.light-mode .bokeh-1 {
    background: radial-gradient(circle, var(--bokeh-primary-12) 0%, var(--bokeh-primary-06) 40%, transparent 70%);
}

.light-mode .bokeh-2 {
    background: radial-gradient(circle, var(--bokeh-secondary-12) 0%, var(--bokeh-secondary-06) 40%, transparent 70%);
}

.light-mode .bokeh-3 {
    background: radial-gradient(circle, var(--bokeh-primary-11) 0%, var(--bokeh-primary-055) 40%, transparent 70%);
}

.light-mode .bokeh-4 {
    background: radial-gradient(circle, var(--bokeh-secondary-115) 0%, var(--bokeh-secondary-057) 40%, transparent 70%);
}

.light-mode .bokeh-5 {
    background: radial-gradient(circle, var(--bokeh-primary-115) 0%, var(--bokeh-primary-057) 40%, transparent 70%);
}

/* Individual bubble animations - each moves independently in random patterns */
@keyframes bokehMove1 {
    0% {
        transform: translate(0, 0) scale(1);
    }
    20% {
        transform: translate(120px, -90px) scale(1.15);
    }
    40% {
        transform: translate(-80px, 150px) scale(0.85);
    }
    60% {
        transform: translate(200px, 60px) scale(1.1);
    }
    80% {
        transform: translate(-60px, -120px) scale(0.95);
    }
    100% {
        transform: translate(0, 0) scale(1);
    }
}

@keyframes bokehMove2 {
    0% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(-150px, 80px) scale(0.9);
    }
    50% {
        transform: translate(100px, -200px) scale(1.2);
    }
    75% {
        transform: translate(-80px, -50px) scale(1.05);
    }
    100% {
        transform: translate(0, 0) scale(1);
    }
}

@keyframes bokehMove3 {
    0% {
        transform: translate(-50%, -50%) scale(1);
    }
    15% {
        transform: translate(calc(-50% + 180px), calc(-50% - 100px)) scale(1.25);
    }
    30% {
        transform: translate(calc(-50% - 120px), calc(-50% + 180px)) scale(0.8);
    }
    50% {
        transform: translate(calc(-50% + 90px), calc(-50% + 70px)) scale(1.15);
    }
    70% {
        transform: translate(calc(-50% - 200px), calc(-50% - 80px)) scale(0.9);
    }
    85% {
        transform: translate(calc(-50% + 60px), calc(-50% - 150px)) scale(1.1);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes bokehMove4 {
    0% {
        transform: translate(0, 0) scale(1);
    }
    22% {
        transform: translate(140px, 100px) scale(1.18);
    }
    44% {
        transform: translate(-110px, -80px) scale(0.88);
    }
    66% {
        transform: translate(70px, -160px) scale(1.12);
    }
    88% {
        transform: translate(-90px, 120px) scale(0.92);
    }
    100% {
        transform: translate(0, 0) scale(1);
    }
}

@keyframes bokehMove5 {
    0% {
        transform: translate(0, 0) scale(1);
    }
    18% {
        transform: translate(-130px, -70px) scale(1.22);
    }
    36% {
        transform: translate(160px, 140px) scale(0.87);
    }
    54% {
        transform: translate(-90px, -180px) scale(1.08);
    }
    72% {
        transform: translate(110px, 50px) scale(0.95);
    }
    90% {
        transform: translate(-70px, 90px) scale(1.15);
    }
    100% {
        transform: translate(0, 0) scale(1);
    }
}

.slide-content {
    width: 90%;
    max-width: 90%;
    min-height: 100%; /* Allow content to grow */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    box-sizing: border-box;
    animation: slideIn 0.3s ease-out;
    text-align: center;
    margin: 0 auto;
    margin-left: calc(200px + 5%); /* Space for vocab box + center 90% width */
    background: transparent; /* Default transparent - allows bubbles to show through */
    position: relative;
    z-index: 10; /* Above logo (z-index: 2) and bubbles (z-index: 3) - layer 4 (front) */
    overflow-y: visible !important; /* Allow content to extend beyond viewport */
    overflow-x: visible !important;
}

/* I/We/You, Prior Learning, Formulae: align content to top - NO vertical centering */
.slide-content.i-do-slide,
.slide-content.we-do-slide,
.slide-content.you-do-slide,
.slide-content.formulae-slide,
.slide-content.prior-learning-slide {
    min-height: auto !important; /* Don't force full height */
    height: auto !important; /* Don't force full height */
    max-height: none !important; /* No max height restriction */
    justify-content: flex-start !important; /* Top align - no centering */
    align-items: flex-start !important; /* Left align */
    padding-top: 30px !important; /* Match lesson-plan.css */
    padding-bottom: 40px !important;
    padding-left: 40px !important;
    padding-right: 40px !important;
    text-align: left !important; /* Left align text */
    margin-top: 0 !important; /* No top margin */
    margin-bottom: 0 !important; /* No bottom margin */
    margin-left: calc(200px + 5%) !important; /* Account for vocab box */
    width: calc(100% - 200px - 10%) !important; /* Full width minus vocab box and margins */
    max-width: calc(100% - 200px - 10%) !important;
}

/* Starter slide - ensure transparent background */
.slide-content.starter-slide {
    background: transparent !important;
}

/* Homework answers: top align so Spiral/Main always start at top */
.slide-content.homework-answers-slide {
    justify-content: flex-start !important;
    align-items: stretch !important;
    text-align: left !important;
    padding-top: 20px !important;
}

.slide-content.homework-answers-slide .resource-embed-container {
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
}

/* App slide (e.g. Assessment Timer): fill main window beside vocab column */
.slide-content.app-slide {
    width: calc(100vw - 200px) !important;
    max-width: calc(100vw - 200px) !important;
    margin-left: 200px !important;
    margin-right: 0 !important;
    padding: 12px 20px 20px !important;
    box-sizing: border-box;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    align-self: stretch !important;
    min-height: calc(100dvh - 96px);
    min-height: calc(100vh - 96px);
    flex: 1 1 auto;
}

.app-slide .slide-title-container {
    flex-shrink: 0;
    width: 100%;
    margin-bottom: 8px;
}

.app-slide .app-embed-container {
    flex: 1 1 auto;
    width: 100% !important;
    min-height: 0;
    min-height: calc(100dvh - 200px);
    min-height: calc(100vh - 200px);
    height: calc(100dvh - 200px);
    height: calc(100vh - 200px);
    max-height: calc(100dvh - 200px);
    max-height: calc(100vh - 200px);
    position: relative;
    overflow: hidden;
}

.app-slide .app-iframe,
.app-slide .resource-iframe.app-iframe {
    display: block;
    width: 100% !important;
    height: 100% !important;
    min-height: 100%;
    border: none;
    background: transparent !important;
}

/* All slides account for vocab box and center content */
.slide-content {
    margin-left: calc(200px + 5%) !important;
    width: 90% !important;
    max-width: 90% !important;
    position: relative;
    z-index: 10; /* Above bubbles (z-index: 5) and logo (z-index: 2) */
    overflow-y: visible !important; /* Allow content to extend beyond viewport */
    overflow-x: visible !important;
}

/* Ensure projector slides use full width, but independent task needs special handling */
.slide-content.projector-slide:not(.independent-task-slide) {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    padding: 20px !important;
    box-sizing: border-box;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Title Slide */
.title-slide {
    text-align: center;
    color: white;
    position: relative;
}

.title-main {
    font-family: "DINCondensedBold", "Arial Black", "Arial", sans-serif;
    font-size: 4rem;
    font-weight: bold;
    margin-bottom: 30px;
    color: var(--primary-color);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    position: relative;
    z-index: 2;
    text-shadow: 
        -2px -2px 0 white,
        2px -2px 0 white,
        -2px 2px 0 white,
        2px 2px 0 white,
        -2px 0 0 white,
        2px 0 0 white,
        0 -2px 0 white,
        0 2px 0 white,
        -3px -3px 0 white,
        3px -3px 0 white,
        -3px 3px 0 white,
        3px 3px 0 white,
        -3px 0 0 white,
        3px 0 0 white,
        0 -3px 0 white,
        0 3px 0 white,
        4px 4px 8px rgba(0, 0, 0, 0.7);
}

.title-subtitle {
    font-size: 2rem;
    margin-bottom: 20px;
    color: rgba(255, 255, 255, 0.9);
    position: relative;
    z-index: 2;
    text-shadow: 
        -2px -2px 0 black,
        2px -2px 0 black,
        -2px 2px 0 black,
        2px 2px 0 black,
        -2px 0 0 black,
        2px 0 0 black,
        0 -2px 0 black,
        0 2px 0 black,
        -3px -3px 0 black,
        3px -3px 0 black,
        -3px 3px 0 black,
        3px 3px 0 black,
        -3px 0 0 black,
        3px 0 0 black,
        0 -3px 0 black,
        0 3px 0 black,
        3px 3px 6px rgba(0, 0, 0, 0.7);
}

.title-date {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
    position: relative;
    z-index: 2;
    text-shadow: 
        -2px -2px 0 black,
        2px -2px 0 black,
        -2px 2px 0 black,
        2px 2px 0 black,
        -2px 0 0 black,
        2px 0 0 black,
        0 -2px 0 black,
        0 2px 0 black,
        -3px -3px 0 black,
        3px -3px 0 black,
        -3px 3px 0 black,
        3px 3px 0 black,
        -3px 0 0 black,
        3px 0 0 black,
        0 -3px 0 black,
        0 3px 0 black,
        3px 3px 6px rgba(0, 0, 0, 0.7);
}

.title-school-logo {
    position: absolute;
    top: 0;
    right: 0;
    width: auto;
    height: 90vh;
    z-index: 2; /* Above gradient overlay (z-index: 1), below content */
    opacity: 0.5;
    transform: rotate(-10deg) translateX(30%);
    transform-origin: top right;
    pointer-events: none;
}

.title-school-logo img {
    width: auto;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* School logo on all slides (non-title) - layer 2 (above gradient, below content) */
.school-logo {
    position: absolute;
    top: 0;
    right: 0;
    width: auto;
    height: 90vh;
    z-index: 2; /* Above gradient overlay (z-index: 1), below content */
    opacity: 0.5;
    transform: rotate(-10deg) translateX(30%);
    transform-origin: top right;
    pointer-events: none;
}

.school-logo img {
    width: auto;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Reduced opacity for non-title slides */
.school-logo-reduced-opacity {
    opacity: 0.3;
}

/* Independent task slide - logo behind questions with reduced opacity */
.independent-task-slide .school-logo,
.slide-content.independent-task-slide .school-logo,
.independent-task-slide .school-logo-reduced-opacity {
    opacity: 0.15 !important; /* Much more reduced opacity */
    z-index: 1 !important; /* Behind questions (which have z-index: 20) */
}

.title-white-rose-logo {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 30px;
    z-index: 2;
}

.title-white-rose-logo img {
    width: auto;
    height: 80px;
    object-fit: contain;
    display: block;
}

/* Learning Objectives Slide */
.objectives-slide {
    max-width: 1200px;
    color: white;
}

.slide-title {
    font-family: "DINCondensedBold", "Arial Black", "Arial", sans-serif;
    font-size: 3rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--primary-color);
    margin-bottom: 40px;
    text-align: center;
    text-shadow: 
        -2px -2px 0 white,
        2px -2px 0 white,
        -2px 2px 0 white,
        2px 2px 0 white,
        -2px 0 0 white,
        2px 0 0 white,
        0 -2px 0 white,
        0 2px 0 white,
        -3px -3px 0 white,
        3px -3px 0 white,
        -3px 3px 0 white,
        3px 3px 0 white,
        -3px 0 0 white,
        3px 0 0 white,
        0 -3px 0 white,
        0 3px 0 white,
        4px 4px 8px rgba(0, 0, 0, 0.7);
}

.objectives-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.objective-card {
    background: rgba(255, 255, 255, 1);
    border-left: 5px solid var(--primary-color);
    padding: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    opacity: 1;
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.objective-label {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.objective-text {
    font-size: 1.5rem;
    color: white;
    line-height: 1.6;
}

/* Resource Slide */
.resource-slide {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.resource-header {
    padding: 20px 40px;
    background: rgba(0, 0, 0, 0.7);
    border-bottom: 3px solid var(--primary-color);
}

.resource-title {
    font-size: 2rem;
    color: var(--primary-color);
    margin: 0;
    font-weight: bold;
}

.resource-embed-container {
    flex: 1;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.resource-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: white;
}

/* Starter slide iframe - transparent background (must override general rule) */
.starter-slide .resource-iframe {
    background: transparent !important;
}

/* Summary Slide */
.summary-slide {
    max-width: 1200px;
    color: white;
}

.summary-content {
    background: rgba(255, 255, 255, 1);
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    opacity: 1;
    backdrop-filter: blur(10px);
}

.summary-topic {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 30px;
    text-align: center;
}

.summary-resources {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.summary-item {
    font-size: 1.3rem;
    color: white;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
    border-left: 4px solid var(--secondary-color);
}

/* Control Bar */
.control-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--control-bg);
    backdrop-filter: blur(10px);
    padding: 15px 0;
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 1000;
    border-top: 2px solid var(--primary-color);
}

/* Nav Buttons Group - always at edge */
.nav-buttons-group {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
    padding-left: 30px;
    padding-right: 15px;
    position: relative;
    z-index: 1001;
}

/* Clock in nav menu */
.nav-clock {
    font-family: "DINCondensedBold", "Arial Black", "Arial", sans-serif;
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--secondary-color);
    text-shadow: 
        -1px -1px 0 black,
        1px -1px 0 black,
        -1px 1px 0 black,
        1px 1px 0 black,
        1px 1px 2px rgba(0, 0, 0, 0.8);
    letter-spacing: 1px;
    padding: 0 10px;
    white-space: nowrap;
}

/* Controls Group - contains all other control buttons */
.controls-group {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
    flex-grow: 0;
    padding-left: 15px;
    padding-right: 15px;
}

/* Independent Task Timer in Nav Bar */
.independent-task-timer-nav {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 0 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.timer-nav-display {
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    font-weight: bold;
    color: white;
    min-width: 60px;
    text-align: center;
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    transition: color 0.3s ease;
}

.timer-nav-display.timer-warning {
    color: #ff9800;
}

.timer-nav-display.timer-danger {
    color: #f44336;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.timer-nav-btn {
    padding: 6px 10px !important;
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.timer-nav-input {
    width: 50px;
    padding: 6px 8px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 0.9rem;
    text-align: center;
    font-weight: bold;
}

.timer-nav-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.timer-nav-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.15);
}

.timer-nav-audio-label {
    display: flex;
    align-items: center;
    gap: 4px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.85rem;
    cursor: pointer;
    white-space: nowrap;
}

.timer-nav-audio-label input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

/* Progress Group - contains progress bar and page indicator */
.progress-group {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
    padding-left: 15px;
    padding-right: 30px;
    position: relative;
    z-index: 1001;
}

/* Right-handed (default): nav buttons at left edge, then controls, then progress on right */
.control-bar:not(.left-handed) {
    justify-content: flex-start;
}

.control-bar:not(.left-handed) .nav-buttons-group {
    order: 1;
    padding-left: 30px;
    padding-right: 15px;
}

.control-bar:not(.left-handed) .controls-group {
    order: 2;
}

.control-bar:not(.left-handed) .progress-group {
    order: 3;
    margin-left: auto;
    padding-left: 15px;
    padding-right: 30px;
}

/* Left-handed: progress on left, then controls, then nav buttons at right edge */
.control-bar.left-handed {
    justify-content: space-between;
}

.control-bar.left-handed .progress-group {
    order: 1;
    padding-left: 30px;
    padding-right: 15px;
    flex-shrink: 0;
}

.control-bar.left-handed .controls-group {
    order: 2;
    flex-shrink: 0;
}

.control-bar.left-handed .nav-buttons-group {
    order: 3;
    padding-left: 15px;
    padding-right: 30px;
    flex-shrink: 0;
}

.control-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.control-btn:hover {
    background: var(--control-hover);
    border-color: var(--primary-color);
    transform: scale(1.1);
}

.control-btn:active {
    transform: scale(0.95);
}

.control-btn.active {
    background: var(--secondary-color);
    color: var(--text-color);
    border-color: var(--secondary-color);
}

.control-btn.active:hover {
    background: #e0a516;
    border-color: #e0a516;
}

.exit-btn {
    background: rgba(201, 12, 15, 0.3);
    border-color: var(--primary-color);
}

.exit-btn:hover {
    background: rgba(201, 12, 15, 0.5);
}

.slide-info {
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    min-width: 80px;
    text-align: center;
}

.progress-bar {
    flex: 0 0 auto;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    overflow: hidden;
    max-width: 300px;
    margin: 0 auto;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: width 0.3s ease;
    width: 0%;
}

/* Overview Modal */
.overview-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.overview-content {
    max-width: 1400px;
    width: 100%;
    max-height: 90vh;
    background: rgba(20, 20, 20, 0.95);
    border-radius: 10px;
    padding: 30px;
    border: 2px solid var(--primary-color);
}

.overview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--primary-color);
}

.overview-header h2 {
    color: var(--primary-color);
    font-size: 2rem;
    margin: 0;
}

.close-btn {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

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

.overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    max-height: 70vh;
    overflow-y: auto;
    padding: 10px;
}

.overview-thumbnail {
    aspect-ratio: 16/9;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.overview-thumbnail:hover {
    border-color: var(--primary-color);
    transform: scale(1.05);
    background: rgba(255, 255, 255, 0.15);
}

.overview-thumbnail.active {
    border-color: var(--primary-color);
    border-width: 3px;
    background: rgba(201, 12, 15, 0.2);
}

.thumbnail-number {
    position: absolute;
    top: 5px;
    right: 5px;
    background: var(--primary-color);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
}

.thumbnail-content {
    color: white;
    font-size: 0.9rem;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.preview-title {
    font-weight: bold;
    color: var(--primary-color);
}

.preview-objectives,
.preview-resource,
.preview-summary {
    color: rgba(255, 255, 255, 0.8);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 3000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
}

.spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Fullscreen Styles */
body.fullscreen-active .control-bar {
    opacity: 0;
    transition: opacity 0.3s ease;
    transform: translateY(100%);
}

body.fullscreen-active .control-bar:hover {
    opacity: 1;
    transform: translateY(0);
}

/* Pinned nav bar - always visible in fullscreen */
body.fullscreen-active.nav-bar-pinned .control-bar {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

body.fullscreen-active.nav-bar-pinned .control-bar-toggle {
    display: none !important;
}

/* Up arrow button to show nav bar when hidden */
.control-bar-toggle {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--control-bg);
    backdrop-filter: blur(10px);
    border: 2px solid var(--primary-color);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    z-index: 1001;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.control-bar-toggle:hover {
    background: var(--primary-color);
    transform: translateX(-50%) scale(1.1);
}

body.fullscreen-active .control-bar-toggle {
    display: flex;
}

body.fullscreen-active .control-bar.show-nav {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
    .slide-title-icon {
        height: 40px;
    }
    
    .title-main {
        font-size: 2.5rem;
    }
    
    .title-subtitle {
        font-size: 1.5rem;
    }
    
    .slide-title {
        font-size: 2rem;
    }
    
    .objective-label {
        font-size: 1.4rem;
    }
    
    .objective-text {
        font-size: 1.2rem;
    }
    
    .control-bar {
        padding: 10px 15px;
        gap: 10px;
    }
    
    .control-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    /* Ensure handedness layout works on mobile */
    .control-bar.left-handed .progress-group {
        order: 1;
    }
    
    .control-bar.left-handed .controls-group {
        order: 2;
    }
    
    .control-bar.left-handed .nav-buttons-group {
        order: 3;
        margin-left: auto;
    }
    
    /* Pinned nav bar on mobile */
    body.fullscreen-active.nav-bar-pinned .control-bar {
        opacity: 1 !important;
        transform: translateY(0) !important;
    }
    
    body.fullscreen-active.nav-bar-pinned .control-bar-toggle {
        display: none !important;
    }
    
    .overview-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

/* Tablet view (769px–1024px): ensure control bar wraps, narrower sidebar, overview usable */
@media (min-width: 769px) and (max-width: 1024px) {
    .control-bar {
        flex-wrap: wrap;
        padding: 12px 10px;
        gap: 10px;
        justify-content: flex-start;
    }
    
    .control-bar:not(.left-handed) .controls-group {
        flex-wrap: wrap;
    }
    
    .control-bar.left-handed .controls-group {
        flex-wrap: wrap;
    }
    
    .controls-group {
        gap: 10px;
        flex-wrap: wrap;
    }
    
    .control-btn {
        width: 44px;
        height: 44px;
        font-size: 1rem;
        flex-shrink: 0;
    }
    
    .progress-group {
        min-width: 90px;
        flex-shrink: 0;
    }
    
    .progress-bar {
        max-width: 180px;
    }
    
    .slide-info {
        font-size: 1.1rem;
    }
    
    /* Narrower sidebar on tablet for more content space */
    .slide-content {
        margin-left: calc(160px + 5%) !important;
        width: calc(100% - 160px - 10%) !important;
        max-width: calc(100% - 160px - 10%) !important;
    }
    
    .slide-content.i-do-slide,
    .slide-content.we-do-slide,
    .slide-content.you-do-slide,
    .slide-content.formulae-slide,
    .slide-content.prior-learning-slide {
        margin-left: calc(160px + 5%) !important;
        width: calc(100% - 160px - 10%) !important;
        max-width: calc(100% - 160px - 10%) !important;
    }
    
    .slide-content.app-slide {
        width: calc(100vw - 160px) !important;
        max-width: calc(100vw - 160px) !important;
        margin-left: 160px !important;
    }
    
    .slide-title-icon-left {
        left: calc(160px + 2%);
    }
    
    /* Gradient overlays match sidebar width */
    .dark-mode .slide-content::before {
        left: 160px;
        width: calc(100vw - 160px);
    }
    
    .light-mode .slide-content:not(.plenary-slide):not(.exit-ticket-slide)::before {
        left: 160px;
        width: calc(100vw - 160px);
    }
    
    .slide-content.plenary-slide::before,
    .slide-content.exit-ticket-slide::before {
        left: 160px;
        width: calc(100vw - 160px);
    }
    
    .overview-modal {
        padding: 16px;
    }
    
    .overview-content {
        padding: 20px;
        max-height: 85vh;
    }
    
    .overview-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 16px;
        max-height: 65vh;
    }
}

/* Scrollbar Styling */
.overview-grid::-webkit-scrollbar {
    width: 10px;
}

.overview-grid::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
}

.overview-grid::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
}

.overview-grid::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* Light Mode Styles */
.light-mode {
    --bg-color: #FFFFFF;
    --text-color: #1D1D1B;
    --control-bg: rgba(255, 255, 255, 0.95);
    --control-hover: rgba(0, 0, 0, 0.1);
}

.light-mode .vault-viewer-body {
    background: var(--bg-color);
    color: var(--text-color);
}

.light-mode .slide-display {
    background: var(--bg-color);
    position: relative;
}

/* Dark mode: ensure all slides have gradient background */
.dark-mode .slide-content {
    position: relative;
}

/* Dark mode gradient overlay for all slides */
.dark-mode .slide-content::before {
    content: '';
    position: fixed; /* Fixed to viewport for full-width coverage */
    top: 0;
    left: 200px; /* Start after vocab box */
    right: 0; /* Extend to right edge of viewport */
    bottom: 0;
    width: calc(100vw - 200px); /* Full width minus vocab box */
    background: linear-gradient(60deg, var(--gradient-secondary-15), var(--gradient-primary-12));
    z-index: -1; /* Behind content, but this is redundant since slide-display already has gradient */
    pointer-events: none;
}

/* Light mode background with gradient: secondary color (25% opacity) to primary color (20% opacity) at 60° angle, behind logo */
.light-mode .slide-content {
    position: relative;
}

/* Apply gradient to all slides EXCEPT plenary and exit ticket (they have their own rule below) */
.light-mode .slide-content:not(.plenary-slide):not(.exit-ticket-slide)::before {
    content: '';
    position: fixed; /* Fixed to viewport for full-width coverage */
    top: 0;
    left: 200px; /* Start after vocab box */
    right: 0; /* Extend to right edge of viewport */
    bottom: 0;
    width: calc(100vw - 200px); /* Full width minus vocab box */
    background: linear-gradient(60deg, var(--gradient-secondary-25), var(--gradient-primary-20));
    z-index: -1;
    pointer-events: none;
}

.light-mode .slide-content {
    background: transparent;
}

/* Plenary and Exit Ticket slides - always use gradient background (standard background) */
/* More specific selector to override general light-mode rule */
.slide-content.plenary-slide,
.slide-content.exit-ticket-slide {
    position: relative;
    background: transparent !important;
}

.slide-content.plenary-slide::before,
.slide-content.exit-ticket-slide::before {
    content: '';
    position: fixed; /* Fixed to viewport for full-width coverage */
    top: 0;
    left: 200px; /* Start after vocab box */
    right: 0; /* Extend to right edge of viewport */
    bottom: 0;
    width: calc(100vw - 200px); /* Full width minus vocab box */
    background: linear-gradient(60deg, var(--gradient-secondary-25), var(--gradient-primary-20));
    z-index: 0;
    pointer-events: none;
}

/* Ensure gradient background works in both light and dark mode */
.light-mode .slide-content.plenary-slide::before,
.light-mode .slide-content.exit-ticket-slide::before {
    z-index: 0;
}

.dark-mode .slide-content.plenary-slide::before,
.dark-mode .slide-content.exit-ticket-slide::before {
    z-index: 0;
}

.light-mode .title-slide {
    color: var(--text-color);
}

.light-mode .title-main {
    color: var(--primary-color);
    text-shadow: 
        -2px -2px 0 black,
        2px -2px 0 black,
        -2px 2px 0 black,
        2px 2px 0 black,
        -2px 0 0 black,
        2px 0 0 black,
        0 -2px 0 black,
        0 2px 0 black,
        -3px -3px 0 black,
        3px -3px 0 black,
        3px 3px 0 black,
        -3px 3px 0 black,
        4px 4px 8px rgba(255, 255, 255, 0.8);
}

.light-mode .title-subtitle {
    color: var(--text-color);
    text-shadow: 
        -1px -1px 0 white,
        1px -1px 0 white,
        -1px 1px 0 white,
        1px 1px 0 white,
        2px 2px 4px rgba(0, 0, 0, 0.3);
}

.light-mode .title-date {
    color: rgba(29, 29, 27, 0.7);
    text-shadow: 
        -1px -1px 0 white,
        1px -1px 0 white,
        -1px 1px 0 white,
        1px 1px 0 white,
        2px 2px 4px rgba(0, 0, 0, 0.3);
}

.light-mode .objectives-slide {
    color: var(--text-color);
}

.light-mode .objective-card,
.dark-mode .objective-card {
    background: rgba(255, 255, 255, 1);
    border-left: 5px solid var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    opacity: 1;
}

.light-mode .objective-text {
    color: var(--text-color);
}

.light-mode .resource-header {
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 3px solid var(--primary-color);
}

.light-mode .summary-slide {
    color: var(--text-color);
}

.light-mode .summary-content,
.dark-mode .summary-content {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    opacity: 1;
}

.light-mode .summary-item {
    color: var(--text-color);
    background: rgba(0, 0, 0, 0.03);
}

.light-mode .control-bar {
    background: var(--control-bg);
    border-top: 2px solid rgba(201, 12, 15, 0.2);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.light-mode .control-btn {
    color: var(--text-color);
    background: transparent;
}

.light-mode .control-btn:hover {
    background: var(--control-hover);
    color: var(--primary-color);
}

.light-mode .slide-info {
    color: var(--text-color);
}

.light-mode .progress-bar {
    background: rgba(0, 0, 0, 0.2);
}

.light-mode .progress-fill {
    background: var(--primary-color);
}

.light-mode .overview-modal {
    background: rgba(255, 255, 255, 0.98);
}

.light-mode .overview-content {
    background: white;
    border: 2px solid var(--primary-color);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.light-mode .overview-content {
    background: white;
    border: 2px solid var(--primary-color);
}

.light-mode .overview-header h2 {
    color: var(--text-color);
}

.light-mode .overview-thumbnail {
    background: rgba(0, 0, 0, 0.05);
    border: 2px solid rgba(0, 0, 0, 0.2);
}

.light-mode .overview-thumbnail:hover {
    border-color: var(--primary-color);
    background: rgba(0, 0, 0, 0.08);
}

.light-mode .overview-thumbnail.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(201, 12, 15, 0.5);
}

.light-mode .thumbnail-number {
    background: var(--primary-color);
    color: white;
}

.light-mode .close-btn:hover {
    background: var(--primary-color);
    color: white;
}

.light-mode .thumbnail-content {
    color: var(--text-color);
}

.light-mode .preview-objectives,
.light-mode .preview-resource,
.light-mode .preview-summary {
    color: rgba(29, 29, 27, 0.8);
}

.light-mode .close-btn {
    color: var(--text-color);
}

.light-mode .close-btn:hover {
    color: var(--primary-color);
    background: var(--control-hover);
}

/* Slide content edit modal (presentation owner only) */
.slide-edit-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 2100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: fadeIn 0.3s ease;
}

.slide-edit-modal-content {
    max-width: 640px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    background: rgba(24, 24, 24, 0.98);
    border-radius: 10px;
    padding: 24px 28px;
    border: 2px solid var(--primary-color);
    box-sizing: border-box;
}

.slide-edit-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    gap: 12px;
}

.slide-edit-modal-header h2 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin: 0;
}

.slide-edit-modal-subtitle {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.95rem;
    margin: 0 0 18px 0;
    line-height: 1.4;
}

.slide-edit-label {
    display: block;
    color: var(--secondary-color);
    font-weight: 700;
    margin: 14px 0 6px 0;
    font-size: 0.95rem;
}

.slide-edit-hint {
    color: rgba(255, 255, 255, 0.7);
    margin: 0 0 8px 0;
    font-size: 0.9rem;
}

.slide-edit-textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.45;
    resize: vertical;
    min-height: 72px;
}

.slide-edit-textarea:focus {
    outline: 2px solid var(--secondary-color);
    outline-offset: 1px;
}

.slide-edit-error {
    color: #ffb4b4;
    margin: 12px 0 0 0;
    font-size: 0.95rem;
}

.slide-edit-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 22px;
    flex-wrap: wrap;
}

.slide-edit-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    border: 2px solid transparent;
    font-family: inherit;
}

.slide-edit-btn-primary {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.slide-edit-btn-primary:hover:not(:disabled) {
    filter: brightness(1.08);
}

.slide-edit-btn-primary:disabled {
    opacity: 0.75;
    cursor: not-allowed;
}

.slide-edit-btn-secondary {
    background: transparent;
    color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.slide-edit-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
}

.light-mode .slide-edit-modal-content {
    background: rgba(255, 255, 255, 0.98);
}

.light-mode .slide-edit-modal-subtitle,
.light-mode .slide-edit-hint {
    color: rgba(29, 29, 27, 0.75);
}

.light-mode .slide-edit-textarea {
    background: #fff;
    color: var(--text-color);
    border-color: rgba(0, 0, 0, 0.2);
}

.light-mode .slide-edit-error {
    color: #a40000;
}
