/* ========================================
   ROOT VARIABLES & RESET
   ======================================== */
:root {
    --gold: #d4af37;
    --gold-light: #f0c040;
    --gold-dark: #b8960c;
    --bg-deep: #0a0a2e;
    --bg-mid: #151545;
    --bg-light: #1e1e5e;
    --bg-card: rgba(255, 255, 255, 0.04);
    --border: rgba(212, 175, 55, 0.25);
    --text: #ffffff;
    --text-dim: rgba(255, 255, 255, 0.65);
    --font-heading: 'Playfair Display', Georgia, serif;
    --font-body: 'Inter', system-ui, sans-serif;
    --radius: 16px;
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: var(--font-body);
    background: var(--bg-deep);
    color: var(--text);
    overflow-x: hidden;
}

/* ========================================
   PARTICLE CANVAS
   ======================================== */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

/* ========================================
   SCREEN MANAGEMENT
   ======================================== */
.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.8s ease;
    z-index: 10;
}

.screen.active {
    opacity: 1;
    pointer-events: all;
    z-index: 20;
}

/* ========================================
   SCREEN 1: GIFT BOX
   ======================================== */
#gift-screen {
    background: radial-gradient(ellipse at 30% 20%, #1e1e5e 0%, #0a0a2e 60%, #050518 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

/* =========================
   SCHOOL BRAND
========================= */

.school-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 6px;
    padding: 10px 20px;
}

/* School Logo */
.school-logo {
    display: flex;
    align-items: center;
    justify-content: center;
}

.school-logo img {
    width: 75px;
    height: 75px;
    object-fit: contain;
    display: block;
}

/* School Name Image */
.school-name {
    display: flex;
    align-items: center;
    justify-content: center;
}

.school-name img {
    width: 260px;
    max-width: 80vw;
    height: auto;
    object-fit: contain;
    display: block;
}

/* Location / Establishment */
.school-location {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 3px;
    color: #555;
    margin-top: 2px;
}


.gift-container {
    text-align: center;
    opacity: 0;
    animation: fadeInUp 1s ease 0.6s forwards;
}

.gift-label {
    font-family: var(--font-heading);
    font-size: clamp(1.4rem, 4vw, 2.2rem);
    color: var(--text);
    margin-bottom: 3rem;
    text-shadow: 0 2px 20px rgba(212, 175, 55, 0.2);
}

.gift-box-wrapper {
    position: relative;
    width: 180px;
    height: 180px;
    margin: 0 auto 2rem;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
}

.gift-box-wrapper:hover {
    transform: scale(1.05);
}

.gift-box-wrapper.opening {
    pointer-events: none;
}

.gift-box {
    position: relative;
    width: 100%;
    height: 100%;
}

.gift-body {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 65%;
    background: linear-gradient(135deg, #1e1e5e, #2d2d7a);
    border: 2px solid var(--border);
    border-radius: 0 0 12px 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.4), inset 0 2px 10px rgba(212,175,55,0.1);
}

.gift-lid {
    position: absolute;
    top: 0;
    width: 110%;
    left: -5%;
    height: 35%;
    background: linear-gradient(135deg, #252560, #353590);
    border: 2px solid var(--border);
    border-radius: 12px 12px 4px 4px;
    transform-origin: bottom center;
    transition: transform 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    z-index: 2;
}

.gift-box-wrapper.opening .gift-lid {
    transform: rotateX(-110deg) translateY(-20px);
}

.ribbon-vertical {
    position: absolute;
    left: 50%;
    top: -35%;
    transform: translateX(-50%);
    width: 24px;
    height: 135%;
    background: linear-gradient(90deg, var(--gold-dark), var(--gold), var(--gold-dark));
    z-index: 1;
}

.ribbon-horizontal {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 24px;
    background: linear-gradient(0deg, var(--gold-dark), var(--gold), var(--gold-dark));
    transform: translateY(-50%);
    z-index: 1;
}

.gift-bow {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 30px;
}

.gift-bow::before,
.gift-bow::after {
    content: '';
    position: absolute;
    width: 28px;
    height: 28px;
    border: 4px solid var(--gold);
    border-radius: 50% 50% 50% 0;
    top: 0;
}

.gift-bow::before {
    left: -8px;
    transform: rotate(-30deg);
}

.gift-bow::after {
    right: -8px;
    transform: rotate(30deg) scaleX(-1);
}

.gift-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(212,175,55,0.15) 0%, transparent 70%);
    animation: pulseGlow 2.5s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

.gift-hint {
    font-size: 0.85rem;
    color: var(--text-dim);
    letter-spacing: 0.1em;
    animation: fadeInUp 1s ease 1.2s both;
}

/* ========================================
   SCREEN 2: GALLERY
   ======================================== */
#gallery-screen {
    background: radial-gradient(ellipse at 70% 10%, #1e1e5e 0%, #0a0a2e 50%, #050518 100%);
    padding: 2rem 1.5rem 4rem;
}

.gallery-header {
    max-width: 800px;
    margin: 0 auto 3rem;
    text-align: center;
    padding-top: 1rem;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
    opacity: 0;
    animation: fadeInDown 0.8s ease forwards;
}

.brand-title {
    font-family: var(--font-heading);
    font-size: 1rem;
    letter-spacing: 0.15em;
    color: var(--gold);
    font-weight: 600;
}

