﻿/* ==========================================================================
   ART SACRÃƒÆ’Ã¢â‚¬Â° ÃƒÂ¢Ã¢â€šÂ¬Ã¢â‚¬Â PRESENTATION DESIGN SYSTEM
   Inspired by sacred art: gold leaf, deep blues, stained glass, parchment
   ========================================================================== */

/* ---- CSS Variables / Design Tokens ---- */
\:root {
    /* Bright & Positive palette */
    --bg-void: #F8FAFC;
    --bg-primary: #FFFFFF;
    --bg-secondary: #F1F5F9;
    --bg-slide: #FFFFFF;
    --bg-card: var(--bg-card);
    --bg-overlay: var(--bg-overlay);
    --border-light: var(--border-light);
    --bg-transparent: var(--border-light);

    /* Elegant Gold */
    --gold: #D97706;
    --gold-bright: #F59E0B;
    --gold-dim: #B45309;
    --gold-glow: rgba(217, 119, 6, 0.15);

    /* Positive colors */
    --blue-sacred: #1D4ED8;
    --blue-deep: #1E3A8A;
    --blue-light: #3B82F6;
    --red-carmine: #DC2626;
    --red-warm: #EA580C;
    --green-liturgy: #16A34A;

    /* Text */
    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-muted: #94A3B8;
    --text-accent: var(--blue-sacred);

    /* Typography */
    --font-title: 'Playfair Display', 'Georgia', serif;
    --font-body: 'Inter', 'Segoe UI', sans-serif;
    --font-quote: 'Cormorant Garamond', 'Georgia', serif;

    /* Spacing */
    --slide-padding: clamp(2rem, 5vw, 5rem);
    --gap: 1.5rem;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-medium: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.7s cubic-bezier(0.4, 0, 0.2, 1);

    /* Radii */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;

    /* Level colors */
    --level-novice: #0D9488;
    --level-intermediate: var(--gold);
    --level-expert: #E11D48;
}

/* ---- Reset & Base ---- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    background: var(--bg-void);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    cursor: default;
}

::selection {
    background: var(--gold);
    color: var(--bg-primary);
}

/* ---- Loading Screen ---- */
#loading-screen {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: var(--bg-void);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

#loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-content {
    text-align: center;
}

.loading-cross {
    font-size: 3rem;
    color: var(--gold);
    animation: pulse-glow 2s ease-in-out infinite;
    margin-bottom: 1.5rem;
}

.loading-content h1 {
    font-family: var(--font-title);
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.loading-content p {
    font-family: var(--font-quote);
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 2rem;
}

.loading-bar {
    width: 200px;
    height: 2px;
    background: var(--bg-secondary);
    border-radius: 2px;
    margin: 0 auto;
    overflow: hidden;
}

.loading-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold-dim), var(--gold-bright));
    width: 0%;
    animation: loading-progress 1.5s ease-out forwards;
}

@keyframes loading-progress {
    to { width: 100%; }
}

@keyframes pulse-glow {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1); }
}

/* ---- Top Bar ---- */
#top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1.5rem;
    background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-overlay) 70%, transparent 100%);
    backdrop-filter: blur(10px);
    transition: transform var(--transition-medium), opacity var(--transition-medium);
}

#top-bar.auto-hide {
    transform: translateY(-100%);
    opacity: 0;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 200px;
}

.logo-mark {
    color: var(--gold);
    font-size: 1.2rem;
}

.part-indicator {
    font-family: var(--font-title);
    font-size: 0.85rem;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 250px;
}

.top-bar-center {
    display: flex;
    justify-content: center;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 200px;
    justify-content: flex-end;
}

/* ---- Level Switcher ---- */
.level-switcher {
    display: flex;
    background: var(--border-light);
    border: 1px solid var(--border-light);
    border-radius: 100px;
    padding: 3px;
    gap: 2px;
}

