/* ==========================================================================
   DIAMOND PUBLIC SCHOOL, KHERLI (DPS KHERLI)
   Student Portal - Premium Animated Study Theme Background Engine
   ========================================================================== */

/* 1. Global Reset & Body Background Override */
body.login-page-bg.student-bg-theme {
    position: relative;
    min-height: 100vh;
    background-color: #081226 !important;
    background-image: none !important;
    overflow-x: hidden;
}

/* 2. Main Fixed Canvas */
.student-bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    background: radial-gradient(circle at 50% 40%, #0E1B38 0%, #081226 75%, #030712 100%);
}

/* 3. Ambient Dynamic Gradient Mesh */
.bg-gradient-mesh {
    position: absolute;
    top: -20%;
    left: -20%;
    width: 140%;
    height: 140%;
    background: 
        radial-gradient(circle at 25% 25%, rgba(30, 64, 125, 0.40) 0%, transparent 45%),
        radial-gradient(circle at 75% 30%, rgba(56, 189, 248, 0.14) 0%, transparent 40%),
        radial-gradient(circle at 50% 80%, rgba(15, 32, 64, 0.50) 0%, transparent 50%),
        radial-gradient(circle at 85% 75%, rgba(183, 138, 52, 0.12) 0%, transparent 45%);
    filter: blur(45px);
    animation: studentAuraRotate 28s ease-in-out infinite alternate;
}

@keyframes studentAuraRotate {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(4deg) scale(1.03); }
    100% { transform: rotate(-3deg) scale(0.98); }
}

/* 4. Ambient Study Light Beam */
.study-light-beam {
    position: absolute;
    top: -10%;
    left: 15%;
    width: 70%;
    height: 60%;
    background: radial-gradient(ellipse at top center, rgba(56, 189, 248, 0.08) 0%, transparent 70%);
    animation: studyLightBreathe 12s ease-in-out infinite alternate;
}

@keyframes studyLightBreathe {
    0% { opacity: 0.5; transform: scaleY(1); }
    100% { opacity: 0.85; transform: scaleY(1.1); }
}

/* 5. Animated Open Spiral Notebook Backdrop */
.open-notebook-backdrop {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 1150px;
    max-width: 90vw;
    height: 650px;
    max-height: 82vh;
    background: rgba(10, 20, 40, 0.42);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1.5px solid rgba(56, 189, 248, 0.2);
    border-radius: 24px;
    box-shadow: 
        0 20px 50px rgba(0, 0, 0, 0.45),
        0 0 35px rgba(56, 189, 248, 0.10),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    overflow: hidden;
    z-index: 2;
    display: flex;
}

/* Notebook Left & Right Pages */
.notebook-page-left,
.notebook-page-right {
    flex: 1;
    height: 100%;
    padding: 30px;
    box-sizing: border-box;
    position: relative;
    background-image: repeating-linear-gradient(transparent, transparent 27px, rgba(255, 255, 255, 0.04) 28px);
}

