/* General Styles & Variables */
:root {
    --bg-creme: #f5f2eb;
    --paper-white: #fdfcf7;
    --olive-dark: #132016;
    /* Deep dark forest green from mockup */
    --olive-medium: #2e4436;
    --olive-light: #eff2ef;
    --collegiate-gold: #d4b475;
    /* Premium gold color */
    --collegiate-gold-hover: #bda065;
    --tape-green: rgba(147, 169, 143, 0.45);
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.08);
    --shadow-hard: 0 15px 35px rgba(0, 0, 0, 0.15);
    --font-serif: "Playfair Display", Georgia, serif;
    --font-display: "Cinzel", serif;
    --font-sans: "Inter", sans-serif;
    --font-hand: "Caveat", cursive;
}

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

body {
    background-color: var(--olive-dark);
    background-image: url('assets/images/desk_flatlay.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    font-family: var(--font-sans);
    color: var(--olive-dark);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    overscroll-behavior: none;
    -webkit-overflow-scrolling: auto;
}

body.no-scroll {
    overflow: hidden !important;
}

/* Disable scrolling on mobile/touch devices (iOS + Android) */
@media (max-width: 1024px), (hover: none) and (pointer: coarse) {
    html, body {
        overflow: hidden !important;
        height: 100vh;
        height: 100dvh;
        position: fixed;
        width: 100%;
        overscroll-behavior: none;
        -webkit-overflow-scrolling: auto;
        touch-action: none;
    }
    
    .app-container {
        height: 100vh;
        height: 100dvh;
        overflow: hidden;
    }
    
    .scrapbook-album,
    .album-page,
    .st-wrapper {
        touch-action: none !important;
    }
}

/* Retro Grain Noise Overlay */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 50;
    /* Must be BELOW modals and header buttons */
}

.app-container {
    width: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Elegant Full-Width Dark Green Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--olive-dark);
    padding: 15px 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    position: relative; /* Positioned to respect z-index */
    z-index: 2000000; /* Higher than all workspace content and background floaters */
    border-bottom: 1px solid rgba(212, 180, 117, 0.2);
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
}

.app-header::-webkit-scrollbar {
    display: none; /* Hide scrollbar for a cleaner look */
}

.header-logo-container,
.header-nav-menu,
.header-controls {
    flex-shrink: 0;
}

.header-logo-container .main-title {
    font-family: var(--font-display);
    font-size: 1.6rem;
    color: var(--collegiate-gold);
    letter-spacing: 1px;
    font-weight: 800;
}

/* Complex Animated Wave Logo */
.logo-wave-text {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.logo-wave-text span {
    display: inline-block;
    transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: logoWave 4s infinite ease-in-out;
    animation-delay: calc(0.15s * var(--i));
}

.logo-wave-text:hover span {
    animation-play-state: paused;
    color: rgba(255, 255, 255, 0.7);
    transform: scale(0.95);
    text-shadow: none;
}

.logo-wave-text span:hover {
    color: var(--collegiate-gold);
    transform: scale(1.6) translateY(-8px);
    text-shadow: 0px 5px 20px rgba(255,215,0,0.8);
    z-index: 10;
}

@keyframes logoWave {
    0%, 30%, 100% {
        transform: translateY(0) scale(1);
        color: var(--collegiate-gold);
        text-shadow: none;
    }
    15% {
        transform: translateY(-5px) scale(1.15);
        color: #fff;
        text-shadow: 0px 5px 15px rgba(255,215,0,0.8);
    }
}

.header-nav-menu {
    display: flex;
    align-items: center;
    gap: 25px;
}

.header-nav-menu .nav-link {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    font-family: var(--font-sans);
    padding: 8px 16px;
    position: relative;
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    border-radius: 8px;
    overflow: hidden;
    z-index: 1;
}

.header-nav-menu .nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 215, 0, 0));
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: -1;
    border-radius: 8px;
}

.header-nav-menu .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--collegiate-gold);
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    transform: translateX(-50%);
    box-shadow: 0 0 10px var(--collegiate-gold);
}

.header-nav-menu .nav-link:hover {
    color: var(--collegiate-gold);
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
    transform: translateY(-2px);
}

.header-nav-menu .nav-link:hover::before,
.header-nav-menu .nav-link.active::before {
    opacity: 1;
}

.header-nav-menu .nav-link:hover::after,
.header-nav-menu .nav-link.active::after {
    width: 80%;
}

.header-nav-menu .nav-link.active {
    color: var(--collegiate-gold);
    font-weight: 600;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
    z-index: 101;
    /* Above noise overlay and other layers */
}

/* Settings Panel Integration */
.settings-panel {
    display: none;
    background-color: var(--paper-white);
    border: 1px solid var(--collegiate-gold);
    border-radius: 6px;
    padding: 20px;
    box-shadow: var(--shadow-soft);
}

.settings-panel.open {
    display: block;
}

.settings-panel h4 {
    font-family: var(--font-display);
    font-size: 1rem;
    margin-bottom: 5px;
}

.settings-tip {
    font-size: 0.8rem;
    color: var(--olive-medium);
    margin-bottom: 12px;
}

.settings-input-row {
    display: flex;
    gap: 10px;
}

.settings-input-row input {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--olive-medium);
    border-radius: 4px;
    background-color: var(--bg-creme);
}

.settings-status {
    font-size: 0.8rem;
    color: var(--collegiate-gold-hover);
    margin-top: 8px;
    font-style: italic;
}

/* Premium Buttons */
.btn-primary {
    background-color: var(--olive-dark);
    color: var(--paper-white);
    border: 1px solid var(--collegiate-gold);
    padding: 12px 24px;
    font-family: var(--font-sans);
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.btn-primary:hover {
    background-color: var(--collegiate-gold);
    color: var(--olive-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.btn-sound-control {
    background-color: transparent;
    color: var(--olive-dark);
    border: 1px solid var(--olive-medium);
    padding: 12px 20px;
    font-family: var(--font-sans);
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.btn-sound-control.playing {
    background-color: var(--tape-green);
    border-color: var(--olive-dark);
}

.btn-sound-control:hover {
    background-color: var(--olive-light);
}

/* Filters & Search */
.filter-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    background-color: var(--paper-white);
    padding: 15px 25px;
    border-radius: 8px;
    border: 1px dashed var(--olive-medium);
}

.search-box-wrapper {
    position: relative;
    flex: 1;
    max-width: 450px;
    min-width: 280px;
}

.search-box-wrapper input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border-radius: 6px;
    border: 1px solid var(--olive-medium);
    background-color: var(--bg-creme);
    color: var(--olive-dark);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    outline: none;
    transition: border 0.3s;
}

.search-box-wrapper input:focus {
    border-color: var(--collegiate-gold);
}

.search-box-wrapper .search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--olive-medium);
}

.filter-chips {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.chip {
    background-color: var(--olive-light);
    border: 1px solid transparent;
    color: var(--olive-medium);
    padding: 8px 16px;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.25s;
}

.chip:hover {
    background-color: var(--tape-green);
    color: var(--olive-dark);
}

.chip.active {
    background-color: var(--olive-dark);
    color: var(--paper-white);
    border-color: var(--collegiate-gold);
}

/* Album Workspace & Scrapbook Spread */
.album-workspace {
    perspective: 1500px;
    margin-bottom: 40px;
}

.book-container-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}



/* NEW ROBUST NAV BAR */
.robust-nav-bar {
    display: none !important;
}

.robust-nav-btn {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 24px 48px;
    border-radius: 60px;
    background: var(--olive-dark);
    color: var(--collegiate-gold);
    border: 4px solid var(--collegiate-gold);
    font-family: var(--font-sans);
    font-size: 2.2rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.robust-nav-btn:hover {
    background: var(--collegiate-gold);
    color: var(--olive-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.robust-nav-btn:active {
    transform: translateY(1px);
}

.album-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    position: relative;
    padding: 30px 0;
}



.book-cover-background {
    display: none;
}

.scrapbook-album {
    background-color: transparent;
    position: relative;
    box-shadow: none;
    border: none;
    /* Base sizes, will be controlled by StPageFlip config too */
    width: 100%;
    max-width: 1400px;
    height: 900px;
    z-index: 1;
}

/* binding removed for StPageFlip realistic shadow */

.album-page {
    container-type: size;
    padding: 30px 40px;
    padding: 3.5cqh 5.5cqw;
    position: relative;
    /* background-color: var(--paper-white); Removed to allow dynamic inline tints to show */
    background-image:
        /* vertical red margin line */
        linear-gradient(90deg, transparent 59px, rgba(200, 100, 100, 0.3) 59px, rgba(200, 100, 100, 0.3) 61px, transparent 61px),
        /* horizontal blue ruled lines */
        linear-gradient(rgba(100, 150, 200, 0.2) 1px, transparent 1px);
    background-size: 100% 100%, 100% 30px;
    background-position: 0 0, 0 45px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.page-tint-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        /* vertical red margin line */
        linear-gradient(90deg, transparent 59px, rgba(200, 100, 100, 0.3) 59px, rgba(200, 100, 100, 0.3) 61px, transparent 61px),
        /* horizontal blue ruled lines */
        linear-gradient(rgba(100, 150, 200, 0.2) 1px, transparent 1px);
    background-size: 100% 100%, 100% 30px;
    background-position: 0 0, 0 45px;
}

.st-page {
    background-color: transparent !important;
}

/* Realistic Center Crease & Spiral Binding */
.album-page.page-left {
    box-shadow: inset -40px 0 50px -10px rgba(0, 0, 0, 0.12), inset -3px 0 8px rgba(0, 0, 0, 0.1) !important;
}

.album-page.page-left::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 25px;
    z-index: 20;
    background-image: 
        linear-gradient(to bottom, transparent 13px, rgba(255,255,255,0.8) 14px, rgba(255,255,255,0.8) 15px, transparent 16px),
        linear-gradient(to bottom, transparent 12px, #999 12px, #555 17px, transparent 17px),
        radial-gradient(circle at 18px 14.5px, var(--olive-dark) 5px, transparent 6px);
    background-size: 100% 30px;
    background-repeat: repeat-y;
}

.album-page.page-right {
    box-shadow: inset 40px 0 50px -10px rgba(0, 0, 0, 0.12), inset 3px 0 8px rgba(0, 0, 0, 0.1) !important;
}

.album-page.page-right::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 25px;
    z-index: 20;
    background-image: 
        linear-gradient(to bottom, transparent 13px, rgba(255,255,255,0.8) 14px, rgba(255,255,255,0.8) 15px, transparent 16px),
        linear-gradient(to bottom, transparent 12px, #999 12px, #555 17px, transparent 17px),
        radial-gradient(circle at 7px 14.5px, var(--olive-dark) 5px, transparent 6px);
    background-size: 100% 30px;
    background-repeat: repeat-y;
}

.cover-page {
    background-color: #2b1f10 !important;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100' height='100' filter='url(%23noise)' opacity='0.08'/%3E%3C/svg%3E") !important;
    border: 1px solid #1a1208 !important;
    box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.8), inset 5px 0 20px rgba(0, 0, 0, 0.5) !important;
    color: var(--collegiate-gold) !important;
}

.transparent-page {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    pointer-events: none;
}

.cover-page::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.4));
    z-index: 5;
}

.intro-page {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background-color: #faf6eb !important;
    /* Beautiful distinct ivory cream parchment tint */
}

/* Tape Decorative Elements */
.tape {
    position: absolute;
    width: 100px;
    height: 30px;
    background-color: var(--tape-green);
    transform: rotate(-10deg);
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.tape-top-left {
    top: 20px;
    left: 20px;
    transform: rotate(-35deg);
}

.tape-top-right {
    top: 20px;
    right: 20px;
    transform: rotate(35deg);
}

.tape-bottom-right {
    bottom: 20px;
    right: 20px;
    transform: rotate(-15deg);
}

/* Left Page Collage Styles */
.page-header-green {
    background-color: var(--olive-dark);
    color: var(--paper-white);
    padding: 15px 20px;
    border-left: 5px solid var(--collegiate-gold);
    margin-bottom: 25px;
}

.page-header-green h2 {
    font-family: var(--font-display);
    font-size: 1.6rem;
    letter-spacing: 1px;
}

.page-badge {
    font-family: var(--font-serif);
    font-size: 0.8rem;
    color: var(--collegiate-gold);
    display: block;
    margin-top: 4px;
}

.main-collage {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.collage-main-img-frame {
    background-color: white;
    padding: 15px;
    border-radius: 2px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.06);
    border: 1px solid #e8e3d9;
    transform: rotate(-1deg);
}

.collage-img {
    width: 100%;
    height: auto;
    max-height: 250px;
    object-fit: cover;
    border-radius: 2px;
}

.caption-label {
    text-align: center;
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 0.85rem;
    color: var(--olive-medium);
    margin-top: 10px;
}

.collage-subgrid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 15px;
    align-items: center;
}

.collage-thumb-frame {
    background-color: white;
    padding: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    transform: rotate(3deg);
}

.scrapbook-quote-block {
    background-color: var(--olive-light);
    border-radius: 8px;
    padding: 15px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.quote-text {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--olive-dark);
}

.quote-author {
    display: block;
    text-align: right;
    font-family: var(--font-hand);
    font-size: 1.2rem;
    margin-top: 8px;
    color: var(--collegiate-gold-hover);
}

.album-footer-stamp {
    margin-top: 30px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-top: 1px dashed var(--olive-medium);
    padding-top: 20px;
}

.stamp-meta {
    font-family: var(--font-serif);
    font-size: 0.8rem;
    color: var(--olive-medium);
    line-height: 1.4;
}

/* Polaroid Gallery Masonry Grid */
.scrapbook-page-title {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    margin-bottom: 5px;
    color: var(--olive-dark);
}

.scrapbook-page-desc {
    font-size: 0.85rem;
    color: var(--olive-medium);
    margin-bottom: 25px;
    line-height: 1.4;
}

/* Student Scrapbook Entry (Side-by-side Layout) */
.scrapbook-page-layout {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    height: 100%;
    box-sizing: border-box;
    padding: 1cqh 0;
    gap: 7cqh;
}

.student-scrapbook-entry {
    display: flex;
    align-items: center;
    gap: 20px;
    gap: 3cqw;
    height: 28%;
    min-height: 0;
    box-sizing: border-box;
    cursor: pointer;
    transition: transform 0.3s;
    position: relative;
}

@media (hover: hover) {
    .student-scrapbook-entry:hover {
        transform: scale(1.02);
    }
}

.student-scrapbook-entry.image-right {
    flex-direction: row-reverse;
    text-align: right;
}

.student-polaroid-frame {
    background-color: white;
    padding: 8px 8px 24px 8px;
    padding: 1cqh 1cqh 3cqh 1cqh;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9e3d9;
    height: 95%;
    aspect-ratio: 1 / 1.15;
    flex-shrink: 0;
    position: relative;
    z-index: 5;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* --- Profile Corner Animated Lottie Badge --- */
.corner-lottie-badge {
    position: absolute;
    top: -16px;
    right: -16px;
    width: 44px;
    height: 44px;
    z-index: 12;
    pointer-events: none;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.25));
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.corner-lottie-badge lottie-player {
    width: 100%;
    height: 100%;
    display: block;
}

.student-scrapbook-entry:hover .corner-lottie-badge {
    transform: scale(1.15) rotate(6deg);
}

.notebook-polaroid-main {
    position: relative;
}

.notebook-polaroid-main .corner-lottie-badge {
    top: -18px;
    right: -18px;
    width: 52px;
    height: 52px;
    z-index: 15;
}