.level-btn {
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.35rem 1rem;
    border: none;
    border-radius: 100px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}

.level-btn:hover {
    color: var(--text-primary);
    background: var(--border-light);
}

.level-btn.active {
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.level-btn[data-level="novice"].active { border-bottom: 2px solid var(--level-novice); }
.level-btn[data-level="intermediate"].active { border-bottom: 2px solid var(--level-intermediate); }
.level-btn[data-level="expert"].active { border-bottom: 2px solid var(--level-expert); }

.level-icon { font-size: 0.65rem; }

/* ---- Icon Buttons ---- */
.icon-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.4rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    line-height: 1;
}

.icon-btn:hover {
    color: var(--gold);
    background: var(--border-light);
}

.slide-counter {
    font-family: var(--font-body);
    font-size: 0.75rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    min-width: 50px;
    text-align: right;
}

/* ---- Progress Bar ---- */
#progress-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--border-light);
    z-index: 100;
}

#progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold-dim), var(--gold-bright), var(--gold));
    width: 0%;
    transition: width var(--transition-medium);
}

#progress-parts {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.progress-marker {
    position: absolute;
    top: -2px;
    width: 2px;
    height: 7px;
    background: var(--text-muted);
    opacity: 0.5;
}

/* ---- Navigation Arrows ---- */
.nav-arrow {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 90;
    background: var(--bg-overlay);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    font-size: 2rem;
    width: 48px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    opacity: 0;
}

body:hover .nav-arrow,
.nav-arrow:focus {
    opacity: 1;
}

.nav-arrow:hover {
    background: rgba(197, 165, 90, 0.15);
    color: var(--gold);
    border-color: rgba(197, 165, 90, 0.3);
}

#nav-prev { left: 1rem; }
#nav-next { right: 1rem; }

.nav-arrow:disabled {
    opacity: 0.2 !important;
    cursor: default;
}

/* ---- Main Presentation ---- */
#presentation {
    position: fixed;
    inset: 0;
    overflow: hidden;
}

#slides-container {
    width: 100%;
    height: 100%;
    position: relative;
}

/* ---- Slide Base ---- */
.slide {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-y: auto;
    padding: var(--slide-padding);
    padding-top: calc(var(--slide-padding) + 4rem);
    padding-bottom: calc(var(--slide-padding) + 1rem);
    opacity: 0;
    visibility: hidden;
    transform: translateX(60px);
    transition: all var(--transition-slow);
    background: var(--bg-primary);
}

.slide.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.slide.prev {
    transform: translateX(-60px);
}

.slide-inner {
    max-width: 1100px;
    width: 100%;
    margin: auto 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: var(--gap);
}

/* ---- Slide Types ---- */

/* Title Slide */
.slide-title {
    background: radial-gradient(ellipse at 50% 30%, rgba(29, 78, 216, 0.08) 0%, var(--bg-primary) 70%);
    text-align: center;
}

.slide-title .slide-inner {
    align-items: center;
}

.slide-title h1 {
    font-family: var(--font-title);
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    line-height: 1.2;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.slide-title .subtitle {
    font-family: var(--font-quote);
    font-size: clamp(1.1rem, 2.5vw, 1.6rem);
    color: var(--text-secondary);
    font-style: italic;
    font-weight: 400;
}

.slide-title .decoration-line {
    width: 80px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    margin: 1.5rem 0;
}

.slide-title .meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 1rem;
}

/* Section Separator */
.slide-section {
    background: radial-gradient(ellipse at 50% 50%, rgba(197,165,90,0.08) 0%, var(--bg-primary) 70%);
    text-align: center;
}

.slide-section .part-number {
    font-family: var(--font-title);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 1rem;
}

.slide-section h2 {
    font-family: var(--font-title);
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}

.slide-section .section-desc {
    font-family: var(--font-quote);
    font-size: 1.15rem;
    color: var(--text-secondary);
    font-style: italic;
    max-width: 600px;
    margin: 1rem auto 0;
    line-height: 1.6;
}

