/* ==========================================================================
   DIAMOND PUBLIC SCHOOL, KHERLI (DPS KHERLI)
   Teacher Portal - Animated Digital Classroom Background Engine
   ========================================================================== */

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

/* 2. Main Fixed Canvas */
.teacher-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%, #0D1B34 0%, #070E1B 75%, #03060C 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.42) 0%, transparent 45%),
        radial-gradient(circle at 75% 30%, rgba(56, 189, 248, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 50% 80%, rgba(15, 32, 64, 0.55) 0%, transparent 50%),
        radial-gradient(circle at 85% 75%, rgba(183, 138, 52, 0.10) 0%, transparent 45%);
    filter: blur(45px);
    animation: teacherAuraRotate 26s ease-in-out infinite alternate;
}

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

/* 4. Classroom Soft Ceiling Lighting Rays */
.classroom-ambient-lights {
    position: absolute;
    top: -10%;
    left: 10%;
    width: 80%;
    height: 60%;
    background: radial-gradient(ellipse at top center, rgba(56, 189, 248, 0.08) 0%, transparent 70%);
    animation: ceilingLightBreathe 12s ease-in-out infinite alternate;
}

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

/* 5. Digital Classroom Smartboard Container */
.smartboard-backdrop {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 1200px;
    max-width: 92vw;
    height: 680px;
    max-height: 85vh;
    background: rgba(11, 22, 44, 0.45);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1.5px solid rgba(56, 189, 248, 0.22);
    border-radius: 24px;
    box-shadow: 
        0 20px 50px rgba(0, 0, 0, 0.45),
        0 0 40px rgba(56, 189, 248, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    overflow: hidden;
    z-index: 2;
}

/* Smartboard Top LED Status Bar */
.smartboard-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: rgba(8, 16, 32, 0.6);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.smartboard-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: #94A3B8;
    text-transform: uppercase;
}

.smartboard-title i {
    color: #38BDF8;
    font-size: 15px;
}

.smartboard-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10.5px;
    font-weight: 700;
    color: #4ADE80;
    background: rgba(34, 197, 94, 0.12);
    padding: 3px 10px;
    border-radius: 20px;
    border: 1px solid rgba(34, 197, 94, 0.25);
}

.status-dot-green {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #22C55E;
    box-shadow: 0 0 6px #22C55E;
    animation: liveGreenPulse 2s infinite;
}

@keyframes liveGreenPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

/* 6. Smartboard Writing Area & Vector SVG Illustration */
.smartboard-content-area {
    position: relative;
    width: 100%;
    height: calc(100% - 48px);
    display: flex;
}

/* Left & Right Writing Panels */
.board-left-panel {
    width: 320px;
    height: 100%;
    padding: 30px 24px;
    box-sizing: border-box;
}

.board-right-panel {
    position: absolute;
    right: 30px;
    top: 30px;
    width: 320px;
    height: calc(100% - 60px);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;
}

/* 7. Teacher Handwriting Animation Loop */
.handwriting-container {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

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

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

@keyframes lineFadeIn {
    0% { opacity: 0; transform: translateX(-15px); }
    5% { opacity: 1; transform: translateX(0); }
    22% { opacity: 1; transform: translateX(0); }
    27% { opacity: 0; transform: translateX(10px); }
    100% { opacity: 0; transform: translateX(-15px); }
}

.chalk-text {
    font-family: 'Outfit', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: #F8FAFC;
    text-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
    letter-spacing: 0.03em;
}

.chalk-badge {
    padding: 3px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    background: rgba(56, 189, 248, 0.15);
    color: #38BDF8;
    border: 1px solid rgba(56, 189, 248, 0.3);
}

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

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

/* Stylus Pen Tip Glow Animation */
.stylus-pen-glow {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #38BDF8;
    box-shadow: 0 0 12px #38BDF8, 0 0 20px #38BDF8;
    animation: stylusWritePulse 1s ease-in-out infinite alternate;
}

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

/* 8. Smartboard Interactive Floating Widgets */
.board-widget {
    background: rgba(15, 28, 56, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 12px 16px;
    color: #CBD5E1;
    font-size: 11.5px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    animation: widgetFloat 8s ease-in-out infinite alternate;
}

.widget-rfid-card {
    width: 220px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-color: rgba(56, 189, 248, 0.25);
}

.widget-rfid-card i {
    font-size: 20px;
    color: #38BDF8;
}

.widget-curriculum {
    width: 200px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.widget-grade-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: #E4C77E;
}

@keyframes widgetFloat {
    0% { transform: translateY(0px); }
    100% { transform: translateY(-10px); }
}

/* 9. Vector Teacher Illustration Canvas */
.teacher-vector-container {
    position: absolute;
    right: 280px;
    bottom: 0;
    height: 90%;
    width: 220px;
    opacity: 0.35;
    mix-blend-mode: screen;
}

.teacher-svg {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: bottom center;
}

/* 10. 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: 15%; animation-delay: 0s; }
.particle-p2 { width: 5px; height: 5px; left: 35%; animation-delay: 3s; }
.particle-p3 { width: 3px; height: 3px; left: 65%; animation-delay: 6s; }
.particle-p4 { width: 5px; height: 5px; left: 85%; 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; }
}

/* 11. Dark Soft Vignette & Overlay Layer */
.bg-soft-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(7, 14, 27, 0.58) 0%, rgba(7, 14, 27, 0.85) 75%, rgba(3, 6, 12, 0.95) 100%);
    z-index: 3;
}

/* 12. Elevating Central Teacher Login Card */
.teacher-bg-theme .login-wrapper-inst {
    position: relative;
    z-index: 10;
}

.teacher-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(13, 27, 52, 0.3) !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease !important;
}

.teacher-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(13, 27, 52, 0.4) !important;
}

/* 13. Responsive Media Queries */
@media (max-width: 1200px) {
    .smartboard-backdrop {
        width: 95vw;
        height: 75vh;
    }
    .teacher-vector-container {
        display: none;
    }
}

@media (max-width: 991px) {
    .board-right-panel {
        display: none;
    }
    .board-left-panel {
        width: 100%;
        padding: 20px;
    }
    .chalk-text {
        font-size: 18px;
    }
}

@media (max-width: 576px) {
    .smartboard-backdrop {
        display: none;
    }
}

/* 14. Accessibility: Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .bg-gradient-mesh,
    .classroom-ambient-lights,
    .handwriting-line,
    .stylus-pen-glow,
    .board-widget,
    .bg-particle {
        animation: none !important;
    }
}

/* 15. Premium 4-5s DPS Intro / Splash Screen Animation Overlay (Teacher Portal) */
#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;
}