@media (hover: hover) {
    .student-scrapbook-entry:hover .student-polaroid-frame {
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
        z-index: 10;
    }
}

/* Tape on the polaroid */
.student-polaroid-frame::before {
    content: '';
    position: absolute;
    top: -8px;
    top: -4%;
    left: 50%;
    transform: translateX(-50%) rotate(-5deg);
    width: 45px;
    width: 30%;
    height: 18px;
    height: 10%;
    background-color: var(--tape-green);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.student-polaroid-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 1px solid #e1dacb;
}

.student-scrapbook-entry.image-left .student-polaroid-frame {
    transform: rotate(-3deg);
}

.student-scrapbook-entry.image-right .student-polaroid-frame {
    transform: rotate(3deg);
}

@media (hover: hover) {
    .student-scrapbook-entry:hover .student-polaroid-frame {
        transform: scale(1.05) rotate(0deg);
    }
}

.student-info-text {
    flex-grow: 1;
    min-width: 0;
    pointer-events: none;
    position: relative;
    z-index: 5;
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* Makes text area unclickable so users can flip pages easily */
}

/* Only the polaroid photo frame should be clickable/interactive */
.student-polaroid-frame {
    pointer-events: auto;
    cursor: pointer;
}

/* Ensure the entry passes click to polaroid only */
.student-scrapbook-entry {
    position: relative;
}

.student-scrapbook-entry .student-info-text * {
    pointer-events: none;
    /* Prevents text, links, and other elements from capturing clicks */
}

.student-name {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    font-size: min(1.8rem, 5.2cqh);
    color: var(--olive-dark);
    margin-bottom: 2px;
    line-height: 1.1;
}

.student-major {
    font-size: 1rem;
    font-size: min(1rem, 3cqh);
    font-weight: 600;
    color: var(--olive-medium);
    margin-bottom: 4px;
    line-height: 1.1;
}

.student-quote {
    font-family: var(--font-sans);
    font-size: 1rem;
    font-size: min(1rem, 2.8cqh);
    color: #4a4a4a;
    line-height: 1.3;
    font-style: italic;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Notebook Biodata Overlay (Image 2 style) */
.notebook-biodata-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(19, 32, 22, 0.9);
    backdrop-filter: blur(12px);
    z-index: 9999999 !important;
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.notebook-biodata-overlay.open {
    display: flex;
    opacity: 1;
    animation: fadeInOverlay 0.35s ease forwards;
}

.notebook-modal-content {
    position: relative;
    width: 90%;
    max-width: 1000px;
    animation: zoomBook 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes zoomBook {
    from {
        transform: scale(0.8) rotate(-3deg);
    }

    to {
        transform: scale(1) rotate(0deg);
    }
}

.btn-close-notebook {
    position: absolute;
    top: -16px;
    right: -16px;
    background-color: var(--collegiate-gold);
    border: none;
    color: var(--olive-dark);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s;
    z-index: 999999999 !important;
}

.btn-close-notebook:hover {
    transform: scale(1.1);
    background-color: var(--collegiate-gold-hover);
}

/* Delete Profile Actions */
.btn-delete {
    background-color: transparent;
    color: #b73e3e;
    border: 1px solid rgba(183, 62, 62, 0.3);
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-delete:hover {
    background-color: #b73e3e;
    color: white;
}

/* physical open notebook double page */
.notebook-container {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    background-color: var(--paper-white);
    border-radius: 6px;
    min-height: 620px;
    box-shadow: var(--shadow-hard);
    border: 8px solid #362912;
    position: relative;
}

.notebook-ring-spine {
    position: absolute;
    left: 52.4%;
    top: 5%;
    bottom: 5%;
    width: 25px;
    transform: translateX(-50%);
    background: repeating-linear-gradient(180deg, #dcd7cd 0px, #dcd7cd 15px, #8c8375 20px, #8c8375 25px);
    border-radius: 5px;
    z-index: 10;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.notebook-page {
    padding: 35px;
    position: relative;
    background-color: var(--paper-white);
    background-image: linear-gradient(#e6e1d6 1px, transparent 1px);
    background-size: 100% 28px;
    line-height: 28px;
}

.notebook-left-page {
    border-right: 2px solid #ccc7bd;
    padding-right: 45px;
    background-color: #faf7f0 !important;
    /* Elegant warm left page parchment tint */
}

.notebook-right-page {
    border-left: 2px solid #fff;
    padding-left: 45px;
    background-color: #fdfbf7 !important;
    /* Elegant soft right page tint */
}

.notebook-tape {
    position: absolute;
    top: -10px;
    left: 20px;
    width: 90px;
    height: 25px;
    background-color: var(--tape-green);
    transform: rotate(-5deg);
}

/* Notebook Cover Elements */
.year-giant-stamp {
    position: absolute;
    top: 20px;
    right: 30px;
    font-family: var(--font-display);
    font-size: 4rem;
    font-weight: 800;
    color: rgba(197, 160, 89, 0.25);
    transform: rotate(15deg);
}

.notebook-polaroid-main {
    background-color: white;
    padding: 15px 15px 30px 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
    border: 1px solid #e3ded6;
    transform: rotate(-2deg);
    margin: 20px 0;
    width: 90%;
}

.polaroid-inner-shadow {
    width: 100%;
    height: 280px;
    overflow: hidden;
    border: 1px solid #d8d3c7;
}

.polaroid-inner-shadow img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.notebook-script-name {
    font-family: var(--font-hand);
    font-size: 2.8rem;
    text-align: center;
    color: var(--olive-dark);
    margin-top: 15px;
}

.university-block {
    margin-top: 25px;
    border-top: 2px double var(--olive-medium);
    padding-top: 15px;
    text-align: center;
}

.uni-stamp {
    font-family: var(--font-display);
    font-size: 1.1rem;
    letter-spacing: 2px;
}

.degree-stamp {
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--collegiate-gold-hover);
    margin-top: 4px;
}

/* Notebook Right page biodata details */
.student-full-name {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 600;
    font-size: clamp(1.1rem, 4vw, 2.1rem);
    letter-spacing: 0.5px;
    color: var(--olive-dark);
    border-bottom: 1px dashed var(--olive-medium);
    padding-bottom: 5px;
    line-height: 1.2;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
    max-width: 100%;
    min-width: 0;
    flex: 1;
}

.hometown-tag {
    font-size: 0.85rem;
    font-style: italic;
    color: var(--olive-medium);
}

.scrapbook-section {
    margin-top: 25px;
}

.notebook-section-title {
    font-family: var(--font-display);
    font-size: 0.85rem;
    letter-spacing: 1px;
    color: var(--olive-medium);
    margin-bottom: 8px;
    border-left: 3px solid var(--collegiate-gold);
    padding-left: 8px;
    line-height: 1;
}

.achievement-list {
    list-style-type: square;
    margin-left: 20px;
    font-size: 0.9rem;
}

.handwritten-quote {
    font-family: var(--font-hand);
    font-size: 1.6rem;
    color: var(--collegiate-gold-hover);
    padding: 5px 15px;
    line-height: 1.3;
    border-left: 2px solid rgba(0, 0, 0, 0.1);
}

.guestbook-scroller {
    max-height: 150px;
    overflow-y: auto;
    border: 1px dashed #d1cbbd;
    background-color: var(--bg-creme);
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 10px;
}

.guestbook-note {
    font-size: 0.85rem;
    padding: 5px 0;
    border-bottom: 1px dashed rgba(0, 0, 0, 0.05);
}

.guestbook-note strong {
    font-family: var(--font-hand);
    font-size: 1.1rem;
    color: var(--olive-dark);
}

.signatures-recycler-view {
    max-height: 120px;
    overflow-y: auto;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
    background: rgba(255, 255, 255, 0.7);
    border-radius: 6px;
    padding: 10px 15px;
    margin-top: 5px;
}

.signatures-recycler-view::-webkit-scrollbar {
    width: 6px;
}

.signatures-recycler-view::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

#studentSignaturesList {
    list-style: none;
    padding: 0;
    margin: 0;
    font-family: var(--font-hand);
    font-size: 1.3rem;
    color: var(--olive-dark);
}

#studentSignaturesList li {
    padding: 4px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

#studentSignaturesList li:last-child {
    border-bottom: none;
}

.add-memory-form {
    display: flex;
    gap: 8px;
}

.add-memory-form input {
    padding: 8px 12px;
    border: 1px solid var(--olive-medium);
    border-radius: 4px;
    background-color: var(--paper-white);
    font-size: 0.85rem;
}

#memorySigner {
    width: 30%;
}

#memoryText {
    flex: 1;
}

.btn-stamp-add {
    background-color: var(--olive-dark);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: background-color 0.2s;
}

.btn-stamp-add:hover {
    background-color: var(--collegiate-gold);
    color: var(--olive-dark);
}

/* Student Login Portal overlays */
.login-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(19, 32, 22, 0.9);
    backdrop-filter: blur(12px);
    z-index: 5000;
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.login-modal-overlay.open {
    display: flex;
    opacity: 1;
    animation: fadeInOverlay 0.35s ease forwards;
}

@keyframes fadeInOverlay {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.login-box {
    background: linear-gradient(145deg, var(--paper-white) 0%, #f0ede5 100%);
    padding: 45px 40px;
    border-radius: 16px;
    width: 90%;
    max-width: 460px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(212, 180, 117, 0.15);
    border: 2px solid var(--collegiate-gold);
    position: relative;
    animation: scaleInModal 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    transform-origin: center center;
}

@keyframes scaleInModal {
    from {
        transform: scale(0.85) translateY(20px);
        opacity: 0;
    }

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

.btn-close-login {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.8rem;
    color: var(--olive-dark);
    cursor: pointer;
}

.login-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    margin-bottom: 5px;
    text-align: center;
}

.login-subtitle {
    font-size: 0.85rem;
    color: var(--olive-medium);
    text-align: center;
    margin-bottom: 25px;
}

.login-tips {
    font-size: 0.75rem;
    color: var(--collegiate-gold-hover);
    line-height: 1.4;
    font-style: italic;
}

.btn-submit-login {
    width: 100%;
    justify-content: center;
    margin-top: 10px;
}

/* Login Action Buttons Premium Styling */
.login-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.login-actions button {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
}

.login-actions button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s, height 0.4s;
}

.login-actions button:active::after {
    width: 300px;
    height: 300px;
}

#btnSignIn {
    background: var(--olive-dark) !important;
    color: white !important;
    border: 1px solid var(--collegiate-gold) !important;
}

#btnSignIn:hover {
    background: var(--olive-medium) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

#btnSignUp {
    background: var(--collegiate-gold) !important;
    color: var(--olive-dark) !important;
}

#btnSignUp:hover {
    background: var(--collegiate-gold-hover) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 180, 117, 0.4);
}

.btn-close-login:hover {
    color: var(--collegiate-gold);
    transform: rotate(90deg);
    transition: all 0.3s ease;
}

/* Custom Image Upload Design */
.custom-file-upload {
    border: 2px dashed var(--olive-medium);
    padding: 20px;
    border-radius: 6px;
    text-align: center;
    cursor: pointer;
    background-color: var(--bg-creme);
    position: relative;
    transition: border 0.3s;
}

.custom-file-upload input[type="file"] {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--olive-medium);
}

.upload-inner svg {
    color: var(--collegiate-gold);
}

.upload-preview-container {
    margin-top: 15px;
    border: 1px solid #dcd7cd;
    padding: 6px;
    background-color: white;
    box-shadow: var(--shadow-soft);
    display: flex;
    justify-content: center;
}

.upload-preview-container img {
    max-width: 150px;
    max-height: 150px;
    object-fit: cover;
}

/* Google Drive loading system */
.upload-loader {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: #fffbeb;
    border: 1px solid #fef3c7;
    padding: 12px;
    border-radius: 4px;
    color: #b45309;
    font-size: 0.85rem;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(180, 83, 9, 0.3);
    border-top-color: #b45309;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Custom form panel slide-out */
.form-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(19, 32, 22, 0.85);
    backdrop-filter: blur(12px);
    z-index: 2500000;
    display: none;
    justify-content: center;
    align-items: flex-start;
    overflow-y: auto;
    padding: 30px 20px;
}

.form-overlay.open {
    display: flex;
}

.form-panel {
    background-color: var(--paper-white);
    width: 100%;
    max-width: 680px;
    border-radius: 16px;
    box-shadow:
        0 25px 70px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(212, 180, 117, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    margin-bottom: 30px;
    border: 3px solid var(--collegiate-gold);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-40px) scale(0.92);
    }

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

.form-panel::-webkit-scrollbar {
    width: 8px;
}

.form-panel::-webkit-scrollbar-track {
    background: transparent;
}

.form-panel::-webkit-scrollbar-thumb {
    background: var(--collegiate-gold);
    border-radius: 4px;
}

/* Decorative top gold accent bar */
.form-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg,
            var(--collegiate-gold),
            #fce8b2,
            var(--collegiate-gold));
    border-radius: 16px 16px 0 0;
}

/* Decorative corner ornaments */
.form-panel::after {
    content: '';
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    border-top: 2px solid var(--collegiate-gold);
    border-right: 2px solid var(--collegiate-gold);
    opacity: 0.4;
    pointer-events: none;
}

/* Close button styling */
.btn-close-form {
    position: absolute;
    top: 18px;
    right: 18px;
    font-size: 2rem;
    background: linear-gradient(135deg, rgba(43, 59, 40, 0.08), rgba(43, 59, 40, 0.03));
    border: 2px solid var(--olive-medium);
    color: var(--olive-dark);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 10;
}

.btn-close-form:hover {
    background: var(--olive-dark);
    color: var(--collegiate-gold);
    border-color: var(--collegiate-gold);
    transform: rotate(90deg) scale(1.1);
}

/* Form title styling */
.form-title {
    font-family: var(--font-display);
    font-size: 1.6rem;
    margin-bottom: 8px;
    color: var(--olive-dark);
    text-align: center;
    padding-top: 20px;
    padding-right: 50px;
    letter-spacing: 0.5px;
    line-height: 1.3;
}

.form-subtitle {
    font-size: 0.9rem;
    color: var(--olive-medium);
    margin-bottom: 25px;
    text-align: center;
    padding-right: 50px;
    line-height: 1.4;
}

/* Form internal spacing and borders */
.scrapbook-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 25px 30px 30px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: linear-gradient(135deg, rgba(212, 180, 117, 0.04), transparent);
    padding: 15px 18px;
    border-radius: 10px;
    border: 1.5px solid rgba(212, 180, 117, 0.25);
    transition: all 0.3s ease;
}

.form-group:focus-within {
    border-color: var(--collegiate-gold);
    box-shadow: 0 0 0 3px rgba(212, 180, 117, 0.15);
    background: linear-gradient(135deg, rgba(212, 180, 117, 0.08), transparent);
}

.form-group label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--olive-dark);
    letter-spacing: 0.8px;
    padding-left: 5px;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 14px 16px;
    border-radius: 8px;
    border: 2px solid rgba(46, 68, 54, 0.3);
    background-color: rgba(245, 242, 235, 0.6);
    outline: none;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    color: var(--olive-dark);
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--collegiate-gold);
    background-color: rgba(253, 252, 247, 0.9);
    box-shadow: 0 0 0 3px rgba(212, 180, 117, 0.12);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(46, 68, 54, 0.45);
    font-style: italic;
}

