/* ========================================================
   NOOKNICK Staff Portal - Modular Stylesheet (hub.css)
   ======================================================== */

:root {
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Prompt', sans-serif;
    background-color: #f8fafc;
    color: #1e293b;
    min-height: 100dvh;
    padding-top: max(16px, var(--safe-top));
    padding-bottom: max(24px, var(--safe-bottom));
    padding-left: max(16px, var(--safe-left));
    padding-right: max(16px, var(--safe-right));
    overflow-x: hidden;
    position: relative;
}

/* Ambient Aurora Glow Background */
.aurora-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.aurora-blob-1 {
    position: absolute;
    top: -120px;
    left: -100px;
    width: 360px;
    height: 360px;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.25) 0%, rgba(255, 255, 255, 0) 70%);
    border-radius: 50%;
    filter: blur(40px);
    animation: floatSlow 12s ease-in-out infinite alternate;
}

.aurora-blob-2 {
    position: absolute;
    top: 25%;
    right: -120px;
    width: 380px;
    height: 380px;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.22) 0%, rgba(255, 255, 255, 0) 70%);
    border-radius: 50%;
    filter: blur(45px);
    animation: floatSlow 15s ease-in-out infinite alternate-reverse;
}

.aurora-blob-3 {
    position: absolute;
    bottom: -80px;
    left: 20%;
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.15) 0%, rgba(255, 255, 255, 0) 70%);
    border-radius: 50%;
    filter: blur(50px);
}

@keyframes floatSlow {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(30px, 40px) scale(1.08); }
}

/* Milky Glass Cards */
.glass-card {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1.5px solid rgba(255, 255, 255, 0.95);
    box-shadow: 0 16px 36px -12px rgba(2, 132, 199, 0.1), 0 12px 28px -10px rgba(236, 72, 153, 0.08), 0 1px 3px rgba(0, 0, 0, 0.03);
    border-radius: 24px;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
}

.glass-card:active {
    transform: scale(0.985);
}

/* Shimmer Button */
.btn-gradient-shimmer {
    background: linear-gradient(135deg, #0284c7 0%, #38bdf8 45%, #ec4899 100%);
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 25px -5px rgba(2, 132, 199, 0.35), 0 8px 16px -6px rgba(236, 72, 153, 0.3);
    transition: all 0.2s ease;
}

.btn-gradient-shimmer:active {
    transform: scale(0.97);
    box-shadow: 0 6px 15px -3px rgba(2, 132, 199, 0.4);
}

.btn-gradient-shimmer::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -60%;
    width: 50%;
    height: 200%;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.35), transparent);
    transform: rotate(30deg);
    animation: shimmer 4s infinite;
}

@keyframes shimmer {
    0% { left: -60%; }
    20% { left: 140%; }
    100% { left: 140%; }
}