.brand-subtitle {
    font-size: 0.75rem;
    color: var(--text-dim);
    letter-spacing: 0.1em;
}

.gallery-hero-text {
    margin-bottom: 2.5rem;
    opacity: 0;
    animation: fadeInUp 0.8s ease 0.2s forwards;
}

.gallery-heading {
    font-family: var(--font-heading);
    font-size: clamp(1.8rem, 5vw, 3rem);
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #fff 0%, var(--gold-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gallery-subheading {
    font-size: 1.1rem;
    color: var(--text-dim);
    font-weight: 300;
    letter-spacing: 0.05em;
}

.search-bar {
    position: relative;
    max-width: 480px;
    margin: 0 auto;
    opacity: 0;
    animation: fadeInUp 0.8s ease 0.4s forwards;
}

.search-icon {
    position: absolute;
    left: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dim);
    pointer-events: none;
}

.search-bar input {
    width: 100%;
    padding: 1rem 1rem 1rem 3.2rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    border-radius: 100px;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
}

.search-bar input:focus {
    background: rgba(255,255,255,0.08);
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212,175,55,0.1);
}

.search-bar input::placeholder {
    color: rgba(255,255,255,0.35);
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1.25rem;
    max-width: 900px;
    margin: 0 auto;
    opacity: 0;
    animation: fadeInUp 0.8s ease 0.5s forwards;
}

.teacher-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.teacher-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.teacher-card:hover {
    transform: translateY(-6px);
    border-color: rgba(212,175,55,0.5);
    box-shadow: 0 12px 40px rgba(0,0,0,0.3), 0 0 20px rgba(212,175,55,0.08);
}

.teacher-card:hover::before {
    opacity: 1;
}

.teacher-photo {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 0.75rem;
    border: 2px solid var(--border);
    transition: var(--transition);
    background: linear-gradient(135deg, #2d2d7a, #1e1e5e);
}

.teacher-card:hover .teacher-photo {
    border-color: var(--gold);
    transform: scale(1.08);
}

.teacher-name {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    color: var(--text);
    line-height: 1.3;
    margin-bottom: 0.25rem;
}

.teacher-name .last-name {
    display: block;
    font-size: 0.85rem;
    color: var(--text-dim);
    font-family: var(--font-body);
    font-weight: 400;
    margin-top: 1px;
}

.teacher-quality {
    display: inline-block;
    margin-top: 0.6rem;
    padding: 0.35rem 0.8rem;
    background: rgba(212,175,55,0.1);
    border: 1px solid rgba(212,175,55,0.3);
    border-radius: 100px;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gold-light);
    font-weight: 500;
}

.gallery-empty {
    text-align: center;
    padding: 3rem;
    color: var(--text-dim);
    font-size: 1rem;
}

/* ========================================
   SCREEN 3: REVEAL
   ======================================== */
#reveal-screen {
    background: radial-gradient(ellipse at 50% 50%, #151545 0%, #0a0a2e 60%, #050518 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
}

.back-btn {
    position: absolute;
    top: 2rem;
    left: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 0.6rem 1.2rem;
    border-radius: 100px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    backdrop-filter: blur(10px);
}

.back-btn:hover {
    background: rgba(212,175,55,0.1);
    border-color: var(--gold);
    color: var(--gold);
}

.reveal-stage {
    max-width: 600px;
    width: 100%;
}

.reveal-intro {
    font-family: var(--font-heading);
    font-size: clamp(1.2rem, 3vw, 1.6rem);
    color: var(--text-dim);
    font-style: italic;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

.reveal-intro.show {
    opacity: 1;
    transform: translateY(0);
}

.countdown-stage {
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1rem 0;
}

.countdown-number {
    font-family: var(--font-heading);
    font-size: clamp(5rem, 15vw, 8rem);
    font-weight: 700;
    color: var(--gold);
    text-shadow: 0 0 40px rgba(212,175,55,0.3), 0 0 80px rgba(212,175,55,0.1);
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.countdown-number.pop {
    opacity: 1;
    transform: scale(1);
}

.countdown-number.fade {
    opacity: 0;
    transform: scale(1.3);
    transition: all 0.4s ease;
}

.quality-reveal {
    opacity: 0;
    transform: scale(0.8) translateY(30px);
    transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.quality-reveal.show {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.quality-icon {
    font-size: 4rem;
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 4px 20px rgba(212,175,55,0.3));
}

.quality-text {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    font-weight: 700;
    color: var(--gold-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-shadow: 0 0 60px rgba(212,175,55,0.4), 0 2px 10px rgba(0,0,0,0.3);
}

.reveal-message {
    margin-top: 2rem;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.7s ease 0.3s;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.reveal-message.show {
    opacity: 1;
    transform: translateY(0);
}

.reveal-message p {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    line-height: 1.7;
    color: var(--text-dim);
    font-weight: 300;
}

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulseGlow {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.6; }
    50% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; }
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 640px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 1rem;
    }

    .teacher-photo {
        width: 60px;
        height: 60px;
    }

    .back-btn {
        top: 1rem;
        left: 1rem;
        font-size: 0.8rem;
        padding: 0.5rem 1rem;
    }
}

@media (max-width: 380px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}