/* ===== GLOBAL RESET & SCROLL SNAP ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html {
    height: 100%;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
}
body {
    width: 100%; min-height: 100%;
    font-family: 'Cormorant Garamond', serif;
    background: #0a0502; color: #f5e6c8;
    overflow-x: hidden;
}
.snap-page {
    position: relative; width: 100vw; height: 100vh;
    scroll-snap-align: start; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
}

/* ===== PROGRESS BAR & PAGE INDICATOR ===== */
.progress-container {
    position: fixed; top: 0; left: 0; width: 100%; height: 3px;
    background: rgba(10, 5, 2, 0.3); z-index: 10000;
}
.progress-bar {
    height: 100%;
    background: linear-gradient(to right, #ff8c00, #d4af37);
    width: 0%; transition: width 0.3s ease;
}
.page-indicator {
    position: fixed; top: 15px; left: 30px;
    font-family: 'Playfair Display', serif; font-size: 0.9rem;
    color: #f5e6c8; z-index: 10000;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
    letter-spacing: 0.1em;
    background: rgba(10, 5, 2, 0.7);
    padding: 8px 15px; border-radius: 3px;
    border: 1px solid rgba(212, 175, 55, 0.3);
}

/* ===== LOADING SCREEN ===== */
.loading-screen {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: #0a0502; z-index: 9999;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    opacity: 1; transition: opacity 1s ease;
}
.loading-screen.loaded { opacity: 0; pointer-events: none; }
.loading-title {
    font-family: 'Great Vibes', cursive;
    font-size: clamp(3rem, 6vw, 5rem); color: #f5e6c8;
    text-shadow: 0 0 30px rgba(255, 69, 0, 0.4), 0 2px 4px rgba(0,0,0,0.8);
    margin-bottom: 40px; opacity: 0;
    animation: loadingFadeIn 1s ease 0.5s forwards;
}
.loading-subtitle {
    font-family: 'Cormorant Garamond', serif; font-style: italic;
    font-size: 1.1rem; color: #e8d4a8; letter-spacing: 0.15em;
    opacity: 0; animation: loadingFadeIn 1s ease 1s forwards;
}
.loading-divider {
    width: 0; height: 1px;
    background: linear-gradient(to right, transparent, rgba(255, 140, 0, 0.6), transparent);
    margin: 30px 0; animation: loadingDivider 1.5s ease 1.5s forwards;
}
@keyframes loadingFadeIn { to { opacity: 1; } }
@keyframes loadingDivider { to { width: 200px; } }

/* ===== SHADOW BRIDGES ===== */
.shadow-bridge-top, .shadow-bridge-bottom {
    position: absolute; left: 0; width: 100%; height: 180px;
    z-index: 4; pointer-events: none;
}
.shadow-bridge-top {
    top: 0;
    background: linear-gradient(to bottom, #0a0502 0%, transparent 100%);
}
.shadow-bridge-bottom {
    bottom: 0;
    background: linear-gradient(to top, #0a0502 0%, transparent 100%);
}

/* =========================================
   ARCHIVIST TAB STYLES (With Pulse Animation)
   ========================================= */
@keyframes pulseTab {
    0% { transform: translateY(-50%) scale(1); box-shadow: 2px 2px 8px rgba(0,0,0,0.4); }
    50% { transform: translateY(-50%) scale(1.08); box-shadow: 0 0 15px rgba(139, 0, 0, 0.8); }
    100% { transform: translateY(-50%) scale(1); box-shadow: 2px 2px 8px rgba(0,0,0,0.4); }
}
.archivist-tab-btn {
    position: absolute; left: 0; top: 50%; transform: translateY(-50%);
    background-color: #8b0000; color: #f5e6c8; border: none;
    padding: 16px 10px; border-radius: 0 6px 6px 0;
    cursor: pointer; z-index: 100;
    box-shadow: 2px 2px 8px rgba(0,0,0,0.4);
    transition: background-color 0.3s ease;
    animation: pulseTab 3s infinite ease-in-out; 
}
.archivist-tab-btn:hover {
    background-color: #a00000; animation: none;
    transform: translateY(-50%) scale(1.05);
}
.tab-icon { font-size: 1.3rem; display: block; }

.archivist-panel {
    position: absolute; top: 0; left: -400px; width: 320px; height: 100%;
    background-color: #4a0404; color: #f5e6c8; z-index: 101;
    padding: 50px 30px 30px 30px; box-shadow: 5px 0 20px rgba(0,0,0,0.6);
    transition: left 0.5s cubic-bezier(0.25, 1, 0.5, 1); overflow-y: auto;
}
.archivist-panel.open { left: 0; }
.close-panel-btn {
    position: absolute; top: 15px; right: 20px;
    background: none; border: none; color: #f5e6c8;
    font-size: 2rem; cursor: pointer; line-height: 1;
    transition: color 0.3s ease;
}
.close-panel-btn:hover { color: #d4af37; }
.panel-content { padding-top: 20px; }
.panel-title {
    font-family: 'Playfair Display', serif; font-size: 1.3rem;
    color: #f5e6c8; margin-bottom: 8px; line-height: 1.3;
}
.panel-subtitle {
    font-family: 'Cormorant Garamond', serif; font-style: italic;
    font-size: 1.05rem; color: #d4af37; margin-bottom: 25px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.3); padding-bottom: 12px;
}
.panel-details p {
    font-family: 'Cormorant Garamond', serif; font-size: 1rem;
    line-height: 1.5; margin-bottom: 12px; color: #e8d4a8;
}
.panel-details em { color: #d4af37; font-style: italic; }

/* Right-side tab styles */
.archivist-tab-btn-right {
    position: absolute; right: 0; top: 50%; transform: translateY(-50%);
    background-color: #8b0000; color: #f5e6c8; border: none;
    padding: 16px 10px; border-radius: 6px 0 0 6px;
    cursor: pointer; z-index: 100;
    box-shadow: -2px 2px 8px rgba(0,0,0,0.4);
    transition: background-color 0.3s ease;
    animation: pulseTab 3s infinite ease-in-out; 
}
.archivist-tab-btn-right:hover {
    background-color: #a00000; animation: none;
    transform: translateY(-50%) scale(1.05);
}

.archivist-panel-right {
    position: absolute; top: 0; right: -400px; width: 320px; height: 100%;
    background-color: #4a0404; color: #f5e6c8; z-index: 101;
    padding: 50px 30px 30px 30px; box-shadow: -5px 0 20px rgba(0,0,0,0.6);
    transition: right 0.5s cubic-bezier(0.25, 1, 0.5, 1); overflow-y: auto;
}
.archivist-panel-right.open { right: 0; }
.archivist-panel-right .close-panel-btn {
    position: absolute; top: 15px; left: 20px;
    background: none; border: none; color: #f5e6c8;
    font-size: 2rem; cursor: pointer; line-height: 1;
    transition: color 0.3s ease;
}
.archivist-panel-right .close-panel-btn:hover { color: #d4af37; }

/* =========================================
   CITATION POP-UPS (CLICKABLE TOOLTIPS)
   ========================================= */
.citation-pop {
    color: #ff8c00; font-style: italic; cursor: pointer;
    border-bottom: 1px dotted rgba(255, 140, 0, 0.5);
    transition: color 0.3s ease, border-color 0.3s ease; position: relative;
}
.citation-pop:hover { color: #ffa500; border-bottom-color: #ffa500; }
.citation-pop.active { color: #ffa500; border-bottom-color: #ffa500; font-weight: 600; }

#citation-tooltip {
    position: fixed; bottom: 40px; left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(10, 5, 2, 0.95); color: #f5e6c8;
    padding: 15px 25px; border: 1px solid #d4af37; border-radius: 4px;
    font-family: 'Cormorant Garamond', serif; font-size: 1.05rem;
    font-style: italic; max-width: 600px; width: 90%; text-align: center;
    opacity: 0; visibility: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    z-index: 10000; box-shadow: 0 5px 20px rgba(0,0,0,0.7);
    pointer-events: none; line-height: 1.5;
}
#citation-tooltip.visible {
    opacity: 1; visibility: visible;
    transform: translateX(-50%) translateY(0); pointer-events: auto;
}

/* =========================================
   NAVIGATION BUTTONS
   ========================================= */
.navigation-container {
    position: absolute; bottom: 40px; left: 50%;
    transform: translateX(-50%); z-index: 10;
    display: flex; gap: 20px; opacity: 0;
    transition: opacity 1s ease 2.5s;
}
/* Note: You will change .page-s8-1 to your actual last page class */
.page-s8-2.in-view .navigation-container { opacity: 1; } 

.nav-btn {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 25px; background: rgba(10, 5, 2, 0.8);
    border: 2px solid #d4af37; color: #f5e6c8; text-decoration: none;
    font-family: 'Playfair Display', serif; font-size: 1rem;
    letter-spacing: 0.1em; text-transform: uppercase; border-radius: 4px;
    transition: all 0.3s ease;
}
.nav-btn:hover { background: rgba(212, 175, 55, 0.9); color: #0a0502; }
.btn-arrow { width: 20px; height: 20px; }

/* =========================================
   MOBILE RESPONSIVENESS
   ========================================= */
@media (max-width: 768px) {
    #citation-tooltip { bottom: 20px; font-size: 0.95rem; padding: 12px 20px; }
    .archivist-panel { width: 100%; left: -100%; }
    .archivist-panel-right { width: 100%; right: -100%; }
    .navigation-container {
        bottom: 30px; flex-direction: column; width: 80%;
    }
    .nav-btn { justify-content: center; width: 100%; }
}
/* =========================================
   PAGE 1: BIBLIOGRAFIE SELECTIVĂ
   ========================================= */
.page-s8-1 {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #1a0f0a;
}
.page-s8-1-bg {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: url('images/section-8-bibliography.jpg'); /* You'll need to create/upload this background */
    background-size: cover;
    background-position: center;
    z-index: 1;
    transform: scale(1.05);
    transition: transform 2s cubic-bezier(0.25, 1, 0.5, 1);
}
.page-s8-1.in-view .page-s8-1-bg {
    transform: scale(1);
}

/* Bibliography Container */
.bibliography-container {
    position: relative;
    z-index: 4;
    width: 90%;
    max-width: 1200px;
    padding: 60px 80px;
    background: rgba(245, 230, 200, 0.9);
    border: 8px solid #8b0000;
    outline: 4px solid #d4af37;
    outline-offset: -14px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.6);
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.page-s8-1.in-view .bibliography-container {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 1.2s ease 1s, transform 1.2s cubic-bezier(0.25, 1, 0.5, 1) 1s;
}

/* Title */
.bibliography-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    color: #8b0000;
    text-align: center;
    margin-bottom: 50px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-weight: 700;
}

/* Two-Column Layout */
.bibliography-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.bibliography-column {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* Individual Entries */
.biblio-entry {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.1rem;
    line-height: 1.6;
    color: #1a0f0a;
    font-weight: 600;
    text-align: justify;
}

.biblio-entry p {
    margin: 0;
}

.biblio-entry strong {
    color: #8b0000;
    font-weight: 700;
}

.biblio-entry em {
    font-style: italic;
    color: #5a0a0a;
}

/* Mobile Responsiveness for Page 1 */
@media (max-width: 768px) {
    .bibliography-container {
        width: 95%;
        padding: 40px 30px;
        border-width: 6px;
        outline-width: 3px;
        outline-offset: -10px;
    }
    
    .bibliography-title {
        font-size: 1.8rem;
        margin-bottom: 30px;
    }
    
    .bibliography-columns {
        grid-template-columns: 1fr; /* Single column on mobile */
        gap: 20px;
    }
    
    .biblio-entry {
        font-size: 1rem;
        line-height: 1.5;
    }
    
    .page-s8-1-bg {
        background-position: center center;
    }
}
/* =========================================
   PAGE 2: CREDITS & FINAL SCREEN
   ========================================= */
.page-s8-2 {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f5e6c8; /* Parchment base color */
}

/* Parchment Background Texture */
.page-s8-2-bg {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    /* You can use a subtle noise texture here if available, otherwise a solid color works */
    background-color: #f5e6c8;
    background-image: radial-gradient(circle at center, #fdfbf7 0%, #e6d5b8 100%);
    z-index: 1;
}

/* Main Container */
.final-credits-container {
    position: relative;
    z-index: 4;
    width: 90%;
    max-width: 1100px;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1.2s ease 1s, transform 1.2s cubic-bezier(0.25, 1, 0.5, 1) 1s;
}

.page-s8-2.in-view .final-credits-container {
    opacity: 1;
    transform: translateY(0);
}

/* The Red Band */
.final-red-band {
    background: linear-gradient(to bottom, #5a0a0a, #8b0000, #5a0a0a);
    padding: 50px 40px;
    text-align: center;
    color: #ffffff;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    border-top: 2px solid #a00000;
    border-bottom: 2px solid #3a0505;
}

.final-title {
    font-family: 'Great Vibes', cursive;
    font-size: clamp(3rem, 6vw, 5rem);
    margin: 0 0 10px 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    line-height: 1.2;
}

.final-subtitle {
    font-family: 'Great Vibes', cursive;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    margin: 0 0 30px 0;
    color: #f5e6c8;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.final-intro {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.2rem;
    line-height: 1.6;
    max-width: 800px;
    margin: 0 auto;
    font-style: italic;
}

/* Details Below */
.final-details {
    background-color: transparent; /* Sits on the parchment background */
    padding: 40px 20px;
    text-align: center;
    color: #1a0f0a;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.8;
}

.final-details p {
    margin-bottom: 10px;
}

.final-details em {
    font-style: italic;
    color: #5a0a0a;
}

.final-footer {
    margin-top: 30px;
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    letter-spacing: 0.1em;
    font-size: 1rem;
    color: #0a0502;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .final-red-band {
        padding: 30px 20px;
    }
    .final-intro {
        font-size: 1rem;
    }
    .final-details {
        font-size: 1rem;
        padding: 20px 10px;
    }
    .navigation-container {
        bottom: 20px;
    }
}