/* Content Slide */
.slide-content .slide-inner {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    gap: 1.5rem;
}

.slide-content.has-image .slide-inner {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto 1fr;
}

.slide-content.has-image .slide-header {
    grid-column: 1 / -1;
}

.slide-header h2 {
    font-family: var(--font-title);
    font-size: clamp(1.3rem, 3vw, 2rem);
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}

.slide-header h2::after {
    content: '';
    display: block;
    width: 50px;
    height: 2px;
    background: var(--gold);
    margin-top: 0.6rem;
}

.slide-header .slide-subtitle {
    font-family: var(--font-quote);
    font-size: 1rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-top: 0.3rem;
}

.slide-body {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-primary);
    overflow-y: auto;
    padding-right: 0.5rem;
}

.slide-body::-webkit-scrollbar { width: 4px; }
.slide-body::-webkit-scrollbar-track { background: transparent; }
.slide-body::-webkit-scrollbar-thumb { background: var(--gold-dim); border-radius: 4px; }

.slide-body p { margin-bottom: 0.8rem; }
.slide-body p:last-child { margin-bottom: 0; }

.slide-body ul, .slide-body ol {
    padding-left: 1.5rem;
    margin-bottom: 0.8rem;
}

.slide-body li {
    margin-bottom: 0.4rem;
    line-height: 1.6;
}

.slide-body li::marker {
    color: var(--gold);
}

.slide-body strong {
    color: var(--gold);
    font-weight: 600;
}

.slide-body em {
    font-family: var(--font-quote);
    font-style: italic;
    color: var(--text-secondary);
}

/* Quotes */
.slide-body blockquote {
    border-left: 3px solid var(--gold);
    padding: 0.8rem 1.2rem;
    margin: 1rem 0;
    background: var(--gold-glow);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-family: var(--font-quote);
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--text-secondary);
    font-style: italic;
}

.slide-body blockquote cite {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: normal;
    text-align: right;
}

.slide-body blockquote cite::before {
    content: 'ÃƒÂ¢Ã¢â€šÂ¬Ã¢â‚¬Â ';
}

/* Key concept box */
.key-concept {
    background: rgba(29, 78, 216, 0.05);
    border: 1px solid rgba(29, 78, 216, 0.15);
    border-radius: var(--radius-md);
    padding: 1rem 1.2rem;
    margin: 0.8rem 0;
}

.key-concept .concept-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--blue-light);
    margin-bottom: 0.4rem;
}

/* Image area */
.slide-images {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
    justify-content: center;
    min-height: 0;
}

.slide-images.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
    align-items: start;
}

.slide-image-wrapper {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: transform var(--transition-fast);
    border: 1px solid var(--border-light);
    max-height: 100%;
}

.slide-image-wrapper:hover {
    transform: scale(1.02);
    border-color: var(--gold-dim);
}

.slide-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    max-height: 55vh;
}

.image-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.5rem 0.75rem;
    background: linear-gradient(transparent, var(--bg-overlay));
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* ---- Added content badge ---- */
.badge-added {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--level-expert);
    background: rgba(224, 122, 95, 0.1);
    border: 1px solid rgba(224, 122, 95, 0.3);
    padding: 0.2rem 0.6rem;
    border-radius: 100px;
    margin-left: 0.5rem;
    vertical-align: middle;
}

.badge-corrected {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--level-novice);
    background: rgba(78, 205, 196, 0.1);
    border: 1px solid rgba(78, 205, 196, 0.3);
    padding: 0.2rem 0.6rem;
    border-radius: 100px;
    margin-left: 0.5rem;
    vertical-align: middle;
}

/* ---- Speaker Notes Panel ---- */
#notes-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30vh;
    background: var(--bg-overlay);
    backdrop-filter: blur(15px);
    border-top: 1px solid rgba(197, 165, 90, 0.2);
    z-index: 200;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-medium);
    transform: translateY(0);
}