/* Form row spacing */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* Submit button enhanced styling */
.btn-submit-yearbook {
    margin-top: 10px;
    padding: 16px 30px;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, var(--olive-dark), #2a4030);
    color: var(--collegiate-gold);
    border: 2px solid var(--collegiate-gold);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 15px rgba(19, 32, 22, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-submit-yearbook::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(252, 232, 178, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn-submit-yearbook:hover::before {
    left: 100%;
}

.btn-submit-yearbook:hover {
    background: linear-gradient(135deg, #2a4030, var(--olive-dark));
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(19, 32, 22, 0.4);
}

.btn-submit-yearbook:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Upload area enhanced */
.custom-file-upload {
    border: 2.5px dashed var(--collegiate-gold);
    padding: 25px;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    background: linear-gradient(135deg, rgba(212, 180, 117, 0.06), rgba(245, 242, 235, 0.3));
    position: relative;
    transition: all 0.3s ease;
}

.custom-file-upload:hover {
    border-color: var(--olive-dark);
    background: linear-gradient(135deg, rgba(212, 180, 117, 0.12), rgba(245, 242, 235, 0.5));
    transform: scale(1.01);
}

.upload-inner svg {
    color: var(--collegiate-gold);
    width: 32px;
    height: 32px;
}

/* Upload preview container */
.upload-preview-container {
    margin-top: 15px;
    border: 2px solid var(--collegiate-gold);
    padding: 8px;
    background-color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: center;
    border-radius: 8px;
}

.upload-preview-container img {
    max-width: 160px;
    max-height: 160px;
    object-fit: cover;
    border-radius: 4px;
}

/* Upload loader styling */
.upload-loader {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, rgba(212, 180, 117, 0.1), rgba(245, 242, 235, 0.5));
    border: 2px solid var(--collegiate-gold);
    padding: 14px 18px;
    border-radius: 10px;
    color: var(--olive-dark);
    font-size: 0.9rem;
    font-weight: 600;
}

.spinner {
    width: 22px;
    height: 22px;
    border: 3px solid rgba(212, 180, 117, 0.3);
    border-top-color: var(--olive-dark);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.btn-close-form {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 2rem;
    background: none;
    border: none;
    color: var(--olive-dark);
    cursor: pointer;
}

.form-title {
    font-family: var(--font-display);
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.form-subtitle {
    font-size: 0.9rem;
    color: var(--olive-medium);
    margin-bottom: 25px;
}

.scrapbook-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--olive-medium);
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px;
    border-radius: 4px;
    border: 1px solid var(--olive-medium);
    background-color: var(--bg-creme);
    outline: none;
    font-family: var(--font-sans);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--collegiate-gold);
}

/* Premium Header Buttons - Beautifully Rebuilt */
.premium-header-btn {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.9);
    border: 1.5px solid var(--collegiate-gold);
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
}

.premium-header-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transition: all 0.6s ease;
}

.premium-header-btn:hover::before {
    left: 100%;
}

.premium-header-btn:hover {
    background-color: var(--collegiate-gold);
    color: var(--olive-dark) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 180, 117, 0.4);
}

.premium-header-btn .btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s;
}

.premium-header-btn:hover .btn-icon {
    transform: rotate(15deg) scale(1.1);
}

/* Specific button modifiers */
.btn-music-player.playing {
    background: var(--collegiate-gold);
    color: var(--olive-dark) !important;
    animation: gentlePulse 2s infinite ease-in-out;
}

@keyframes gentlePulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.03);
        box-shadow: 0 0 15px rgba(212, 180, 117, 0.6);
    }
}

/* Search Bar in Header */
.header-nav-menu .search-box-wrapper {
    position: relative;
    width: 180px;
}

.header-nav-menu .search-box-wrapper input {
    width: 100%;
    padding: 6px 10px 6px 30px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 0.85rem;
    outline: none;
    transition: all 0.3s;
}

.header-nav-menu .search-box-wrapper input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.header-nav-menu .search-box-wrapper input:focus {
    border-color: var(--collegiate-gold);
    background-color: rgba(255, 255, 255, 0.15);
}

.header-nav-menu .search-box-wrapper .search-icon {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.5);
}

/* Layout Grid below Header */
.workspace-layout {
    display: flex;
    max-width: 1850px;
    margin: 0 auto;
    width: 100%;
    padding: 30px 40px;
    gap: 40px;
    flex-grow: 1;
    align-items: stretch;
    /* Stretch children vertically */
}

.album-workspace {
    flex: 1;
    /* VERY IMPORTANT: Forces the scrapbook container to fill the remaining screen space */
    display: flex;
    flex-direction: column;
}

.book-container-wrapper {
    display: flex;
    align-items: center;
    width: 100%;
    flex: 1;
}

/* Left Sidebar Filter Card */
.sidebar-filter-card {
    background-color: #f7f4ec;
    /* Warm off-white card */
    width: 250px;
    flex-shrink: 0;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.filter-group {
    margin-bottom: 24px;
}

.filter-group:last-child {
    margin-bottom: 0;
}

.filter-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--olive-medium);
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.custom-select-wrapper select {
    width: 100%;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    background-color: #fcfbfa;
    color: var(--olive-dark);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    outline: none;
    cursor: pointer;
    transition: border 0.3s;
}

.custom-select-wrapper select:focus {
    border-color: var(--collegiate-gold);
}

/* Custom Checkbox Group styling */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checkbox-container {
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 28px;
    cursor: pointer;
    font-size: 0.9rem;
    user-select: none;
    color: var(--olive-medium);
    font-weight: 500;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    height: 18px;
    width: 18px;
    background-color: #fcfbfa;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    transition: all 0.2s;
}

.checkbox-container:hover input~.checkmark {
    border-color: var(--collegiate-gold);
}

.checkbox-container input:checked~.checkmark {
    background-color: #fcfbfa;
    border-color: var(--collegiate-gold);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked~.checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 6px;
    top: 2px;
    width: 4px;
    height: 9px;
    border: solid var(--olive-dark);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Main Content Area */
.main-workspace-area {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.featured-title {
    font-family: var(--font-serif);
    font-size: 2.2rem;
    color: var(--collegiate-gold);
    margin-bottom: 25px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
    text-align: center;
    font-weight: 500;
}

/* Book navigation layout centering PageFlip with Left/Right Buttons */
.book-container-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    gap: 30px;
    position: relative;
}

.nav-arrow-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 1px solid rgba(212, 180, 117, 0.3);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    color: var(--collegiate-gold);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 999999 !important;
}

.nav-arrow-btn:hover {
    background: var(--collegiate-gold);
    color: var(--olive-dark);
    border-color: var(--collegiate-gold);
    transform: scale(1.1);
}

.nav-arrow-btn svg {
    transition: transform 0.2s;
}

.nav-arrow-btn.prev-btn:hover svg {
    transform: translateX(-2px);
}

.nav-arrow-btn.next-btn:hover svg {
    transform: translateX(2px);
}

/* Bottom Thumbnail Carousel Navigation styling */
.thumbnail-carousel-wrapper {
    margin-top: 30px;
    width: 100%;
    max-width: 900px;
    display: flex;
    justify-content: center;
    overflow-x: auto;
    padding: 10px 0;
}

.thumbnail-carousel {
    display: flex;
    gap: 12px;
    padding: 5px;
}

.thumb-spread {
    background-color: #f7f4ec;
    border: 2px solid rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    cursor: pointer;
    padding: 3px;
    transition: all 0.25s;
    width: 70px;
    height: 48px;
    display: flex;
    gap: 2px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.thumb-spread .thumb-page-left,
.thumb-spread .thumb-page-right {
    flex: 1;
    background-color: #fff;
    border-radius: 2px;
    opacity: 0.8;
}

.thumb-spread.active {
    border-color: var(--collegiate-gold);
    transform: scale(1.08);
    box-shadow: 0 0 10px rgba(212, 180, 117, 0.6);
}

.thumb-spread.active .thumb-page-left,
.thumb-spread.active .thumb-page-right {
    opacity: 1;
}

.thumb-spread:hover {
    border-color: rgba(212, 180, 117, 0.5);
}

/* Footer Styling override */
.app-footer-bar {
    background-color: var(--olive-dark);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    width: 100%;
    margin-top: auto;
    z-index: 50;
}

.footer-left {
    display: flex;
    gap: 25px;
}

.footer-left a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s;
}

.footer-left a:hover {
    color: var(--collegiate-gold);
}

.footer-right {
    display: flex;
    gap: 20px;
}

.footer-right a {
    color: rgba(255, 255, 255, 0.6);
    transition: color 0.2s, transform 0.2s;
    display: inline-block;
}

.footer-right a:hover {
    color: var(--collegiate-gold);
    transform: scale(1.1);
}

/* Responsive Customization overrides */
@media (max-width: 768px) {
    .app-header {
        flex-direction: row;
        overflow-x: auto;
        white-space: nowrap;
        padding: 15px 20px;
        justify-content: flex-start;
        gap: 20px;
        -webkit-overflow-scrolling: touch;
    }
    
    .app-header::-webkit-scrollbar {
        display: none; /* Hide scrollbar for a cleaner look */
    }
    
    .header-nav-menu {
        display: flex;
        flex-shrink: 0;
    }
    
    .header-controls {
        flex-shrink: 0;
    }
    
    .header-logo-container {
        flex-shrink: 0;
    }

    .nav-arrow-btn {
        width: 40px;
        height: 40px;
    }
}

/* -------------------------------------------------------------
   Teachers Book 3D Opening Animation & Open Layout Styles
   ------------------------------------------------------------- */

/* Overlay wrapper */
.teachers-book-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(19, 32, 22, 0.94);
    backdrop-filter: blur(15px);
    z-index: 9999999 !important;
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.teachers-book-overlay.open {
    display: flex;
    opacity: 1;
}

.teachers-book-3d-container {
    position: relative;
    width: 95%;
    max-width: 1500px;
    height: 85vh;
    min-height: 700px;
    perspective: 2000px;
}

/* 3D Closed Book style for initial opening animation */
.teachers-book-3d {
    position: absolute;
    width: 450px;
    height: 600px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) rotateY(-20deg) scale(0.7);
    transform-style: preserve-3d;
    transition: transform 1.2s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.4s ease;
    z-index: 100;
    box-shadow: 10px 20px 40px rgba(0, 0, 0, 0.5);
    border-radius: 5px 15px 15px 5px;
}

.teachers-book-3d.opening {
    transform: translate(-50%, -50%) rotateY(0deg) scale(1);
}

.teachers-book-3d.flipped {
    transform: translate(-50%, -50%) rotateY(-180deg) scale(1.1);
    opacity: 0;
    pointer-events: none;
}

/* 3D Book Cover Faces */
.book-cover-front,
.book-cover-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 5px 15px 15px 5px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
}

.book-cover-front {
    background-color: #2b1f10;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100' height='100' filter='url(%23noise)' opacity='0.08'/%3E%3C/svg%3E");
    border: 8px solid var(--collegiate-gold);
    color: var(--collegiate-gold);
    padding: 30px;
    z-index: 2;
    transform: rotateY(0deg);
}

.book-cover-front img {
    width: 90%;
    height: 250px;
    object-fit: cover;
    border: 4px solid var(--collegiate-gold);
    border-radius: 4px;
    margin-bottom: 25px;
    box-shadow: var(--shadow-hard);
}

.book-cover-front .book-title {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 800;
    text-align: center;
    letter-spacing: 2px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

.book-cover-back {
    background-color: #1a1208;
    transform: rotateY(180deg);
    z-index: 1;
}

/* Actual open book layout (Image 2 style) */
.teachers-book-content {
    position: absolute;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
    z-index: 50;
}

.teachers-book-content.visible {
    display: flex;
    opacity: 1;
    transform: scale(1);
}

/* Fixed Back button (Pinned to screen top-right) */
.btn-close-teachers-fixed {
    position: fixed !important;
    top: 20px !important;
    right: 20px !important;
    z-index: 10000000 !important;
    background-color: var(--collegiate-gold) !important;
    color: var(--olive-dark) !important;
    border: none !important;
    padding: 10px 18px !important;
    border-radius: 30px !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    font-weight: 700 !important;
    font-size: 0.9rem !important;
    font-family: var(--font-sans) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4) !important;
    transition: transform 0.2s, background-color 0.2s !important;
}

.btn-close-teachers-fixed:hover {
    transform: scale(1.08) !important;
    background-color: var(--collegiate-gold-hover) !important;
}

/* Back button inside content */
.btn-close-teachers {
    align-self: flex-start;
    background-color: var(--collegiate-gold);
    color: var(--olive-dark);
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    font-weight: 600;
    font-family: var(--font-sans);
    margin-bottom: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s, background-color 0.2s;
}

.btn-close-teachers:hover {
    transform: scale(1.05);
    background-color: var(--collegiate-gold-hover);
}


/* Main notebook structure */
.teachers-notebook-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background-color: var(--paper-white);
    border-radius: 8px;
    flex-grow: 1;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.6);
    border: 10px solid #362912;
    position: relative;
    overflow: hidden;
}