/* Text Gradients */
.text-gradient-brand {
    background: linear-gradient(135deg, #0284c7 0%, #ec4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Scanner Modal HUD Overlay */
.scanner-hud-box {
    position: relative;
    width: 260px;
    height: 260px;
    margin: 0 auto;
}

.scanner-corner {
    position: absolute;
    width: 32px;
    height: 32px;
    border-color: #38bdf8;
    pointer-events: none;
}

.corner-tl { top: 0; left: 0; border-top: 4px solid #38bdf8; border-left: 4px solid #38bdf8; border-top-left-radius: 12px; }
.corner-tr { top: 0; right: 0; border-top: 4px solid #ec4899; border-right: 4px solid #ec4899; border-top-right-radius: 12px; }
.corner-bl { bottom: 0; left: 0; border-bottom: 4px solid #38bdf8; border-left: 4px solid #38bdf8; border-bottom-left-radius: 12px; }
.corner-br { bottom: 0; right: 0; border-bottom: 4px solid #ec4899; border-right: 4px solid #ec4899; border-bottom-right-radius: 12px; }

.scanner-laser {
    position: absolute;
    left: 8px;
    right: 8px;
    height: 3px;
    background: linear-gradient(90deg, #38bdf8, #ec4899);
    box-shadow: 0 0 14px 2px rgba(236, 72, 153, 0.8);
    animation: laserScan 2.4s ease-in-out infinite alternate;
}

@keyframes laserScan {
    0% { top: 12px; }
    100% { top: calc(100% - 16px); }
}

/* Face Attendance Oval HUD */
.face-oval-guide {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 250px;
    border: 2.5px dashed rgba(56, 189, 248, 0.85);
    border-radius: 50% 50% 45% 45% / 60% 60% 40% 40%;
    box-shadow: 0 0 25px rgba(56, 189, 248, 0.35), inset 0 0 20px rgba(236, 72, 153, 0.2);
    animation: pulseOval 2.5s infinite ease-in-out;
    pointer-events: none;
}

@keyframes pulseOval {
    0%, 100% { border-color: rgba(56, 189, 248, 0.85); transform: translate(-50%, -50%) scale(1); }
    50% { border-color: rgba(236, 72, 153, 0.95); transform: translate(-50%, -50%) scale(1.03); }
}

/* Custom SweetAlert in White Pastel Aurora theme */
.swal-nook-popup {
    border-radius: 24px !important;
    padding: 24px !important;
    background: rgba(255, 255, 255, 0.96) !important;
    backdrop-filter: blur(20px) !important;
    box-shadow: 0 25px 50px -12px rgba(2, 132, 199, 0.25) !important;
    border: 1px solid rgba(255, 255, 255, 0.8) !important;
    font-family: 'Prompt', sans-serif !important;
}

.swal-nook-confirm-btn {
    background: linear-gradient(135deg, #0284c7, #38bdf8) !important;
    border-radius: 14px !important;
    padding: 12px 24px !important;
    font-weight: 600 !important;
    font-size: 0.95rem !important;
}

/* ========================================================
   App Splash Preloader (Smooth PWA Launch)
   ======================================================== */
#appSplashPreloader {
    position: fixed;
    inset: 0;
    z-index: 9999999;
    background: radial-gradient(circle at 50% 30%, #0f1c3f 0%, #090d16 65%, #05070d 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
    overflow: hidden;
    transition: opacity 0.45s cubic-bezier(0.4, 0, 0.2, 1), transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

#appSplashPreloader.splash-fade-out {
    opacity: 0;
    transform: scale(1.04);
    pointer-events: none;
}

.splash-ambient-glow {
    position: absolute;
    width: 380px;
    height: 380px;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.22) 0%, rgba(236, 72, 153, 0.18) 45%, transparent 70%);
    border-radius: 50%;
    filter: blur(50px);
    pointer-events: none;
    animation: splashPulseAmbient 4s ease-in-out infinite alternate;
}

@keyframes splashPulseAmbient {
    0% { transform: scale(0.9) translate(-10px, -10px); opacity: 0.7; }
    100% { transform: scale(1.15) translate(15px, 15px); opacity: 1; }
}

.splash-content-box {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    max-width: 320px;
}

.splash-logo-box {
    position: relative;
    width: 92px;
    height: 92px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.splash-logo-glow-ring {
    position: absolute;
    inset: -4px;
    border-radius: 28px;
    background: linear-gradient(135deg, #38bdf8, #ec4899);
    filter: blur(12px);
    opacity: 0.75;
    animation: splashPulseGlowRing 2.4s ease-in-out infinite alternate;
}

@keyframes splashPulseGlowRing {
    0% { opacity: 0.5; filter: blur(8px); transform: scale(0.97); }
    100% { opacity: 0.9; filter: blur(16px); transform: scale(1.05); }
}

.splash-logo-img {
    position: relative;
    z-index: 1;
    width: 88px;
    height: 88px;
    border-radius: 24px;
    object-fit: cover;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.15);
}

.splash-brand-title {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 0.04em;
    margin: 0 0 4px 0;
    background: linear-gradient(135deg, #ffffff 40%, #bae6fd 75%, #fbcfe8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-family: 'Outfit', 'Prompt', sans-serif;
}

.splash-brand-subtitle {
    font-size: 13px;
    color: #94a3b8;
    margin: 0 0 28px 0;
    font-weight: 400;
    font-family: 'Prompt', sans-serif;
}

.splash-progress-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.splash-bar-track {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 9999px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5);
}

.splash-bar-fill {
    height: 100%;
    width: 18%;
    background: linear-gradient(90deg, #38bdf8 0%, #0284c7 40%, #ec4899 85%, #f472b6 100%);
    border-radius: 9999px;
    position: relative;
    transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 0 14px rgba(56, 189, 248, 0.6);
}

.splash-bar-shimmer {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.45) 50%, transparent 100%);
    animation: splashShimmer 1.8s infinite;
}

@keyframes splashShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(200%); }
}

.splash-status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #94a3b8;
    font-family: 'Prompt', sans-serif;
    padding: 0 2px;
}

.splash-status-text {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #cbd5e1;
    font-weight: 500;
}

.splash-percent {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    color: #38bdf8;
    letter-spacing: 0.02em;
}

.splash-spinner-dot {
    width: 11px;
    height: 11px;
    border: 2px solid rgba(56, 189, 248, 0.25);
    border-top-color: #38bdf8;
    border-radius: 50%;
    animation: splashSpin 0.7s linear infinite;
    display: inline-block;
    flex-shrink: 0;
}

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