.notebook-spiral-spine {
    width: 24px;
    height: 100%;
    background: linear-gradient(90deg, rgba(15, 28, 54, 0.8), rgba(30, 58, 110, 0.9), rgba(15, 28, 54, 0.8));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-around;
    padding: 10px 0;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.spiral-ring {
    width: 16px;
    height: 6px;
    background: linear-gradient(135deg, #CBD5E1, #64748B);
    border-radius: 3px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

/* 6. Page Flip Animation Effect */
.notebook-page-flip-overlay {
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    background: rgba(14, 28, 56, 0.35);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    transform-origin: left center;
    animation: pageFlipCycle 12s ease-in-out infinite alternate;
}

@keyframes pageFlipCycle {
    0% { transform: rotateY(0deg); opacity: 0.2; }
    50% { transform: rotateY(-25deg); opacity: 0.5; }
    100% { transform: rotateY(0deg); opacity: 0.2; }
}

/* 7. Pencil Stroke & Handwritten Words Animation */
.notebook-writing-area {
    display: flex;
    flex-direction: column;
    gap: 22px;
    margin-top: 20px;
}

.study-word-line {
    display: flex;
    align-items: center;
    gap: 12px;
    opacity: 0;
    transform: translateX(-15px);
    animation: wordLineFade 16s ease-in-out infinite;
}

.wline-1 { animation-delay: 0.5s; }
.wline-2 { animation-delay: 4.5s; }
.wline-3 { animation-delay: 8.5s; }
.wline-4 { animation-delay: 12.5s; }

@keyframes wordLineFade {
    0% { opacity: 0; transform: translateX(-15px); }
    6% { opacity: 1; transform: translateX(0); }
    22% { opacity: 1; transform: translateX(0); }
    28% { opacity: 0; transform: translateX(10px); }
    100% { opacity: 0; transform: translateX(-15px); }
}

.handwritten-word {
    font-family: 'Outfit', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: #F8FAFC;
    text-shadow: 0 0 12px rgba(56, 189, 248, 0.45);
    letter-spacing: 0.04em;
}

.pencil-lead-tip {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: #38BDF8;
    box-shadow: 0 0 10px #38BDF8, 0 0 18px #38BDF8;
    animation: pencilPointPulse 1s ease-in-out infinite alternate;
}

@keyframes pencilPointPulse {
    0% { transform: scale(0.8); opacity: 0.6; }
    100% { transform: scale(1.3); opacity: 1; }
}

.study-chip-tag {
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    background: rgba(56, 189, 248, 0.15);
    color: #38BDF8;
    border: 1px solid rgba(56, 189, 248, 0.3);
    letter-spacing: 0.03em;
}

.study-chip-tag.green {
    background: rgba(34, 197, 94, 0.15);
    color: #4ADE80;
    border-color: rgba(34, 197, 94, 0.3);
}

.study-chip-tag.gold {
    background: rgba(183, 138, 52, 0.18);
    color: #E4C77E;
    border-color: rgba(183, 138, 52, 0.35);
}

/* 8. Floating Stationery & School Study Elements */
.floating-stationery-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
}

.float-stationery {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: rgba(15, 28, 54, 0.45);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 30px;
    color: #E2E8F0;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.float-stationery i {
    font-size: 16px;
    color: #38BDF8;
}

.item-pen { top: 12%; left: 6%; animation: floatItem1 10s ease-in-out infinite alternate; }
.item-pencil { top: 15%; right: 7%; animation: floatItem2 12s ease-in-out infinite alternate; }
.item-book { bottom: 14%; left: 7%; animation: floatItem3 11s ease-in-out infinite alternate; }
.item-paper { bottom: 18%; right: 8%; animation: floatItem1 13s ease-in-out infinite alternate 1s; }
.item-ruler { top: 8%; left: 45%; animation: floatItem2 9s ease-in-out infinite alternate 0.5s; }
.item-star { bottom: 8%; right: 45%; animation: floatItem3 10s ease-in-out infinite alternate 1.5s; }

@keyframes floatItem1 {
    0% { transform: translateY(0px) rotate(0deg); }
    100% { transform: translateY(-15px) rotate(2deg); }
}

@keyframes floatItem2 {
    0% { transform: translateY(0px) rotate(0deg); }
    100% { transform: translateY(16px) rotate(-2deg); }
}

@keyframes floatItem3 {
    0% { transform: translateY(0px) scale(1); }
    100% { transform: translateY(-12px) scale(1.03); }
}

/* 9. Floating Subtle Light Particles */
.particles-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.bg-particle {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.7) 0%, rgba(56,189,248,0.3) 60%, transparent 100%);
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.4);
    opacity: 0;
    animation: particleDrift 16s linear infinite;
}

.particle-p1 { width: 4px; height: 4px; left: 18%; animation-delay: 0s; }
.particle-p2 { width: 5px; height: 5px; left: 38%; animation-delay: 3s; }
.particle-p3 { width: 3px; height: 3px; left: 68%; animation-delay: 6s; }
.particle-p4 { width: 5px; height: 5px; left: 88%; animation-delay: 2s; }

@keyframes particleDrift {
    0% { transform: translateY(105vh) translateX(0); opacity: 0; }
    20% { opacity: 0.5; }
    80% { opacity: 0.5; }
    100% { transform: translateY(-5vh) translateX(20px); opacity: 0; }
}