.teachers-notebook-spine {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 12px;
    transform: translateX(-50%);
    background: linear-gradient(90deg, #ccc7bd 0%, #a8a092 50%, #ccc7bd 100%);
    box-shadow: inset 1px 0 3px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

/* Fixed Crease Shadow under content (No X-ray) */
.teachers-crease-shadow {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 60px;
    transform: translateX(-50%);
    background: linear-gradient(to right,
            rgba(0, 0, 0, 0) 0%,
            rgba(0, 0, 0, 0.04) 20%,
            rgba(0, 0, 0, 0.16) 40%,
            rgba(0, 0, 0, 0.24) 50%,
            rgba(0, 0, 0, 0.16) 60%,
            rgba(0, 0, 0, 0.04) 80%,
            rgba(0, 0, 0, 0) 100%);
    pointer-events: none;
    z-index: 2;
    /* Low z-index so content sits above it! */
}

/* Crease shadow under content for students detail book */
.notebook-crease-shadow {
    position: absolute;
    left: 50.4%;
    top: 0;
    bottom: 0;
    width: 60px;
    transform: translateX(-50%);
    background: linear-gradient(to right,
            rgba(0, 0, 0, 0) 0%,
            rgba(0, 0, 0, 0.04) 20%,
            rgba(0, 0, 0, 0.15) 40%,
            rgba(0, 0, 0, 0.22) 50%,
            rgba(0, 0, 0, 0.15) 60%,
            rgba(0, 0, 0, 0.04) 80%,
            rgba(0, 0, 0, 0) 100%);
    pointer-events: none;
    z-index: 2;
    /* Under details but above paper */
}

/* Open Pages */
.teachers-page {
    padding: 30px 40px;
    position: relative;
    background-color: var(--paper-white);
    background-image: linear-gradient(#e6e1d6 1px, transparent 1px);
    background-size: 100% 28px;
    line-height: 28px;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.teachers-left-page {
    border-right: 1px solid rgba(0, 0, 0, 0.15);
    padding-right: 45px;
}

.teachers-right-page {
    border-left: 1px solid rgba(255, 255, 255, 0.9);
    padding-left: 45px;
}

.teachers-page-title {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    color: var(--olive-dark);
    margin-bottom: 20px;
    border-bottom: 2px dashed rgba(212, 180, 117, 0.4);
    padding-bottom: 8px;
    position: relative;
    z-index: 5;
}

/* Grid holding large polaroids on each page */
.teachers-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
    flex-grow: 1;
    position: relative;
    z-index: 5;
    /* Sit above crease shadow */
    padding-right: 8px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Premium scrollbar styles */
.teachers-grid::-webkit-scrollbar {
    width: 6px;
}

.teachers-grid::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.03);
    border-radius: 3px;
}

.teachers-grid::-webkit-scrollbar-thumb {
    background: var(--collegiate-gold-hover);
    border-radius: 3px;
}

/* Teacher polaroid layout */
.teacher-card {
    display: flex;
    align-items: center;
    gap: 15px;
    background: transparent;
    padding: 5px;
    border-radius: 4px;
    transition: transform 0.2s;
    position: relative;
}

.teacher-card:hover {
    transform: scale(1.02);
}

.teacher-polaroid {
    background-color: white;
    padding: 8px 8px 24px 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9e3d9;
    width: 140px;
    flex-shrink: 0;
    position: relative;
    transition: transform 0.3s;
}

.teacher-polaroid img {
    width: 100%;
    height: 125px;
    object-fit: cover;
    border: 1px solid #e1dacb;
    /* Prevent black flash: hold background color while image decodes */
    background-color: #e8e0d0;
    /* GPU-stable composite layer — prevents repaint flash on scroll */
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.teacher-polaroid::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%) rotate(3deg);
    width: 40px;
    height: 15px;
    background-color: rgba(212, 180, 117, 0.3);
}

.teachers-left-page .teacher-card:nth-child(even) .teacher-polaroid {
    transform: rotate(-3deg);
}

.teachers-right-page .teacher-card:nth-child(odd) .teacher-polaroid {
    transform: rotate(3deg);
}

.teacher-info {
    flex-grow: 1;
}

.teacher-name-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.teacher-name {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    color: var(--olive-dark);
    margin-bottom: 2px;
}

.teacher-role {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--collegiate-gold-hover);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.teacher-bio {
    font-family: var(--font-hand);
    font-size: 1.15rem;
    color: #4a4a4a;
    line-height: 1.3;
    font-style: italic;
    max-height: 80px;
    overflow-y: auto;
    padding-right: 4px;
}

/* Admin Controls inside Cards */
.btn-edit-teacher {
    background-color: var(--olive-light);
    color: var(--olive-dark);
    border: 1px solid var(--collegiate-gold);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-edit-teacher:hover {
    background-color: var(--collegiate-gold);
    color: var(--olive-dark);
    transform: scale(1.1);
}

/* X-Ray crease shadow fixes for student album entries & overlays */
.student-scrapbook-entry,
.main-collage,
.page-header-green,
.album-footer-stamp,
.scrapbook-page-layout {
    position: relative;
    z-index: 5;
    /* Make sure these cards sit ABOVE the crease shadow! */
}

/* In student detail notebook: move crease shadow behind text */
.notebook-page {
    position: relative;
    z-index: 5;
}

.notebook-ring-spine {
    z-index: 10;
}

.notebook-tape,
.notebook-polaroid-main,
.university-block,
.notebook-header-info,
.scrapbook-section {
    position: relative;
    z-index: 5;
    /* Higher than paper shadows */
}

input[readonly],
textarea[readonly] {
    background-color: rgba(0, 0, 0, 0.05);
    cursor: not-allowed;
    color: #666;
}

#studentQuote {
    max-height: 120px;
    overflow-y: auto;
    word-wrap: break-word;
    word-break: break-word;
    white-space: pre-wrap;
    padding-right: 5px;
}

/* Mobile flip button fixes */
.nav-arrow-btn {
    touch-action: manipulation !important;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    pointer-events: auto !important;
}


/* SUCCESS CARD VIEW STYLES */
.success-card-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(5px);
    z-index: 99999999 !important;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.success-card-backdrop.open {
    opacity: 1;
}

.success-card-container {
    background: var(--paper-white, #fdfcf7);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    max-width: 480px;
    width: 90%;
    text-align: center;
    border: 3px solid var(--olive-dark, #2b3b28);
    transform: translateY(-40px) scale(0.9);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.success-card-backdrop.open .success-card-container {
    transform: translateY(0) scale(1);
}

.success-card-badge {
    background: var(--collegiate-gold, #d4b475);
    color: var(--olive-dark, #2b3b28);
    font-size: 0.85rem;
    font-weight: 700;
    padding: 6px 15px;
    border-radius: 30px;
    display: inline-block;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.success-card-title {
    font-family: var(--font-serif);
    font-size: 2rem;
    color: var(--olive-dark, #2b3b28);
    margin-bottom: 12px;
}

.success-card-desc {
    font-family: var(--font-sans);
    font-size: 1.05rem;
    color: var(--olive-medium, #4a5a47);
    line-height: 1.6;
    margin-bottom: 30px;
}

.success-card-preview {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(43, 59, 40, 0.05);
    padding: 15px;
    border-radius: 8px;
    border: 1px dashed rgba(212, 180, 117, 0.5);
    text-align: left;
    margin-bottom: 30px;
}

.success-card-preview img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid var(--collegiate-gold, #d4b475);
}

.success-card-preview-info h4 {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    color: var(--olive-dark, #2b3b28);
    margin-bottom: 2px;
}

.success-card-preview-info p {
    font-size: 0.85rem;
    color: var(--collegiate-gold-hover, #b8985c);
    font-weight: 600;
}

.success-card-btn {
    background: var(--olive-dark, #2b3b28);
    color: white;
    border: 2px solid var(--olive-dark, #2b3b28);
    padding: 14px 40px;
    border-radius: 30px;
    font-family: var(--font-sans);
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(43, 59, 40, 0.25);
}

.success-card-btn:hover {
    background: var(--collegiate-gold, #d4b475);
    color: var(--olive-dark, #2b3b28);
    border-color: var(--collegiate-gold, #d4b475);
}

/* 3D MAIL ENVELOPE popup STYLES */
.mail-popup-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    z-index: 30000000 !important;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.4s ease;
    perspective: 1200px;
}

.mail-popup-backdrop.open {
    opacity: 1;
}

.envelope-wrapper {
    position: relative;
    width: 480px;
    height: 320px;
    transform: rotateX(15deg) translateY(0) scale(0.85);
    transform-style: preserve-3d;
    transition: all 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.mail-popup-backdrop.open .envelope-wrapper {
    transform: rotateX(15deg) translateY(0) scale(1);
}

.mail-popup-backdrop.open.slide-letter .envelope-wrapper {
    transform: rotateX(0deg) translateY(80px) scale(1);
}

/* Envelope folds */
.envelope {
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: #ecdab9;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    transform-style: preserve-3d;
    z-index: 2;
}

.envelope::before {
    /* Front diagonal folds (bottom and sides) */
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-left: 240px solid transparent;
    border-right: 240px solid transparent;
    border-bottom: 160px solid #e1ceaa;
    bottom: 0;
    left: 0;
    z-index: 5;
}

.envelope::after {
    /* Side flaps */
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-top: 160px solid transparent;
    border-bottom: 160px solid transparent;
    border-left: 240px solid #d9c5a0;
    top: 0;
    left: 0;
    z-index: 4;
}

.envelope-right-flap {
    position: absolute;
    width: 0;
    height: 0;
    border-top: 160px solid transparent;
    border-bottom: 160px solid transparent;
    border-right: 240px solid #d9c5a0;
    top: 0;
    right: 0;
    z-index: 4;
}

/* Flap at the top that opens up */
.envelope-top-flap {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    border-left: 240px solid transparent;
    border-right: 240px solid transparent;
    border-top: 160px solid #ecdab9;
    transform-origin: top;
    transition: transform 0.5s ease-in-out;
    z-index: 6;
    /* Sits above everything initially */
}

.mail-popup-backdrop.open .envelope-top-flap {
    transform: rotateX(180deg);
    z-index: 1;
    /* Moves behind once opened so letter can slide out */
    border-top-color: #e3d2b0;
}

/* The letter carrying teacher info inside the envelope */
.envelope-letter {
    position: absolute;
    left: 20px;
    right: 20px;
    bottom: 10px;
    height: 290px;
    background: #fdfcf7;
    border-radius: 6px;
    padding: 25px;
    border: 1px solid #ebdcb9;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(0);
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.6s;
    z-index: 3;
    /* Inside the pocket */
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* When envelope opens, slide the letter out beautifully and ENLARGE IT MASSIVELY! */
.mail-popup-backdrop.open.slide-letter .envelope-letter {
    transform: translateY(-160px) translateZ(180px) scale(1.75);
    box-shadow: 0 40px 90px rgba(0, 0, 0, 0.55);
    z-index: 10;
    /* Completely pops out in front of flaps */
}

/* Letter inside layout elements */
.letter-ring-spine {
    display: flex;
    justify-content: space-around;
    border-bottom: 2px dashed rgba(212, 180, 117, 0.4);
    padding-bottom: 8px;
    margin-bottom: 5px;
}

.letter-stamp {
    font-family: var(--font-serif);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(-- collegiate-gold-hover, #b8985c);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.letter-profile {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.letter-polaroid-frame {
    background: white;
    padding: 6px 6px 18px 6px;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid #eee;
    transform: rotate(0deg);
    flex-shrink: 0;
}

.letter-polaroid-frame img {
    width: 110px;
    height: 110px;
    object-fit: cover;
}

.letter-info-details {
    flex-grow: 1;
}

.letter-teacher-name {
    font-family: var(--font-serif);
    font-size: 1.6rem;
    color: var(--olive-dark, #2b3b28);
    margin-bottom: 2px;
}

.letter-teacher-role {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--collegiate-gold, #d4b475);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

/* Letter teacher biography box style */
.letter-teacher-bio {
    font-family: var(--font-hand);
    font-size: 1.25rem;
    color: #444;
    line-height: 1.35;
    font-style: italic;
    background: rgba(212, 180, 117, 0.06);
    padding: 10px;
    border-radius: 4px;
    border-left: 3px solid var(--collegiate-gold, #d4b475);
    max-height: 100px;
    overflow-y: auto;
    padding-right: 5px;
}

.letter-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    color: var(--olive-dark, #2b3b28);
    transition: all 0.2s;
    z-index: 15;
}

.letter-close-btn:hover {
    background: var(--olive-dark, #2b3b28);
    color: white;
}

/* GLASSMORPHIC WATER BUBBLES RISING ANIMATIONS */
.water-bubble-particle {
    position: fixed;
    bottom: -60px;
    z-index: 20000000 !important;
    pointer-events: none;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.65) 0%, rgba(255, 255, 255, 0.15) 60%, rgba(212, 180, 117, 0.35) 100%);
    border: 1.5px solid rgba(255, 255, 255, 0.45);
    border-radius: 50%;
    box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.6), 0 4px 15px rgba(43, 59, 40, 0.15);
    will-change: transform, opacity;
}

@keyframes riseAndSway {
    0% {
        transform: translateY(0) translateX(0) scale(0.7);
        opacity: 0;
    }

    10% {
        opacity: 0.9;
    }

    90% {
        opacity: 0.9;
    }

    100% {
        transform: translateY(-115vh) translateX(var(--swayDistance)) scale(1.2);
        opacity: 0;
    }
}


/* ============================================
   iOS SPECIFIC: Disable Zoom & Pinch-to-Zoom
   ============================================ */

/* Prevent zoom on iOS Safari - applied via body touch-action */
body {
    /* pan-y allows vertical scrolling but prevents pinch-zoom */
    touch-action: pan-y;
    /* Prevent double-tap to zoom on iOS */
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

/* Disable zoom on all interactive elements for iOS */
.student-polaroid-frame,
.album-page,
.notebook-container,
.notebook-modal-content,
.teachers-book-3d-container,
.teacher-polaroid {
    -webkit-touch-callout: default;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Prevent any element from triggering zoom on iOS */
* {
    /* Disable double-tap zoom */
    touch-action: manipulation;
}

/* Specific override for content areas to allow normal scrolling */
.album-workspace,
.scrapbook-album,
.notebook-biodata-overlay,
.teachers-book-content {
    touch-action: pan-y;
}

/* SUBTLE GLIDING BACKGROUND PAPER PLANE */
.background-paper-plane {
    position: fixed;
    top: 0;
    left: 0;
    width: 95px;
    height: 95px;
    pointer-events: none;
    z-index: 999999;
    /* Swoops visually above all pages, menus, and modals */
    opacity: 1;
    /* Beautiful, premium visual presence */
    transform-origin: center center;
    /* Robust rotational centering */
    will-change: transform;
}

.background-paper-plane-trail {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 999998;
    /* Renders just behind the plane */
}

/* PREMIUM CINEMATIC HOT AIR BALLOON OVERLAY Overlay */
.background-hot-air-balloon {
    position: fixed;
    bottom: -50px;
    /* Start partially on-screen so it's instantly visible on load */
    left: 50%;
    margin-left: -130px;
    /* Center horizontally (width 260px / 2) */
    width: 260px;
    /* Massive relative screen size */
    height: 260px;
    pointer-events: none;
    z-index: 1000000;
    /* Swoops visually above all pages, menus, and even paper planes */
    opacity: 1;
    will-change: transform, bottom;
    animation: balloonFloatUp 12s linear infinite;
}

.balloon-svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(4px 8px 12px rgba(0, 0, 0, 0.18));
    animation: balloonSway 3s ease-in-out infinite alternate;
    transform-origin: center bottom;
}

@keyframes balloonFloatUp {
    0% {
        bottom: -350px;
    }

    10% {
        bottom: -350px;
        /* Wait briefly before ascending */
    }

    100% {
        bottom: 120vh;
        /* Float all the way to the top and off screen */
    }
}

@keyframes balloonSway {
    0% {
        transform: translateX(-120px) rotate(-3deg);
    }

    100% {
        transform: translateX(120px) rotate(3deg);
    }
}

/* PREMIUM METALLIC GOLD SHIMMERING TEXT ANIMATIONS */
/* animation driven by JS shimmer engine in app.js */
.premium-animate-text {
    display: inline-block;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    background-size: 300px 100%;
}

.cover-page-title-animate {
    display: inline-block;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    background-size: 300px 100%;
    animation:
        textFadeIn 1.4s cubic-bezier(0.16, 1, 0.3, 1) forwards,
        goldShimmer 8s linear infinite;
}

@keyframes goldShimmer {
    0% {
        background-position: 0% center;
    }

    100% {
        background-position: -200% center;
    }
}

@keyframes textFadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
        filter: blur(8px);
    }

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

/* SMOOTH ORGANIC BREATHING / FLOATING ANIMATION FOR COVER IMAGES */
.collage-main-img-frame img,
.collage-thumb-frame img {
    animation: floatBreathing 8s ease-in-out infinite alternate;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.8s ease-in-out;
}

.collage-main-img-frame img:hover {
    transform: scale(1.05) rotate(1deg) !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3) !important;
}

.collage-thumb-frame img:hover {
    transform: scale(1.06) rotate(-1deg) !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3) !important;
}

@keyframes floatBreathing {
    0% {
        transform: translateY(0) scale(1) rotate(0deg);
    }

    50% {
        transform: translateY(-5px) scale(1.01) rotate(0.4deg);
    }

    100% {
        transform: translateY(0) scale(1) rotate(0deg);
    }
}

/* ============================================
   ABOUT US CARD MODAL DESIGN & ANIMATION
   ============================================ */

.notebook-biodata-overlay.open .about-us-card {
    animation: cardEntrance 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes cardEntrance {
    from {
        transform: scale(0.82) translateY(40px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.about-us-card {
    background: linear-gradient(135deg, #fbf9f4 0%, #f5efe2 100%);
    border: 2px solid var(--collegiate-gold);
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    opacity: 0; /* Animated on open */
}

.about-us-header {
    margin-bottom: 25px;
}

.about-us-badge {
    width: 60px;
    height: 60px;
    background: var(--olive-dark);
    color: var(--collegiate-gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px auto;
    box-shadow: 0 6px 15px rgba(43, 59, 40, 0.25);
    transition: transform 0.3s ease;
}

.about-us-card:hover .about-us-badge {
    transform: scale(1.1) rotate(5deg);
}

.about-us-title {
    font-family: var(--font-display);
    font-size: 2.2rem;
    margin-bottom: 5px;
    font-weight: 800;
}

.about-us-subtitle {
    font-family: var(--font-sans);
    font-size: 0.85rem;
    color: var(--olive-medium);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0;
    font-weight: 600;
}

.about-us-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, var(--collegiate-gold), transparent);
    margin: 20px auto;
    width: 80%;
}

.about-us-body {
    position: relative;
    padding: 0 35px;
    margin-bottom: 35px;
}

.about-us-story {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    line-height: 1.7;
    color: var(--olive-dark);
    font-style: italic;
    text-shadow: 0 1px 1px rgba(255,255,255,0.5);
    max-height: 350px;
    overflow-y: auto;
    padding-right: 10px;
}

/* Custom scrollbar for about-us-story to match the theme */
.about-us-story::-webkit-scrollbar {
    width: 6px;
}
.about-us-story::-webkit-scrollbar-track {
    background: rgba(212, 180, 117, 0.1);
    border-radius: 4px;
}
.about-us-story::-webkit-scrollbar-thumb {
    background: var(--collegiate-gold);
    border-radius: 4px;
}

.quote-mark {
    font-family: var(--font-serif);
    font-size: 4.5rem;
    color: rgba(212, 180, 117, 0.25);
    position: absolute;
    line-height: 1;
    user-select: none;
}

.quote-start {
    top: -25px;
    left: 0;
}

.quote-end {
    bottom: -45px;
    right: 0;
}

.about-us-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 30px;
    margin-bottom: 10px;
}

.feature-item {
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(212, 180, 117, 0.25);
    border-radius: 8px;
    padding: 18px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-soft);
}

.feature-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(43, 59, 40, 0.1);
    border-color: var(--collegiate-gold);
    background: rgba(255, 255, 255, 0.85);
}

.feature-icon {
    font-size: 2rem;
    margin-bottom: 12px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
    transition: transform 0.3s ease;
}

.feature-item:hover .feature-icon {
    transform: scale(1.2);
}

.feature-text h5 {
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--olive-dark);
    margin: 0 0 5px 0;
}

.feature-text p {
    font-family: var(--font-sans);
    font-size: 0.72rem;
    line-height: 1.3;
    color: var(--olive-medium);
    margin: 0;
}

.admin-edit-wrapper {
    border-top: 1px dashed rgba(212, 180, 117, 0.5);
    margin-top: 35px;
    padding-top: 25px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    text-align: left;
}

.admin-label {
    font-family: var(--font-sans);
    font-weight: bold;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--olive-medium);
}

.admin-textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--collegiate-gold);
    border-radius: 6px;
    background: #fff;
    color: var(--olive-dark);
    font-family: var(--font-serif);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.admin-textarea:focus {
    border-color: var(--collegiate-gold-hover);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05), 0 0 8px rgba(212, 180, 117, 0.3);
}

.admin-save-btn {
    align-self: center;
    padding: 10px 30px;
    font-weight: 600;
}

/* ============================================
   SEARCH SUGGESTIONS DROPDOWN STYLING
   ============================================ */

.search-dropdown {
    position: fixed; /* Escape overflow-x clipping of scrollable header */
    background-color: #fcfbfa;
    border: 1px solid var(--collegiate-gold);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    max-height: 280px;
    overflow-y: auto;
    z-index: 10000000 !important; /* Above everything */
    display: none;
    flex-direction: column;
    padding: 6px 0;
}

.search-dropdown::-webkit-scrollbar {
    width: 6px;
}

.search-dropdown::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.02);
    border-radius: 3px;
}

.search-dropdown::-webkit-scrollbar-thumb {
    background: var(--collegiate-gold-hover);
    border-radius: 3px;
}

.search-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 15px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.search-dropdown-item:hover {
    background-color: rgba(212, 180, 117, 0.15);
}

.search-dropdown-thumb {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid var(--collegiate-gold);
    flex-shrink: 0;
}

.search-dropdown-info {
    display: flex;
    flex-direction: column;
    text-align: left;
    min-width: 0;
}

.search-dropdown-name {
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--olive-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-dropdown-major {
    font-family: var(--font-sans);
    font-size: 0.70rem;
    color: var(--olive-medium);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-dropdown-no-results {
    padding: 15px;
    font-family: var(--font-serif);
    font-style: italic;
    color: var(--olive-medium);
    font-size: 0.9rem;
    text-align: center;
}

/* Edit Music Link Button */
.edit-music-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--collegiate-gold);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    flex-shrink: 0;
    outline: none;
    padding: 0;
}

.edit-music-btn:hover {
    background: var(--collegiate-gold);
    color: var(--olive-dark);
    border-color: var(--collegiate-gold);
    transform: scale(1.1);
}

.edit-music-btn svg {
    transition: transform 0.2s;
}

.edit-music-btn:hover svg {
    transform: rotate(15deg);
}

/* Animated Scribble Doodles */
.doodle-wrapper {
    position: absolute;
    width: 90px;
    height: 90px;
    pointer-events: none;
    z-index: 1;
    opacity: 0.85;
    filter: drop-shadow(2px 3px 2px rgba(0,0,0,0.15));
}

.doodle {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.doodle-path {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    animation: drawDoodle 1.5s ease-out forwards;
    animation-delay: var(--anim-delay, 0s);
}

@keyframes drawDoodle {
    to {
        stroke-dashoffset: 0;
    }
}

/* Animated Balloons */
.balloon-element {
    position: fixed;
    bottom: -150px;
    z-index: 999999999 !important;
    pointer-events: none;
    width: 60px;
    height: 120px;
    filter: drop-shadow(0px 10px 15px rgba(0,0,0,0.3));
    animation: floatUp 4s ease-in forwards;
    animation-delay: var(--delay, 0s);
    transform-origin: bottom center;
}

.balloon-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

@keyframes floatUp {
    0% {
        transform: translateY(150px) translateX(0) scale(var(--scale, 1)) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    100% {
        transform: translateY(-120vh) translateX(var(--drift, 0)) scale(var(--scale, 1)) rotate(var(--rot, 0deg));
        opacity: 1;
    }
}

/* --- Group Photos Modal Styling --- */
.group-photo-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    z-index: 3000000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 50px;
    overflow-y: auto;
    overflow-x: hidden;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
    background-image: url('assets/images/brick_wall.png');
    background-size: 600px;
    background-repeat: repeat;
    background-attachment: local;
}

.group-photo-overlay.open {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.group-photo-overlay.closing {
    opacity: 0;
    transform: scale(1.05);
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.brick-wall-bg {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 1; /* Above background, behind frames */
}

/* Spray Paint & Graffiti Stencil Animation */
.spray-paint-header-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 40px;
    z-index: 5;
}

.spray-stencil-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%;
    height: 120%;
    background: radial-gradient(ellipse at center, rgba(202, 138, 14, 0.35) 0%, rgba(202, 138, 14, 0.1) 45%, transparent 70%);
    pointer-events: none;
    filter: blur(15px);
    opacity: 0;
    animation: sprayMistFade 1.2s ease-out 0.4s forwards;
}

.spray-graffiti-title {
    font-family: var(--font-display), 'Cinzel', serif;
    font-size: 4.2rem;
    font-weight: 800;
    color: #fff9e6;
    letter-spacing: 5px;
    text-transform: uppercase;
    position: relative;
    margin: 0;
    text-shadow: 
        3px 3px 0px rgba(24, 10, 5, 0.95),
        -2px -2px 0px rgba(24, 10, 5, 0.8),
        0 0 15px rgba(202, 138, 14, 0.8),
        0 0 35px rgba(202, 138, 14, 0.5);
    background: linear-gradient(180deg, #fffcf0 0%, #ebd185 60%, #ca8a0e 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 8px 12px rgba(0,0,0,0.8));
    animation: sprayPaintReveal 1.4s cubic-bezier(0.215, 0.61, 0.355, 1) forwards;
}

/* Realistic Spray Paint Drips */
.spray-drip {
    position: absolute;
    width: 4px;
    background: linear-gradient(180deg, #ca8a0e 0%, #80470d 100%);
    border-radius: 2px;
    opacity: 0;
    box-shadow: 0 0 6px rgba(0,0,0,0.8);
    pointer-events: none;
}

.spray-drip.drip-1 {
    left: 18%;
    top: 85%;
    height: 35px;
    animation: sprayDripAnim 2.2s ease-out 0.8s forwards;
}

.spray-drip.drip-2 {
    left: 52%;
    top: 88%;
    height: 48px;
    width: 5px;
    animation: sprayDripAnim 2.5s ease-out 1s forwards;
}

.spray-drip.drip-3 {
    right: 22%;
    top: 84%;
    height: 30px;
    animation: sprayDripAnim 2s ease-out 1.2s forwards;
}

/* Spray Splatter Dots */
.spray-splatter {
    position: absolute;
    background: rgba(202, 138, 14, 0.85);
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
    filter: drop-shadow(1px 1px 2px rgba(0,0,0,0.9));
}

.spray-splatter.splatter-1 {
    top: 15%;
    left: -20px;
    width: 12px;
    height: 12px;
    box-shadow: 18px -10px 0 2px rgba(202,138,14,0.6), -12px 15px 0 1px rgba(202,138,14,0.4);
    animation: sprayPop 0.4s ease-out 0.6s forwards;
}

.spray-splatter.splatter-2 {
    bottom: -15px;
    right: -15px;
    width: 14px;
    height: 14px;
    box-shadow: -15px 12px 0 3px rgba(202,138,14,0.7), 20px -8px 0 1px rgba(202,138,14,0.5);
    animation: sprayPop 0.4s ease-out 0.9s forwards;
}

.spray-splatter.splatter-3 {
    top: -10px;
    right: 30%;
    width: 8px;
    height: 8px;
    box-shadow: 25px 10px 0 2px rgba(202,138,14,0.5);
    animation: sprayPop 0.4s ease-out 1.1s forwards;
}

@keyframes sprayMistFade {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.6); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
    100% { opacity: 0.85; transform: translate(-50%, -50%) scale(1); }
}

@keyframes sprayPaintReveal {
    0% {
        opacity: 0;
        clip-path: inset(0 100% 0 0);
        filter: blur(10px) drop-shadow(0 0 0 transparent);
    }
    50% {
        opacity: 0.9;
        filter: blur(2px) drop-shadow(0 0 15px rgba(202, 138, 14, 0.8));
    }
    100% {
        opacity: 1;
        clip-path: inset(0 0 0 0);
        filter: blur(0px) drop-shadow(0 8px 12px rgba(0,0,0,0.8));
    }
}

@keyframes sprayDripAnim {
    0% { height: 0px; opacity: 0; }
    30% { opacity: 1; }
    100% { opacity: 0.9; }
}

@keyframes sprayPop {
    0% { opacity: 0; transform: scale(0); }
    70% { opacity: 1; transform: scale(1.3); }
    100% { opacity: 0.85; transform: scale(1); }
}

/* Dynamic Graffiti Murals on Brick Wall */
.graffiti-decal-right {
    position: absolute;
    top: -50px;
    right: -130px;
    transform: rotate(6deg);
    width: 290px;
    height: 270px;
    pointer-events: none;
    z-index: 10;
    filter: drop-shadow(4px 8px 15px rgba(0,0,0,0.9));
}

.graffiti-decal-left {
    position: absolute;
    top: -50px;
    left: -130px;
    transform: rotate(-6deg);
    width: 290px;
    height: 270px;
    pointer-events: none;
    z-index: 10;
    filter: drop-shadow(4px 8px 15px rgba(0,0,0,0.9));
}

.graffiti-svg-mural {
    width: 100%;
    height: 100%;
    overflow: visible;
}

/* Spray Paint Drawing Stroke Animation */
.spray-draw-path {
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    animation: sprayDrawStroke 2s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.3s forwards;
}

/* Drip Animation */
.spray-drip-path {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
}

.drip-delay-1 { animation: sprayDrawStroke 1.5s ease-out 1.2s forwards; }
.drip-delay-2 { animation: sprayDrawStroke 1.8s ease-out 1.4s forwards; }
.drip-delay-3 { animation: sprayDrawStroke 1.4s ease-out 1.6s forwards; }

/* Floating Stars & Particles */
.spray-star-float {
    animation: sprayStarFloat 3s ease-in-out infinite alternate;
}

.delay-star {
    animation-delay: 1.5s;
}

.spray-pulse-aura {
    animation: sprayAuraPulse 4s ease-in-out infinite alternate;
}

@keyframes sprayDrawStroke {
    to { stroke-dashoffset: 0; }
}

@keyframes sprayStarFloat {
    0% { transform: translateY(0px) rotate(0deg) scale(0.9); }
    100% { transform: translateY(-8px) rotate(12deg) scale(1.1); }
}

@keyframes sprayAuraPulse {
    0% { opacity: 0.15; transform: scale(0.95); }
    100% { opacity: 0.4; transform: scale(1.08); }
}

@media (max-width: 1400px) {
    .graffiti-decal-right {
        right: -80px;
        top: -60px;
        width: 240px;
        height: 220px;
    }
    .graffiti-decal-left {
        left: -80px;
        top: -60px;
        width: 240px;
        height: 220px;
    }
}

@media (max-width: 992px) {
    .frames-container .hanging-frame {
        width: 92vw !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        align-self: center !important;
    }
    .graffiti-decal-right {
        right: -20px;
        top: -90px;
        transform: none;
        width: 180px;
        height: 160px;
    }
    .graffiti-decal-left {
        left: -20px;
        top: -90px;
        transform: none;
        width: 180px;
        height: 160px;
    }
}

.frames-container {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 120px;
    padding: 40px 40px 180px 40px;
    max-width: 100%;
    width: 100%;
    position: relative;
    z-index: 5;
}

.frames-container .hanging-frame {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 82vw;
    max-width: 1250px;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    /* GPU-stable: prevents black flash on scroll */
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

.frames-container .hanging-frame img {
    background: transparent !important;
}


/* --- User Profile Full Name Text Customization & Animated Styles --- */
/* NOTE: animation is driven by JS requestAnimationFrame engine in app.js */

[class*="name-anim-"], .premium-animate-text {
    display: inline-block !important;
    position: relative !important;
    /* NO animation property here — JS engine drives backgroundPositionX */
    -webkit-background-clip: text !important;
    background-clip: text !important;
    color: transparent !important;
    -webkit-text-fill-color: transparent !important;
    background-size: 300px 100% !important;
}

/* Per-class filter glow effects only (no animation, no background — JS sets those) */
.name-anim-shimmer-gold, .premium-animate-text {
    filter: drop-shadow(0 2px 8px rgba(202, 138, 14, 0.4));
}

.name-anim-neon-cyber {
    filter: drop-shadow(0 0 10px rgba(0, 242, 254, 0.6));
}

.name-anim-sunset-flare {
    filter: drop-shadow(0 2px 10px rgba(255, 78, 80, 0.5));
}

.name-anim-rainbow-holo {
    filter: drop-shadow(0 2px 8px rgba(255, 255, 255, 0.4));
    background-size: 400px 100% !important;
}

.name-anim-royal-amethyst {
    filter: drop-shadow(0 2px 10px rgba(74, 0, 224, 0.5));
}

.name-anim-emerald-matrix {
    filter: drop-shadow(0 0 10px rgba(56, 239, 125, 0.6));
}



.frames-container .hanging-frame:nth-child(1) {
    transform: rotate(-1.5deg);
    align-self: flex-start;
    margin-left: 2%;
}

.frames-container .hanging-frame:nth-child(2) {
    transform: rotate(2deg);
    align-self: flex-end;
    margin-right: 2%;
}

.frames-container .hanging-frame:nth-child(3) {
    transform: rotate(-1deg);
    align-self: flex-start;
    margin-left: 5%;
}

.frames-container .hanging-frame:nth-child(1):hover {
    transform: translateY(-15px) rotate(0deg) scale(1.02);
}

.frames-container .hanging-frame:nth-child(2):hover {
    transform: translateY(-15px) rotate(0deg) scale(1.02);
}

.frames-container .hanging-frame:nth-child(3):hover {
    transform: translateY(-15px) rotate(0deg) scale(1.02);
}

.nail-string {
    position: relative;
    width: 2px;
    height: 90px;
    background: transparent;
}

.nail-string::before {
    content: '';
    position: absolute;
    top: -12px;
    left: -6px;
    width: 14px;
    height: 14px;
    background: #111;
    border-radius: 50%;
    box-shadow: 2px 2px 4px rgba(0,0,0,0.6);
}

.nail-string::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100px;
    width: 200px;
    height: 90px;
    border: 3px solid rgba(255,255,255,0.65);
    border-bottom: none;
    border-radius: 100px 100px 0 0;
    z-index: -1;
}

.wooden-frame {
    position: relative;
    background: #5c3a21; /* slightly lighter wood */
    border: 18px solid #3d2314; /* dark wood border */
    border-radius: 6px;
    padding: 12px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.8), inset 0 0 12px rgba(0,0,0,0.9);
    width: 100%;
}

.wooden-frame img {
    width: 100%;
    height: auto;
    aspect-ratio: 21 / 9;
    object-fit: cover;
    display: block;
    background: #eee; 
    box-shadow: inset 0 0 8px rgba(0,0,0,0.5);
}

.frame-edit-btn {
    position: absolute;
    bottom: -18px;
    right: -18px;
    background: var(--collegiate-gold);
    color: var(--olive-dark);
    border: 3px solid white;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 5px 10px rgba(0,0,0,0.5);
    transition: transform 0.2s;
    display: none; /* hidden by default, shown via app.js logic */
    z-index: 10;
}

.frame-edit-btn:hover {
    transform: scale(1.1);
    background: var(--collegiate-gold-hover);
}

.frame-delete-btn {
    position: absolute;
    bottom: -18px;
    left: -18px;
    background: #c0392b;
    color: white;
    border: 3px solid white;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 5px 10px rgba(0,0,0,0.5);
    transition: all 0.2s;
    display: none;
    z-index: 10;
}

.frame-delete-btn:hover {
    transform: scale(1.15);
    background: #e74c3c;
    box-shadow: 0 6px 18px rgba(231, 76, 60, 0.5);
}

.close-group-btn {
    background: rgba(0,0,0,0.7);
    color: white;
    top: 25px; right: 25px;
    position: fixed;
    border: 1px solid rgba(255,255,255,0.4);
    z-index: 6010;
}

.close-group-btn:hover {
    background: var(--collegiate-gold);
    color: black;
}

/* --- Admin Group Photo Upload Modal Overlay --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(19, 32, 22, 0.9);
    backdrop-filter: blur(12px);
    z-index: 10000000 !important; /* Above everything else */
    display: none;
    justify-content: center;
    align-items: center;
}

/* --- Admin Group Photo Card --- */
.group-photo-card {
    background: #fff;
    width: 90%;
    max-width: 500px;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    position: relative;
    animation: scaleInModal 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.group-photo-card-header {
    text-align: center;
    margin-bottom: 25px;
}

.group-photo-card-header h2 {
    font-family: var(--font-display);
    color: var(--olive-dark);
    font-size: 2rem;
    margin-bottom: 5px;
}

.group-photo-card-header p {
    color: #666;
    font-size: 0.95rem;
}

.upload-area {
    border: 2px dashed #ccc;
    border-radius: 12px;
    background: #f9f9f9;
    position: relative;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s;
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.upload-area:hover {
    border-color: var(--collegiate-gold);
    background: #fffdf5;
}

.upload-area input[type="file"] {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 10;
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #888;
    pointer-events: none;
}

.upload-placeholder svg {
    margin-bottom: 10px;
    color: var(--collegiate-gold);
}

.upload-placeholder p {
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--olive-dark);
}

.upload-placeholder span {
    font-size: 0.8rem;
}

.upload-preview {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0; left: 0;
}

.upload-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

.change-image-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.upload-area:hover .change-image-overlay {
    opacity: 1;
}

.change-image-overlay span {
    background: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #333;
    pointer-events: none;
}

.group-photo-progress {
    width: 100%;
    height: 8px;
    background: #eee;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--collegiate-gold), #ffd54f);
    width: 0%;
    transition: width 0.3s ease;
}

.upload-status-text {
    text-align: center;
    font-size: 0.9rem;
    margin-bottom: 15px;
    font-weight: 500;
}

.full-width-btn {
    width: 100%;
    padding: 14px;
    font-size: 1.05rem;
    border-radius: 8px;
}

/* --- Close Button (Group Photos Wall) --- */
.close-group-btn {
    position: fixed;
    top: 25px;
    right: 35px;
    z-index: 3000010;
    width: 64px;
    height: 64px;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 2px solid rgba(255,255,255,0.25);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    padding: 0;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(0,0,0,0.5);
}

.close-group-btn svg {
    width: 32px;
    height: 32px;
    stroke: #fff;
    stroke-width: 2.5;
}

.close-group-btn:hover {
    background: rgba(200, 50, 50, 0.8);
    transform: scale(1.15) rotate(90deg);
    border-color: rgba(255,255,255,0.5);
    box-shadow: 0 8px 30px rgba(200, 50, 50, 0.4);
}

/* --- Hide Header on Group Photos Page --- */
body.hide-header .app-header {
    display: none !important;
}

/* --- Prevent Image Downloads --- */
img {
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
    -webkit-touch-callout: none;
    user-select: none;
    -webkit-user-select: none;
}

/* --- Student Counter Widget --- */
.student-counter-widget {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, rgba(212, 180, 117, 0.1), rgba(212, 180, 117, 0.25));
    border: 1px solid var(--collegiate-gold);
    border-radius: 30px;
    padding: 6px 16px;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(212, 180, 117, 0.15), inset 0 2px 4px rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(4px);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
    cursor: default;
    position: relative;
    overflow: hidden;
    margin-left: auto;
    margin-right: 15px;
}

.student-counter-widget:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 20px rgba(212, 180, 117, 0.3), inset 0 2px 5px rgba(255, 255, 255, 0.8);
}

.student-counter-widget::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(transparent, transparent, transparent, var(--collegiate-gold));
    animation: rotateGlow 4s linear infinite;
    z-index: 1;
    opacity: 0.15;
}

.student-counter-content {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.counter-icon {
    font-size: 1.1rem;
    animation: floatIcon 3s ease-in-out infinite;
    position: relative;
    z-index: 2;
}

@keyframes floatIcon {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

.counter-number {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 800;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    position: relative;
    z-index: 2;
}

.counter-label {
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
    position: relative;
    z-index: 2;
}


/* --- Torn Paper Modal --- */
.torn-paper-modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(5px);
    z-index: 60000000 !important;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}
.torn-paper-modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}


.torn-paper-container {
    display: flex;
    flex-direction: column;
    width: 90%;
    max-width: 800px;
    height: auto;
    min-height: 400px;
    max-height: 80vh;
    
    /* Pure CSS Scroll Background */
    background-color: #f4ebd8;
    background-image: 
        radial-gradient(#d5c3aa 1px, transparent 1px),
        linear-gradient(90deg, rgba(200, 180, 150, 0.1) 1px, transparent 1px);
    background-size: 5px 5px, 100% 100%;
    
    /* Paper edge and shadow */
    border-radius: 2px;
    box-shadow: 
        0 20px 50px rgba(0,0,0,0.6),
        inset 0 0 40px rgba(139, 115, 85, 0.15),
        inset 20px 0 20px rgba(0,0,0,0.05),
        inset -20px 0 20px rgba(0,0,0,0.05);
    
    /* Enough padding for text to breathe */
    padding: 50px 80px;
    margin: 0 40px; /* Space for wooden rollers */
    
    position: relative;
    
    /* Initial crushed state */
    transform: scale(0.1) rotate(60deg) skew(20deg);
    filter: blur(6px) brightness(0.7);
    opacity: 0;
    transition: all 0.7s cubic-bezier(0.34, 1.56, 0.4, 1.1);
}

/* Left Wooden Roller */
.torn-paper-container::before {
    content: '';
    position: absolute;
    top: -20px;
    bottom: -20px;
    left: -30px;
    width: 30px;
    background: linear-gradient(to right, #4a2e1b, #8b5a2b, #4a2e1b);
    border-radius: 15px;
    box-shadow: 
        -5px 10px 15px rgba(0,0,0,0.4),
        inset 0 15px 5px rgba(0,0,0,0.4),
        inset 0 -15px 5px rgba(0,0,0,0.4);
    z-index: 3;
}

/* Right Wooden Roller */
.torn-paper-container::after {
    content: '';
    position: absolute;
    top: -20px;
    bottom: -20px;
    right: -30px;
    width: 30px;
    background: linear-gradient(to left, #4a2e1b, #8b5a2b, #4a2e1b);
    border-radius: 15px;
    box-shadow: 
        5px 10px 15px rgba(0,0,0,0.4),
        inset 0 15px 5px rgba(0,0,0,0.4),
        inset 0 -15px 5px rgba(0,0,0,0.4);
    z-index: 3;
}

.torn-paper-modal-overlay.open .torn-paper-container {
    /* Opened state */
    transform: scale(1) rotate(0deg) skew(0deg);
    filter: blur(0px) brightness(1);
    opacity: 1;
}

.btn-close-torn-paper {
    position: absolute;
    top: 2%; right: 5%;
    background: none; border: none;
    font-family: var(--font-sans);
    font-size: 3rem; color: #4a3320;
    cursor: pointer; z-index: 10;
    transition: transform 0.2s, color 0.2s;
}
.btn-close-torn-paper:hover {
    transform: scale(1.2);
    color: #20130a;
}

.torn-paper-content {
    position: relative;
    z-index: 2;
    flex: 1;
    width: 100%;
    overflow-y: auto;
    padding-right: 15px; /* space for custom scrollbar */
}

/* Custom scrollbar for the scroll content */
.torn-paper-content::-webkit-scrollbar {
    width: 10px;
}
.torn-paper-content::-webkit-scrollbar-track {
    background: transparent;
}
.torn-paper-content::-webkit-scrollbar-thumb {
    background: rgba(74, 51, 32, 0.3);
    border-radius: 5px;
}
.torn-paper-content::-webkit-scrollbar-thumb:hover {
    background: rgba(74, 51, 32, 0.5);
}

.torn-paper-content p {
    font-family: var(--font-serif);
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.6;
    color: #3b2c1d;
    text-align: center;
    margin: 0;
    white-space: pre-wrap;
    text-shadow: 1px 1px 1px rgba(255,255,255,0.3);
}

/* --- Smart Image Protection Shields --- */
.student-polaroid-frame,
.teacher-polaroid,
.polaroid-inner-shadow,
.wooden-frame {
    position: relative !important;
}

/* Blocks direct click/drag/right-click on student album images */
.student-polaroid-frame::after {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    height: 180px;
    z-index: 15;
    background: transparent;
    pointer-events: auto;
}

/* Blocks direct interactions on teacher mentor card images */
.teacher-polaroid::after {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    height: 125px;
    z-index: 15;
    background: transparent;
    pointer-events: auto;
}

/* Blocks direct interactions on detailed student modal image */
.polaroid-inner-shadow::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 15;
    background: transparent;
    pointer-events: auto;
}

/* Blocks direct interactions on group memories brick-wall images */
.wooden-frame::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 15;
    background: transparent;
    pointer-events: auto;
}

/* Prevent image ghosting on dragging */
img {
    user-select: none;
    -webkit-user-drag: none;
}

/* Transparent overlay protection for full-size photo popups */
#studentFullPhotoOverlay div::after,
#teacherFullPhotoOverlay div::after {
    content: '';
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    bottom: 50px;
    z-index: 15;
    background: transparent;
    pointer-events: auto;
}

#teacherFullPhotoOverlay div::after {
    bottom: 45px;
}

/* --- Forgot Password Styles --- */
.forgot-password-wrapper a {
    font-family: var(--font-sans);
    font-size: 0.8rem;
    color: var(--collegiate-gold-hover, #CA8A0E);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.forgot-password-wrapper a:hover {
    color: var(--olive-dark, #2b3b28) !important;
    text-decoration: underline !important;
}

.forgot-step {
    animation: fadeInStep 0.35s ease forwards;
}

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

.forgot-btn-cancel {
    background: #e6e2d8 !important;
    color: var(--olive-dark, #2b3b28) !important;
}

.forgot-btn-cancel:hover {
    background: #d8d3c7 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.forgot-btn-submit {
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.forgot-btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

#forgotOTP {
    font-weight: bold;
    letter-spacing: 6px !important;
    padding-left: 20px !important;
    text-shadow: 1px 1px 0 rgba(0,0,0,0.05);
}

/* Premium Animated Wavy Bookmark Ribbon inside 1st Page */
.cover-page-bookmark {
    position: absolute;
    top: 0.5cqh; 
    right: -0.5cqw; 
    transform-origin: top center;
    width: 11.4cqw;
    height: 98%; 
    max-height: 940px;
    z-index: 25; 
    filter: drop-shadow(-4px 8px 6px rgba(0,0,0,0.45));
    animation: ribbonSway 4s ease-in-out infinite alternate;
    pointer-events: none;
}

.cover-page-bookmark::before {
    content: '';
    position: absolute;
    top: -0.5cqh;
    left: 50%;
    transform: translateX(-50%);
    width: 6.3cqw;
    height: 1.5cqh;
    background: linear-gradient(to bottom, #3e0000, #7f0000);
    border-radius: 4px;
    box-shadow: 0 3px 5px rgba(0,0,0,0.5);
    z-index: 2;
}

@keyframes ribbonSway {
    0% {
        transform: rotate(-1deg);
    }
    100% {
        transform: rotate(1.5deg);
    }
}

/* Scroll Modal Styles */
.scroll-modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 99999999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.scroll-modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.scroll-modal-container {
    position: relative;
    width: 90%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: translateY(50px) scale(0.9);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.scroll-modal-overlay.open .scroll-modal-container {
    transform: translateY(0) scale(1);
}

.scroll-top-roller, .scroll-bottom-roller {
    width: 105%;
    height: 40px;
    background: linear-gradient(to bottom, #8b5a2b, #654321, #4a3018, #654321, #8b5a2b);
    border-radius: 20px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5), inset 0 0 10px rgba(0,0,0,0.8);
    position: relative;
    z-index: 2;
}
.scroll-top-roller::before, .scroll-top-roller::after,
.scroll-bottom-roller::before, .scroll-bottom-roller::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 25px;
    height: 50px;
    background: linear-gradient(to right, #d4af37, #aa7c11, #d4af37);
    border-radius: 5px;
    box-shadow: 0 5px 10px rgba(0,0,0,0.6);
}
.scroll-top-roller::before, .scroll-bottom-roller::before {
    left: -15px;
}
.scroll-top-roller::after, .scroll-bottom-roller::after {
    right: -15px;
}

.scroll-paper {
    width: 95%;
    max-height: 60vh;
    background: #f4e8d1;
    background-image: 
        radial-gradient(#d3bfa1 1px, transparent 1px),
        linear-gradient(to right, rgba(200, 170, 120, 0.3) 0%, transparent 10%, transparent 90%, rgba(200, 170, 120, 0.3) 100%);
    background-size: 100% 100%, 100% 100%;
    box-shadow: inset 0 0 30px rgba(139, 90, 43, 0.4), 0 10px 30px rgba(0,0,0,0.4);
    position: relative;
    z-index: 1;
    margin: -10px 0;
    padding: 40px;
    box-sizing: border-box;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #8b5a2b transparent;
}
.scroll-paper::-webkit-scrollbar {
    width: 6px;
}
.scroll-paper::-webkit-scrollbar-thumb {
    background-color: #8b5a2b;
    border-radius: 3px;
}

.btn-close-scroll {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 2rem;
    color: #5c3a21;
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.2s, color 0.2s;
}
.btn-close-scroll:hover {
    color: #8b0000;
    transform: scale(1.1);
}

.scroll-content-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100px;
}

#scrollModalText {
    font-family: var(--font-serif), serif;
    font-size: 2rem;
    color: #3e2723;
    text-align: center;
    line-height: 1.5;
    font-style: italic;
    text-shadow: 1px 1px 2px rgba(255,255,255,0.5);
    margin: 0;
}

/* ==========================================================================
   PROPORTIONAL VERTICAL SCALING & FITTING (CONTAINER QUERY OVERRIDES)
   Ensures the flip book + all contents fit perfectly within any viewport.
   The album height adapts to fill available space (viewport minus header/title).
   All child elements use container-query-height (cqh) units so they scale
   proportionally with the album — shrinking on smaller screens, growing on
   larger ones, while always staying within bounds.
   ========================================================================== */

/* Constrain the main scrapbook album height to always fit within screen vertically.
   120px accounts for the header (~55px), "Featured Student Stories" title (~40px),
   and wrapper padding (~25px). */
.scrapbook-album {
    height: min(900px, calc(100dvh - 120px)) !important;
    min-height: 480px !important;
}

/* Ensure the layout has border-box and doesn't overflow */
.album-page, .scrapbook-page-layout {
    box-sizing: border-box;
}

/* --- Cover Page Proportional Fitting --- */
.cover-page {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 3.5cqh 5.5cqw !important;
}

.cover-page .page-header-green {
    padding: 1.2cqh 3.2cqw !important;
    margin-bottom: 2cqh !important;
}

.cover-page .page-header-green h2 {
    font-size: min(1.6rem, 3.8cqh) !important;
}

.cover-page .page-badge {
    font-size: min(0.8rem, 1.8cqh) !important;
}

.cover-page .main-collage {
    gap: 1.5cqh !important;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 0;
}

.cover-page .collage-main-img-frame {
    background-color: #ffffff !important;
    padding: 1.2cqh 1.2cqh 2cqh 1.2cqh !important; /* Thick bottom border for polaroid style */
    border-radius: 2px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12) !important;
    border: 1px solid #e8e3d9 !important;
    transform: rotate(-0.5deg) !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    height: 33cqh !important;
    max-height: 33cqh !important;
    box-sizing: border-box !important;
}

.cover-page .collage-img {
    width: 100% !important;
    height: 0 !important;
    flex: 1 1 auto !important;
    object-fit: cover !important;
    border-radius: 2px !important;
    max-height: none !important;
    max-width: none !important;
}

.cover-page .caption-label {
    margin-top: 1cqh !important;
    font-size: min(0.8rem, 1.7cqh) !important;
    text-align: center !important;
    color: var(--olive-medium) !important;
    font-family: var(--font-serif) !important;
    font-style: italic !important;
    line-height: 1.2 !important;
}

.cover-page .collage-subgrid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 1.5cqh !important;
    align-items: stretch !important;
    height: 20cqh !important;
    max-height: 20cqh !important;
    min-height: 0;
}

.cover-page .collage-thumb-frame {
    background-color: #ffffff !important;
    padding: 1cqh !important;
    border-radius: 2px !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1) !important;
    border: 1px solid #e8e3d9 !important;
    transform: rotate(2deg) !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    height: 100% !important;
    min-height: 0 !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}

.cover-page .collage-thumb-frame img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 2px !important;
    max-height: none !important;
    max-width: none !important;
}

.cover-page .scrapbook-quote-block {
    padding: 1.2cqh !important;
    height: 100% !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-sizing: border-box;
}

.cover-page .quote-text {
    font-size: min(0.85rem, 1.9cqh) !important;
    line-height: 1.3 !important;
}

.cover-page .quote-author {
    font-size: min(1.1rem, 2.6cqh) !important;
    margin-top: 0.4cqh !important;
}

.cover-page .album-footer-stamp {
    margin-top: 2cqh !important;
    padding-top: 1cqh !important;
    gap: 2cqw !important;
}

.cover-page .qr-mock svg {
    width: min(60px, 10cqh) !important;
    height: min(60px, 10cqh) !important;
}

.cover-page .stamp-meta p {
    font-size: min(0.8rem, 1.8cqh) !important;
    line-height: 1.3 !important;
}

/* --- Intro Page Proportional Fitting --- */
.intro-page {
    padding: 3.5cqh 5.5cqw !important;
    display: flex;
    flex-direction: column;
    justify-content: space-between !important;
    height: 100%;
    box-sizing: border-box;
}

.intro-page .scrapbook-page-title {
    font-size: min(2.2rem, 5.2cqh) !important;
    margin-top: 0 !important;
    margin-bottom: 2cqh !important;
}

.intro-content-box {
    padding: 2.2cqh !important;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 0;
    max-height: 52cqh;
}

.intro-content-box p.intro-quote {
    font-size: min(1.15rem, 2.5cqh) !important;
    line-height: 1.45 !important;
    margin-bottom: 1.5cqh !important;
}

.intro-content-box p.intro-text {
    font-size: min(0.95rem, 2.1cqh) !important;
    line-height: 1.4 !important;
    margin-bottom: 0.8cqh !important;
}

.intro-content-box p.intro-text:last-child {
    margin-bottom: 0 !important;
}

.intro-page .intro-graphic {
    margin-top: 1.5cqh !important;
}

.intro-page .intro-graphic p {
    font-size: min(1.6rem, 3.8cqh) !important;
}

.intro-page .dancing-character-container {
    margin-top: 1cqh !important;
    height: 18cqh !important;
    max-height: 120px !important;
    display: flex;
    justify-content: center;
    align-items: center;
}

.intro-page .welcome-animation-container {
    margin-top: -1cqh !important;
    height: 14cqh !important;
    max-height: 100px !important;
    display: flex;
    justify-content: center;
    align-items: center;
}

.intro-page .welcome-animation-container lottie-player {
    width: min(280px, 35cqw) !important;
    height: 100% !important;
}

/* ==========================================================================
   MOBILE PROFILE CARD: BIG, WIDE & SCROLLABLE
   On small screens the notebook-biodata overlay should be fullscreen
   and scrollable so users can see everything clearly.
   ========================================================================== */
@media (max-width: 900px) {
    /* Profile card overlay: full screen, scrollable */
    .notebook-biodata-overlay {
        align-items: flex-start !important;
        padding: 10px !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y !important;
    }
    
    /* Allow all children inside the overlay to be scrolled */
    .notebook-biodata-overlay *,
    .notebook-biodata-overlay .notebook-modal-content,
    .notebook-biodata-overlay .notebook-container,
    .notebook-biodata-overlay .notebook-page {
        touch-action: pan-y !important;
    }
    
    .notebook-modal-content {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
    }
    
    /* Stack notebook pages vertically on mobile */
    .notebook-container {
        display: flex !important;
        flex-direction: column !important;
        grid-template-columns: unset !important;
        min-height: auto !important;
        height: auto !important;
        border-width: 5px !important;
    }
    
    /* Hide the ring spine on mobile vertical layout */
    .notebook-ring-spine {
        display: none !important;
    }
    
    /* Hide crease shadow on mobile */
    .notebook-crease-shadow {
        display: none !important;
    }
    
    /* Left page: full width, generous sizing */
    .notebook-left-page {
        border-right: none !important;
        border-bottom: 2px solid #ccc7bd !important;
        padding: 25px 20px !important;
        min-height: 500px !important;
    }
    
    /* Right page: full width, generous sizing */
    .notebook-right-page {
        border-left: none !important;
        padding: 25px 20px !important;
        min-height: auto !important;
    }
    
    /* Make polaroid image much bigger on mobile */
    .notebook-polaroid-main {
        width: 100% !important;
        margin: 15px 0 !important;
        padding: 12px 12px 30px 12px !important;
    }
    
    .polaroid-inner-shadow {
        height: 350px !important;
    }
    
    .notebook-script-name {
        font-size: 2.2rem !important;
    }
    
    /* Year stamp - repositioned for mobile */
    .year-giant-stamp {
        font-size: 3rem !important;
        top: 10px !important;
        right: 15px !important;
    }
    
    /* Close button positioning for mobile */
    .btn-close-notebook {
        position: absolute !important;
        top: -14px !important;
        right: -14px !important;
        width: 36px !important;
        height: 36px !important;
        z-index: 999999999 !important;
    }
    
    /* Right page name and details - bigger text */
    .student-full-name {
        font-size: clamp(1.2rem, 5vw, 1.8rem) !important;
    }
    
    .hometown-tag {
        font-size: 0.95rem !important;
    }
    
    .demographics-tag {
        font-size: 0.95rem !important;
    }
    
    .notebook-section-title {
        font-size: 0.95rem !important;
    }
    
    .achievement-list {
        font-size: 1rem !important;
    }
    
    .handwritten-quote {
        font-size: 1.5rem !important;
    }
    
    .guestbook-scroller {
        max-height: 250px !important;
    }
    
    .signatures-recycler-view {
        max-height: 200px !important;
    }
    
    /* Profile action buttons: stack if needed */
    .header-action-row {
        flex-wrap: wrap !important;
        gap: 8px !important;
    }
    
    .profile-actions-wrapper {
        flex-shrink: 0 !important;
    }

    /* Scroll Modal Responsive Styling on Mobile */
    .scroll-modal-container {
        width: 96% !important;
        max-width: 96% !important;
        margin: 0 auto !important;
    }
    
    .scroll-paper {
        padding: 24px !important;
        max-height: 75vh !important;
        width: 100% !important;
    }
    
    #scrollModalText {
        font-size: 1.4rem !important; /* Highly readable on phone screens */
        line-height: 1.4 !important;
    }
    
    .scroll-top-roller, .scroll-bottom-roller {
        width: 102% !important;
        height: 30px !important;
    }
    
    .scroll-top-roller::before, .scroll-top-roller::after,
    .scroll-bottom-roller::before, .scroll-bottom-roller::after {
        width: 15px !important;
        height: 35px !important;
    }
    
    .scroll-top-roller::before, .scroll-bottom-roller::before {
        left: -10px !important;
    }
    
    .scroll-top-roller::after, .scroll-bottom-roller::after {
        right: -10px !important;
    }
    
    .btn-close-scroll {
        font-size: 1.6rem !important;
        top: 5px !important;
        right: 10px !important;
    }

    /* Teachers book mobile portrait stacking */
    .teachers-book-overlay {
        align-items: center !important;
        justify-content: center !important;
        padding: 10px !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        touch-action: pan-y !important;
        /* Prevent black flash on scroll repaint */
        background-color: rgba(19, 32, 22, 0.97) !important;
        will-change: scroll-position;
    }
    
    .teachers-book-overlay *,
    .teachers-book-overlay .teachers-book-3d-container,
    .teachers-book-overlay .teachers-notebook-container,
    .teachers-book-overlay .teachers-page {
        touch-action: pan-y !important;
    }
    
    .teachers-book-3d-container {
        width: 100% !important;
        max-width: 100% !important;
        min-height: 100dvh !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        margin: 0 !important;
        /* GPU promote to avoid black flash */
        transform: translateZ(0) !important;
        backface-visibility: hidden !important;
    }

    .teachers-book-content.visible {
        position: relative !important;
        width: 100% !important;
        height: auto !important;
        display: flex !important;
        margin: auto 0 !important;
        overflow: visible !important;
    }

    
    .teachers-notebook-container {
        display: flex !important;
        flex-direction: column !important;
        grid-template-columns: unset !important;
        min-height: auto !important;
        height: auto !important;
        border-width: 5px !important;
        overflow: visible !important;
    }
    
    .teachers-notebook-spine {
        display: none !important;
    }
    
    .teachers-crease-shadow {
        display: none !important;
    }
    
    .teachers-page {
        height: auto !important;
        overflow: visible !important;
        /* Prevent black flash during scroll repaint */
        -webkit-transform: translateZ(0) !important;
        transform: translateZ(0) !important;
    }

    .teachers-left-page {
        border-right: none !important;
        border-bottom: 2px dashed rgba(212, 180, 117, 0.3) !important;
        padding: 25px 20px !important;
        min-height: auto !important;
    }
    
    .teachers-right-page {
        border-left: none !important;
        padding: 25px 20px !important;
        min-height: auto !important;
    }
    
    /* Single scroll: disable inner grid scrolls, let overlay be the ONLY scrollbar */
    .teachers-grid {
        overflow: visible !important;
        max-height: none !important;
        height: auto !important;
    }
    
    /* Add Back button at top visibly */
    .btn-close-teachers {

        padding: 8px 16px !important;
        font-size: 0.8rem !important;
    }

    #closeTeachersBtn {
        position: fixed !important;
        top: 15px !important;
        right: 15px !important;
        z-index: 999999999 !important;
        margin: 0 !important;
    }
    
    #adminAddTeacherBtn {
        position: fixed !important;
        top: 15px !important;
        left: 15px !important;
        z-index: 999999999 !important;
        margin: 0 !important;
    }
    
    .teachers-book-3d {
        transform: translate(-50%, -50%) rotateY(-20deg) scale(0.55) !important;
    }

    .teachers-book-3d.opening {
        transform: translate(-50%, -50%) rotateY(0deg) scale(0.7) !important;
    }

    .teachers-book-3d.flipped {
        transform: translate(-50%, -50%) rotateY(-180deg) scale(0.75) !important;
        opacity: 0 !important;
    }

    .teacher-polaroid {
        width: 100px !important;
        padding: 6px 6px 18px 6px !important;
    }
    
    .teacher-polaroid img {
        height: 85px !important;
    }
    
    .teacher-polaroid::before {
        width: 30px !important;
        height: 12px !important;
        top: -6px !important;
    }

    .teacher-bio {
        font-size: 1.05rem !important;
        max-height: 90px !important;
    }

    /* 3D Envelope Mobile Portrait Styling */
    .envelope-wrapper {
        transform: rotateX(15deg) translateY(0) scale(0.7) !important;
    }
    
    .mail-popup-backdrop.open .envelope-wrapper {
        transform: rotateX(15deg) translateY(0) scale(0.75) !important;
    }
    
    .mail-popup-backdrop.open.slide-letter .envelope-wrapper {
        transform: rotateX(0deg) translateY(60px) scale(0.7) !important;
    }
    
    .mail-popup-backdrop.open.slide-letter .envelope-letter {
        transform: translateY(-135px) translateZ(120px) scale(1.35) !important;
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45) !important;
        padding: 15px !important;
        gap: 8px !important;
        height: 270px !important;
        left: 10px !important;
        right: 10px !important;
    }
    
    .letter-profile {
        gap: 12px !important;
    }
    
    .letter-polaroid-frame {
        padding: 4px 4px 12px 4px !important;
    }
    
    .letter-polaroid-frame img {
        width: 80px !important;
        height: 80px !important;
    }
    
    .letter-teacher-name {
        font-size: 1.1rem !important;
    }
    
    .letter-teacher-role {
        font-size: 0.75rem !important;
    }
    
    .letter-teacher-bio {
        font-size: 0.9rem !important;
        max-height: 95px !important;
    }
}


/* Extra small screens (phones) */
@media (max-width: 500px) {
    .notebook-biodata-overlay {
        padding: 5px !important;
    }
    
    .notebook-container {
        border-width: 4px !important;
        border-radius: 4px !important;
    }
    
    .notebook-left-page {
        padding: 18px 15px !important;
        min-height: 420px !important;
    }
    
    .notebook-right-page {
        padding: 18px 15px !important;
    }
    
    .polaroid-inner-shadow {
        height: 300px !important;
    }
    
    .notebook-polaroid-main {
        padding: 10px 10px 25px 10px !important;
    }
    
    .notebook-script-name {
        font-size: 1.9rem !important;
    }
    
    .student-full-name {
        font-size: clamp(1rem, 5vw, 1.5rem) !important;
    }
    
    .university-block {
        margin-top: 15px !important;
    }
    
    .uni-stamp {
        font-size: 0.95rem !important;
    }
    
    .notebook-tape {
        width: 70px !important;
        height: 20px !important;
    }

    /* Scroll Modal adjustments on very small screens */
    .scroll-paper {
        padding: 16px !important;
        max-height: 80vh !important;
    }
    
    #scrollModalText {
        font-size: 1.2rem !important;
    }
}

/* ==========================================================================
   LANDSCAPE / HORIZONTAL VIEW: FIT FLIPBOOK VERTICALLY
   When in landscape orientation, the flip book must fit entirely inside
   the viewport height. All inner text/images must resize proportionally.
   ========================================================================== */
@media (orientation: landscape) and (max-height: 650px) {
    /* Force album to fit within shorter landscape viewport */
    .scrapbook-album {
        height: calc(100dvh - 80px) !important;
        min-height: 200px !important;
    }
    
    .stf__wrapper, .stf__parent {
        min-height: 200px !important;
    }
    
    /* Reduce workspace padding in landscape */
    .workspace-layout {
        padding: 8px 15px !important;
        gap: 10px !important;
    }
    
    /* Reduce title size */
    .featured-title {
        font-size: 1.3rem !important;
        margin-bottom: 8px !important;
    }
    
    /* Album wrapper: tighter padding */
    .album-wrapper {
        padding: 5px 0 !important;
    }
    
    /* Page content: tighter padding */
    .album-page {
        padding: 2cqh 3cqw !important;
    }
    
    /* Student entries must compress in landscape */
    .scrapbook-page-layout {
        gap: 3cqh !important;
        padding: 0.5cqh 0 !important;
    }
    
    .student-scrapbook-entry {
        gap: 2cqw !important;
    }
    
    .student-name {
        font-size: min(1.2rem, 4cqh) !important;
    }
    
    .student-major {
        font-size: min(0.75rem, 2.2cqh) !important;
    }
    
    .student-quote {
        font-size: min(0.75rem, 2cqh) !important;
        -webkit-line-clamp: 2 !important;
    }
    
    .student-polaroid-frame {
        padding: 0.6cqh 0.6cqh 2cqh 0.6cqh !important;
    }
    
    /* Intro page adjustments */
    .intro-page .scrapbook-page-title {
        font-size: min(1.4rem, 4cqh) !important;
        margin-bottom: 1cqh !important;
    }
    
    .intro-content-box {
        padding: 1.5cqh !important;
    }
    
    .intro-content-box p.intro-quote {
        font-size: min(0.85rem, 2cqh) !important;
    }
    
    .intro-content-box p.intro-text {
        font-size: min(0.8rem, 1.8cqh) !important;
    }
    
    .dancing-character-container {
        height: 12cqh !important;
        max-height: 80px !important;
    }
    
    .welcome-animation-container {
        height: 10cqh !important;
        max-height: 70px !important;
    }
    
    /* Cover page adjustments for landscape */
    .cover-page .page-header-green {
        padding: 0.8cqh 2.5cqw !important;
        margin-bottom: 1cqh !important;
    }
    
    .cover-page .page-header-green h2 {
        font-size: min(1.2rem, 3cqh) !important;
    }
    
    .cover-page .collage-main-img-frame {
        height: 28cqh !important;
        max-height: 28cqh !important;
    }
    
    .cover-page .collage-subgrid {
        height: 18cqh !important;
        max-height: 18cqh !important;
    }
    
    .cover-page .album-footer-stamp {
        margin-top: 1cqh !important;
        padding-top: 0.5cqh !important;
    }
    
    .cover-page .stamp-meta p {
        font-size: min(0.65rem, 1.4cqh) !important;
    }
    
    /* Nav arrows - smaller in landscape */
    .nav-arrow-btn {
        width: 35px !important;
        height: 35px !important;
    }
    
    /* Header - smaller in landscape */
    .app-header {
        padding: 8px 20px !important;
    }
}

/* Landscape on smaller screens (mobile phones) */
@media (orientation: landscape) and (max-height: 500px) {
    .scrapbook-album {
        height: calc(100dvh - 55px) !important;
        min-height: 180px !important;
    }
    
    .stf__wrapper, .stf__parent {
        min-height: 180px !important;
    }
    
    .featured-title {
        font-size: 1rem !important;
        margin-bottom: 2px !important;
        margin-top: 2px !important;
    }
    
    .album-wrapper {
        padding: 0 !important;
    }
    
    .workspace-layout {
        padding: 2px 10px !important;
        gap: 2px !important;
    }
    
    .app-header {
        padding: 4px 15px !important;
        height: 32px !important;
        display: flex;
        align-items: center;
    }
    
    .header-logo-container .main-title {
        font-size: 1rem !important;
    }
}

/* ==========================================================================
   FLIPBOOK ANTI-COLLAPSE SAFEGUARDS
   Ensure the flipbook never collapses to 0 height or becomes invisible.
   ========================================================================== */
.scrapbook-album {
    min-height: 300px;
}

/* Ensure the StPageFlip wrapper never collapses */
.stf__wrapper {
    min-height: 300px !important;
}

.stf__parent {
    min-height: 300px !important;
}

/* Ensure the album page content is always visible */
.album-page {
    min-height: 0;
    overflow: hidden;
}

/* On very small landscape views, ensure the book-container-wrapper fits */
@media (orientation: landscape) {
    .book-container-wrapper {
        max-height: calc(100dvh - 100px) !important;
    }
    
    .main-workspace-area {
        overflow: hidden;
    }
}

/* Mobile/Tablet Landscape Profile Card: compact side-by-side layout fitting screen vertically */
@media (orientation: landscape) and (max-height: 550px) {
    .notebook-biodata-overlay {
        align-items: center !important;
        padding: 5px !important;
        overflow-y: auto !important;
    }
    
    .notebook-modal-content {
        width: 96% !important;
        max-width: 780px !important;
        height: calc(100dvh - 20px) !important;
        margin: auto !important;
    }
    
    .notebook-container {
        display: grid !important;
        grid-template-columns: 1.15fr 1fr !important;
        flex-direction: unset !important;
        height: 100% !important;
        min-height: unset !important;
        border-width: 4px !important;
    }
    
    .notebook-ring-spine {
        display: block !important;
        left: 52.4% !important;
        top: 3% !important;
        bottom: 3% !important;
        width: 15px !important;
        background: repeating-linear-gradient(180deg, #dcd7cd 0px, #dcd7cd 8px, #8c8375 10px, #8c8375 12px) !important;
    }
    
    .notebook-crease-shadow {
        display: block !important;
    }
    
    .notebook-left-page, .notebook-right-page {
        padding: 10px 14px !important;
        min-height: unset !important;
        height: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
        box-sizing: border-box !important;
    }
    
    .notebook-left-page {
        border-right: 1px solid #ccc7bd !important;
        border-bottom: none !important;
    }
    
    .notebook-right-page {
        border-left: 1px solid #ccc7bd !important;
    }
    
    .notebook-polaroid-main {
        width: 75% !important;
        margin: 2px auto !important;
        padding: 6px 6px 14px 6px !important;
    }
    
    .polaroid-inner-shadow {
        height: min(150px, 42dvh) !important;
    }
    
    .notebook-tape {
        width: 50px !important;
        height: 15px !important;
        top: -6px !important;
    }
    
    .year-giant-stamp {
        font-size: 1.6rem !important;
        top: 5px !important;
        right: 10px !important;
    }
    
    .notebook-script-name {
        font-size: 1.2rem !important;
        margin-top: 4px !important;
    }
    
    /* Right Page Details */
    .student-full-name {
        font-size: 1.1rem !important;
        line-height: 1.2 !important;
    }
    
    .hometown-tag {
        font-size: 0.75rem !important;
        margin-bottom: 2px !important;
    }
    
    .demographics-tag {
        font-size: 0.75rem !important;
        margin-top: 1px !important;
        padding-bottom: 2px !important;
        border-bottom: 1px dashed rgba(43,59,40,0.2) !important;
    }
    
    .notebook-section-title {
        font-size: 0.75rem !important;
        margin-top: 3px !important;
        margin-bottom: 1px !important;
    }
    
    .achievement-list {
        font-size: 0.75rem !important;
        margin-bottom: 2px !important;
    }
    
    .achievement-list li {
        margin-bottom: 1px !important;
    }
    
    .handwritten-quote {
        font-size: 0.95rem !important;
        margin: 2px 0 !important;
        line-height: 1.2 !important;
    }
    
    .guestbook-scroller, .signatures-recycler-view {
        max-height: 45px !important;
        margin-top: 1px !important;
    }

    #studentQuote {
        max-height: 50px !important;
        overflow-y: auto !important;
    }

    .achievement-list {
        max-height: 35px !important;
        overflow-y: auto !important;
        font-size: 0.75rem !important;
        margin-bottom: 2px !important;
    }
    
    .achievement-list li {
        margin-bottom: 1px !important;
    }

    .profile-actions-wrapper button,
    .profile-actions-wrapper .btn-primary,
    .profile-actions-wrapper .btn-delete {
        padding: 4px 8px !important;
        font-size: 0.7rem !important;
    }

    .btn-close-notebook {
        position: absolute !important;
        top: -12px !important;
        right: -12px !important;
        width: 32px !important;
        height: 32px !important;
    }

    .university-block {
        margin-top: 4px !important;
        padding-top: 4px !important;
        border-top-width: 1px !important;
    }
    
    .uni-stamp {
        font-size: 0.8rem !important;
        letter-spacing: 1px !important;
    }
    
    .degree-stamp {
        font-size: 0.65rem !important;
        margin-top: 1px !important;
    }

    /* Teachers book mobile landscape styling */
    .teachers-book-overlay {
        align-items: center !important;
        padding: 5px !important;
        overflow-y: auto !important;
    }
    
    .teachers-book-3d-container {
        width: 96% !important;
        max-width: 900px !important;
        height: calc(100dvh - 20px) !important;
        min-height: unset !important;
        margin: auto !important;
    }
    
    .teachers-notebook-container {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        flex-direction: unset !important;
        height: 100% !important;
        min-height: unset !important;
        border-width: 4px !important;
    }
    
    .teachers-notebook-spine {
        display: block !important;
    }
    
    .teachers-crease-shadow {
        display: block !important;
    }
    
    .teachers-left-page, .teachers-right-page {
        padding: 10px 14px !important;
        min-height: unset !important;
        height: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
        box-sizing: border-box !important;
    }
    
    .teachers-left-page {
        border-right: 1px solid rgba(0,0,0,0.15) !important;
        border-bottom: none !important;
    }
    
    .teachers-right-page {
        border-left: 1px solid rgba(255,255,255,0.9) !important;
    }
    
    .teachers-page-title {
        font-size: 1.1rem !important;
        margin-bottom: 6px !important;
        padding-bottom: 3px !important;
    }
    
    .teachers-grid {
        max-height: calc(100% - 35px) !important;
        overflow-y: auto !important;
        gap: 6px !important;
    }
    
    .teacher-card {
        gap: 8px !important;
        padding: 2px !important;
    }
    
    .teacher-polaroid {
        width: 85px !important;
        padding: 4px 4px 14px 4px !important;
    }
    
    .teacher-polaroid img {
        height: 70px !important;
    }
    
    .teacher-polaroid::before {
        width: 25px !important;
        height: 10px !important;
        top: -5px !important;
    }
    
    .teacher-name {
        font-size: 0.95rem !important;
    }
    
    .teacher-role {
        font-size: 0.65rem !important;
        margin-bottom: 2px !important;
    }
    
    .teacher-bio {
        font-size: 0.8rem !important;
        max-height: 40px !important;
        line-height: 1.2 !important;
    }
    
    .btn-close-teachers {
        padding: 6px 12px !important;
        font-size: 0.75rem !important;
    }
    
    #closeTeachersBtn {
        position: fixed !important;
        top: 10px !important;
        right: 10px !important;
        z-index: 999999999 !important;
        margin: 0 !important;
    }
    
    #adminAddTeacherBtn {
        position: fixed !important;
        top: 10px !important;
        left: 10px !important;
        z-index: 999999999 !important;
        margin: 0 !important;
    }
    
    .teachers-book-3d {
        transform: translate(-50%, -50%) rotateY(-20deg) scale(0.4) !important;
    }
    
    .teachers-book-3d.opening {
        transform: translate(-50%, -50%) rotateY(0deg) scale(0.55) !important;
    }
    
    .teachers-book-3d.flipped {
        transform: translate(-50%, -50%) rotateY(-180deg) scale(0.6) !important;
        opacity: 0 !important;
    }

    /* 3D Envelope Landscape Mobile Styling */
    .envelope-wrapper {
        transform: rotateX(15deg) translateY(0) scale(0.5) !important;
    }
    
    .mail-popup-backdrop.open .envelope-wrapper {
        transform: rotateX(15deg) translateY(0) scale(0.55) !important;
    }
    
    .mail-popup-backdrop.open.slide-letter .envelope-wrapper {
        transform: rotateX(0deg) translateY(20px) scale(0.5) !important;
    }
    
    .mail-popup-backdrop.open.slide-letter .envelope-letter {
        transform: translateY(-80px) translateZ(80px) scale(1.25) !important;
        box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4) !important;
        padding: 12px !important;
        gap: 6px !important;
        height: 250px !important;
        left: 5px !important;
        right: 5px !important;
    }
    
    .letter-ring-spine {
        padding-bottom: 4px !important;
        margin-bottom: 2px !important;
    }
    
    .letter-profile {
        gap: 10px !important;
    }
    
    .letter-polaroid-frame {
        padding: 4px 4px 10px 4px !important;
    }
    
    .letter-polaroid-frame img {
        width: 70px !important;
        height: 70px !important;
    }
    
    .letter-teacher-name {
        font-size: 1.0rem !important;
        line-height: 1.2 !important;
    }
    
    .letter-teacher-role {
        font-size: 0.7rem !important;
        margin-bottom: 2px !important;
    }
    
    .letter-teacher-bio {
        font-size: 0.8rem !important;
        max-height: 65px !important;
        line-height: 1.2 !important;
    }
    
    .letter-close-btn {
        top: 10px !important;
        right: 10px !important;
        width: 24px !important;
        height: 24px !important;
        font-size: 0.75rem !important;
    }
}