#notes-panel.hidden {
    transform: translateY(100%);
}

.notes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
}

.notes-header h3 {
    font-family: var(--font-title);
    font-size: 0.9rem;
    color: var(--gold);
}

#notes-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.5rem;
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

#notes-content p { margin-bottom: 0.6rem; }

.notes-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 1.5rem;
    border-top: 1px solid var(--border-light);
    font-variant-numeric: tabular-nums;
}

#notes-timer {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--gold);
    font-family: var(--font-body);
}

/* ---- TOC Overlay ---- */
.overlay {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: var(--bg-overlay);
    backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity var(--transition-medium), visibility var(--transition-medium);
}

.overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.overlay-content {
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    overflow-y: auto;
}

.overlay-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.overlay-header h2 {
    font-family: var(--font-title);
    font-size: 1.8rem;
    color: var(--gold);
}

/* TOC Navigation */
#toc-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.toc-part {
    margin-bottom: 1rem;
}

.toc-part-title {
    font-family: var(--font-title);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 0.5rem;
    padding-left: 0.5rem;
}

.toc-item {
    display: flex;
    align-items: center;
    padding: 0.6rem 0.8rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    gap: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.toc-item:hover {
    background: rgba(197, 165, 90, 0.1);
    color: var(--text-primary);
}

.toc-item.current {
    background: rgba(197, 165, 90, 0.15);
    color: var(--gold);
}

.toc-item-num {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    min-width: 24px;
    text-align: right;
}

/* ---- Lightbox ---- */
#lightbox {
    cursor: zoom-out;
}

.lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: var(--radius-md);
    box-shadow: 0 20px 60px rgba(0,0,0,0.8);
}

#lightbox-caption {
    margin-top: 1rem;
    font-family: var(--font-quote);
    font-style: italic;
    color: var(--text-secondary);
    font-size: 1rem;
    text-align: center;
}

.lightbox-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    font-size: 1.5rem !important;
    color: var(--text-primary) !important;
}

/* ---- Level Content Visibility ---- */
.level-content { display: none; }
.level-content.visible { display: block; }

/* Level transition animation */
.level-content.visible {
    animation: fadeInContent 0.3s ease forwards;
}

@keyframes fadeInContent {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
    .slide-content.has-image .slide-inner {
        grid-template-columns: 1fr;
    }

    .slide-images {
        max-height: 35vh;
    }

    .level-btn span.level-label {
        display: none;
    }

    .nav-arrow {
        width: 36px;
        height: 48px;
        font-size: 1.5rem;
    }

    #nav-prev { left: 0.5rem; }
    #nav-next { right: 0.5rem; }
}

@media (max-width: 600px) {
    :root {
        --slide-padding: 1.5rem;
    }

    .top-bar-left .part-indicator {
        display: none;
    }

    .level-switcher {
        font-size: 0.65rem;
    }

    .level-btn {
        padding: 0.25rem 0.6rem;
    }
}

/* ---- Utility ---- */
.hidden { display: none !important; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* ---- Timeline Slide ---- */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, var(--gold), var(--gold-dim), transparent);
}

.timeline-item {
    position: relative;
    padding: 0.6rem 0 0.6rem 1.5rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -2rem;
    top: 0.9rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--gold);
    border: 2px solid var(--bg-primary);
    z-index: 1;
}

.timeline-item.highlight::before {
    width: 14px;
    height: 14px;
    left: calc(-2rem - 2px);
    box-shadow: 0 0 12px var(--gold);
}

.timeline-year {
    font-family: var(--font-title);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--gold);
}

.timeline-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.15rem;
}

/* ---- Print ---- */
/* ---- Print ---- */
@media print {
    body { overflow: visible; }
    .slide { position: relative; page-break-after: always; opacity: 1; visibility: visible; transform: none; }
    #top-bar, #progress-bar, .nav-arrow, #notes-panel { display: none; }
}