/* 10. Dark Soft Vignette Overlay */
.bg-soft-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(8, 18, 38, 0.56) 0%, rgba(8, 18, 38, 0.82) 75%, rgba(3, 7, 18, 0.94) 100%);
    z-index: 4;
}

/* 11. Elevating Central Student Login Card */
.student-bg-theme .login-wrapper-inst {
    position: relative;
    z-index: 10;
}

.student-bg-theme .login-card-inst {
    background: rgba(255, 255, 255, 0.97) !important;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.85) !important;
    box-shadow: 
        0 30px 60px -15px rgba(0, 0, 0, 0.6), 
        0 0 0 1px rgba(56, 189, 248, 0.2),
        0 12px 35px rgba(14, 28, 56, 0.3) !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease !important;
}

.student-bg-theme .login-card-inst:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 35px 70px -15px rgba(0, 0, 0, 0.7), 
        0 0 0 1px rgba(56, 189, 248, 0.35),
        0 18px 45px rgba(14, 28, 56, 0.4) !important;
}

/* 12. Responsive Media Queries */
@media (max-width: 1200px) {
    .open-notebook-backdrop {
        width: 95vw;
        height: 75vh;
    }
}

@media (max-width: 991px) {
    .floating-stationery-layer {
        opacity: 0.6;
    }
    .float-stationery {
        padding: 6px 10px;
        font-size: 11px;
    }
}

@media (max-width: 576px) {
    .open-notebook-backdrop {
        display: none;
    }
    .floating-stationery-layer {
        display: none;
    }
}

/* 13. Accessibility: Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .bg-gradient-mesh,
    .study-light-beam,
    .notebook-page-flip-overlay,
    .study-word-line,
    .float-stationery,
    .bg-particle {
        animation: none !important;
    }
}

/* 14. Premium 4-5s DPS Intro / Splash Screen Animation Overlay */
#dpsSplashScreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at 50% 40%, #0F1C36 0%, #081226 60%, #030712 100%);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
    overflow: hidden;
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

#dpsSplashScreen.splash-dismissed {
    opacity: 0;
    transform: scale(1.04);
    pointer-events: none;
}

/* Ambient Pulse Ring Halo Behind Logo */
.splash-halo-ring {
    position: absolute;
    width: 170px;
    height: 170px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(183, 138, 52, 0.25) 0%, rgba(56, 189, 248, 0.12) 50%, transparent 70%);
    animation: splashPulseGlow 2.5s ease-in-out infinite alternate;
}

@keyframes splashPulseGlow {
    0% { transform: scale(0.85); opacity: 0.4; }
    100% { transform: scale(1.25); opacity: 0.9; }
}

/* Main Splash Brand Card Lockup */
.splash-content-lockup {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 360px;
}

.splash-logo-img {
    width: 90px;
    height: 90px;
    object-fit: contain;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.4));
    animation: splashLogoScale 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes splashLogoScale {
    0% { opacity: 0; transform: scale(0.65) translateY(15px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

.splash-school-name {
    font-family: 'Fraunces', serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: #FFFFFF;
    margin: 18px 0 4px 0;
    letter-spacing: -0.01em;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    animation: textSlideUp 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards;
    opacity: 0;
}

.splash-location-tag {
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.2em;
    color: #E4C77E;
    text-transform: uppercase;
    margin-bottom: 24px;
    animation: textSlideUp 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.5s forwards;
    opacity: 0;
}

@keyframes textSlideUp {
    0% { opacity: 0; transform: translateY(16px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* Splash Animated Progress Bar */
.splash-progress-track {
    width: 200px;
    height: 4px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.12);
    overflow: hidden;
    position: relative;
    margin-bottom: 12px;
    animation: textSlideUp 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.7s forwards;
    opacity: 0;
}

.splash-progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #E4C77E, #38BDF8, #4ADE80);
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.6);
    animation: splashProgress 4s ease-in-out forwards;
}

@keyframes splashProgress {
    0% { width: 0%; }
    50% { width: 65%; }
    100% { width: 100%; }
}

.splash-subtitle-status {
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 500;
    color: #94A3B8;
    animation: textSlideUp 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.9s forwards;
    opacity: 0;
}