/* ---- Annotations & Selection Popup ---- */
#selection-popup {
    position: absolute;
    background: var(--bg-primary);
    border: 1px solid #d4af37;
    border-radius: 8px;
    padding: 0.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    z-index: 1000;
    display: flex;
    gap: 0.4rem;
}
#selection-popup.hidden {
    display: none !important;
}
.popup-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    font-family: inherit;
    transition: background 0.2s, color 0.2s;
}
.popup-btn:hover {
    background: rgba(212, 175, 55, 0.15);
    color: #d4af37;
}

#annotations-sidebar {
    position: fixed;
    top: 60px;
    right: 0;
    bottom: 0;
    width: 350px;
    background: var(--bg-secondary);
    border-left: 1px solid rgba(212, 175, 55, 0.15);
    z-index: 300;
    display: flex;
    flex-direction: column;
    box-shadow: -5px 0 25px rgba(0,0,0,0.5);
    transition: transform var(--transition-medium);
}
#annotations-sidebar.hidden {
    transform: translateX(100%);
}
.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
}
.sidebar-header h3 {
    margin: 0;
    font-family: var(--font-title);
    color: var(--gold);
    font-size: 1.1rem;
}
.sidebar-filters {
    padding: 0.8rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
}
.sidebar-filters select {
    width: 100%;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    padding: 0.4rem;
    border-radius: 4px;
    font-family: inherit;
}
#annotations-list {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.annotation-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    padding: 0.8rem;
    font-size: 0.85rem;
}
.annotation-item-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.4rem;
    color: #8888a0;
    font-size: 0.75rem;
}
.annotation-item-author {
    font-weight: 600;
    color: var(--text-primary);
}
.annotation-item-type {
    font-size: 0.7rem;
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    font-weight: bold;
}
.type-comment { background: var(--border-light); color: var(--text-primary); }
.type-question { background: rgba(241,196,15,0.15); color: #f1c40f; }
.type-correction { background: rgba(231,76,60,0.15); color: #e74c3c; }
.type-suggestion { background: rgba(46,204,113,0.15); color: #2ecc71; }

.annotation-selection {
    font-style: italic;
    background: rgba(212,175,55,0.08);
    border-left: 2px solid var(--gold);
    padding: 0.3rem 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    color: #a0a0b8;
}
.annotation-text {
    line-height: 1.4;
    color: var(--text-primary);
}
.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-light);
    background: #0d0d1a;
}
.sidebar-footer textarea {
    width: 100%;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    padding: 0.5rem;
    border-radius: 4px;
    font-family: inherit;
    resize: none;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}
.sidebar-footer button {
    width: 100%;
    background: var(--gold);
    border: none;
    color: #05050e;
    padding: 0.5rem;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
}
#btn-annotations .badge {
    background: var(--gold);
    color: #05050e;
    padding: 0.1rem 0.4rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: bold;
    margin-left: 0.3rem;
}



:root.dark-theme {
    --bg-void: #020617;
    --bg-primary: #0F172A;
    --bg-secondary: #1E293B;
    --bg-slide: #0F172A;
    --bg-card: rgba(15, 23, 42, 0.95);
    --bg-overlay: rgba(15,23,42,0.92);
    --border-light: rgba(255,255,255,0.1);
    --bg-transparent: rgba(255,255,255,0.05);

    --text-primary: #F8FAFC;
    --text-secondary: #94A3B8;
    --text-muted: #475569;
    
    --gold: #D4AF37;
    --gold-bright: #FDE047;
    --gold-dim: #A16207;
    --gold-glow: rgba(212, 175, 55, 0.15);
    
    --text-accent: var(--gold);
}





#btn-submit-anno { background: #d4af37 !important; color: #05050e !important; }

