/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* High-Tech Cockpit Scrollbar - Light Theme */
.custom-scrollbar::-webkit-scrollbar {
    width: 4px;
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: #f8fafc;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background-color: var(--primary-color) !important;
    border-radius: 10px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
    filter: brightness(0.8);
}

/* Animations & Effects */
@keyframes cockpitPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.animate-pulse-fast {
    animation: cockpitPulse 1s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.tech-glow {
    box-shadow: 0 0 15px rgba(var(--primary-color-rgb), 0.3);
}

.tech-glow-hover:hover {
    box-shadow: 0 0 25px rgba(var(--primary-color-rgb), 0.5);
    transform: translateY(-2px);
}

.scanning-line {
    position: relative;
    overflow: hidden;
}

.scanning-line::after {
    content: "";
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent, rgba(var(--primary-color-rgb), 0.03), transparent);
    animation: scan 3s linear infinite;
    pointer-events: none;
}

@keyframes scan {
    0% { top: -100%; }
    100% { top: 100%; }
}

.loader {
    border: 3px solid rgba(var(--primary-color-rgb), 0.1);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 0.8s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.fade-in {
    animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════════════════════
   AUTH SCREENS THEME PERSISTENCE (LOGIN & SUSPENDED)
   Ensures these critical pages remain in their specific 'Solar/Dark' 
   aesthetic even if the user has a 'Light' theme saved.
   ═══════════════════════════════════════════════════════════════ */
/* ═══════════════════════════════════════════════════════════════
   EXTREME GLASSMORPHISM & PREMIUM UI
   ═══════════════════════════════════════════════════════════════ */

.premium-glass-card {
    background: rgba(255, 255, 255, 0.03) !important;
    backdrop-filter: blur(30px) saturate(200%) !important;
    -webkit-backdrop-filter: blur(30px) saturate(200%) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 3.5rem !important;
    box-shadow: 
        0 40px 100px -20px rgba(0, 0, 0, 0.8),
        inset 0 0 0 1px rgba(255, 255, 255, 0.05) !important;
    position: relative;
    display: flex;
    flex-direction: column;
}

.premium-glass-inner {
    background: rgba(255, 255, 255, 0.03) !important;
    backdrop-filter: blur(15px) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 3rem !important;
}

.glass-button-primary {
    background: #FFFFFF !important;
    color: #0A1128 !important;
    border-radius: 2rem !important;
    box-shadow: 0 15px 30px rgba(255, 255, 255, 0.1) !important;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

.glass-button-primary:hover {
    transform: translateY(-5px) scale(1.02) !important;
    box-shadow: 0 20px 40px rgba(255, 255, 255, 0.2) !important;
}

.glow-amber {
    position: absolute;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.2) 0%, transparent 70%);
    filter: blur(40px);
    pointer-events: none;
    z-index: 0;
}

.glow-blue {
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.15) 0%, transparent 70%);
    filter: blur(60px);
    pointer-events: none;
    z-index: 0;
}

.text-premium-gradient {
    background: linear-gradient(135deg, #FFFFFF 0%, #A5B4FC 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 900;
}

.text-amber-gradient {
    background: linear-gradient(135deg, #FBBF24 0%, #F59E0B 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

/* Float Animation */
@keyframes floating {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
    100% { transform: translateY(0px); }
}

.animate-float {
    animation: floating 6s ease-in-out infinite;
}

/* Mesh Movement V2 */
@keyframes meshGradientMove {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.bg-mesh-modern {
    background: linear-gradient(-45deg, #0A1128, #111A3A, #162447, #0A1128);
    background-size: 400% 400%;
    animation: meshGradientMove 15s ease infinite;
}


/* ═══════════════════════════════════════════════════════════════
   LOGIN & SUSPENDED SCREEN — THEME-PROOF OVERRIDES
   Forces fixed dark colors regardless of light/dark theme.
   ═══════════════════════════════════════════════════════════════ */

/* --- MAIN CONTAINERS --- */
#login-screen,
html.light #login-screen,
html.dark #login-screen {
    background-color: #0A1128 !important;
    color: #cbd5e1 !important;
}

/* --- LEFT PANEL (Banner) --- */
#login-screen > div:first-child,
html.light #login-screen > div:first-child,
html.dark #login-screen > div:first-child {
    background-color: #060B19 !important;
}

/* --- RIGHT PANEL (Form Area) --- */
#login-screen > div:nth-child(2),
html.light #login-screen > div:nth-child(2),
html.dark #login-screen > div:nth-child(2) {
    background-color: #0A1128 !important;
}

/* --- FORM CARD --- */
#login-screen > div:nth-child(2) > div:nth-child(2),
html.light #login-screen .max-w-md,
html.dark #login-screen .max-w-md {
    background-color: #111A3A !important;
    border-color: #1E2A52 !important;
}

/* --- HEADINGS (h1, h2, h3) --- */
#login-screen h1,
#login-screen h2,
#login-screen h3,
html.light #login-screen h1,
html.light #login-screen h2,
html.light #login-screen h3 {
    color: #FFFFFF !important;
}

/* --- PARAGRAPHS & MUTED TEXT --- */
#login-screen p,
#login-screen .text-slate-300,
#login-screen .text-slate-400,
html.light #login-screen p,
html.light #login-screen .text-slate-300,
html.light #login-screen .text-slate-400 {
    color: #cbd5e1 !important;
    background-color: transparent !important;
    background: transparent !important;
}

#login-screen .text-slate-500,
html.light #login-screen .text-slate-500 {
    color: #64748B !important;
    background-color: transparent !important;
}

/* --- SPANS (non-icon) --- */
#login-screen span:not(.material-icons):not(.material-symbols-outlined):not(.material-icons-round),
html.light #login-screen span:not(.material-icons):not(.material-symbols-outlined):not(.material-icons-round) {
    color: #FFFFFF !important;
    background-color: transparent !important;
}

/* --- LABELS --- */
#login-screen label,
html.light #login-screen label {
    color: #3b82f6 !important;
}

#login-screen label span,
html.light #login-screen label span {
    color: #ef4444 !important;
}

/* --- INPUTS --- */
#login-screen input:not([type="checkbox"]):not([type="radio"]),
html.light #login-screen input:not([type="checkbox"]):not([type="radio"]),
html.dark #login-screen input:not([type="checkbox"]):not([type="radio"]) {
    background-color: #060B19 !important;
    color: #FFFFFF !important;
    border-color: #1E2A52 !important;
}

#login-screen ::placeholder {
    color: #64748B !important;
    opacity: 0.6 !important;
}

/* --- ICONS (Material) --- */
#login-screen .material-icons,
#login-screen .material-symbols-outlined,
html.light #login-screen .material-icons,
html.light #login-screen .material-symbols-outlined {
    color: #94A3B8 !important;
}

/* --- SUBMIT BUTTON (White bg, dark text) --- */
#login-screen button[type="submit"],
html.light #login-screen button[type="submit"],
html.dark #login-screen button[type="submit"] {
    background-color: #FFFFFF !important;
    color: #0A1128 !important;
    border-color: transparent !important;
}

#login-screen button[type="submit"]:hover {
    background-color: #f1f5f9 !important;
}

/* --- SECURITY FOOTER TEXT --- */
#login-screen .text-xs,
html.light #login-screen .text-xs {
    color: #64748B !important;
}

/* --- TRANSITION OVERLAY --- */
#login-screen .app-transition-overlay,
html.light #login-screen .app-transition-overlay {
    background: #0A1128 !important;
}

/* ═══════════════════════════════════════════════════════════════
   SUSPENDED SCREEN — THEME-PROOF
   ═══════════════════════════════════════════════════════════════ */
#suspended-screen,
html.light #suspended-screen,
html.dark #suspended-screen {
    background-color: #0A1128 !important;
    color: #cbd5e1 !important;
}

#suspended-screen h1,
#suspended-screen h2,
#suspended-screen h3,
html.light #suspended-screen h1,
html.light #suspended-screen h2,
html.light #suspended-screen h3 {
    color: #FFFFFF !important;
}

#suspended-screen p,
html.light #suspended-screen p {
    color: #CBD5E1 !important;
}

#suspended-screen span:not(.material-icons):not(.material-symbols-outlined):not(.material-icons-round),
html.light #suspended-screen span:not(.material-icons):not(.material-symbols-outlined):not(.material-icons-round) {
    color: #FFFFFF !important;
}

#suspended-screen .material-icons-round,
html.light #suspended-screen .material-icons-round {
    color: #94A3B8 !important;
}

/* Keep amber icon colors */
#suspended-screen .material-icons-round[style*="color: #F59E0B"],
#suspended-screen .text-amber-500 {
    color: #f59e0b !important;
}

/* Fix for calendar icon in dark mode */
html.dark input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1) brightness(100%) contrast(100%);
    cursor: pointer;
}

/* ═══════════════════════════════════════════════════════════════
   PREMIUM TRANSITIONS & ANIMATIONS
   ═══════════════════════════════════════════════════════════════ */

@keyframes scaleIn {
    0% { transform: scale(0.9); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes scaleOutBlurred {
    0% { transform: scale(1); filter: blur(0); opacity: 1; }
    100% { transform: scale(1.1); filter: blur(10px); opacity: 0; }
}

@keyframes slideUpFade {
    0% { transform: translateY(20px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

@keyframes drawCheck {
    0% { stroke-dashoffset: 48; }
    100% { stroke-dashoffset: 0; }
}

.animate-scale-in {
    animation: scaleIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-scale-out-blurred {
    animation: scaleOutBlurred 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-slide-up-fade {
    animation: slideUpFade 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Global App Transition Overlay */
.app-transition-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1.5rem;
    backdrop-blur: 10px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease, background-color 0.5s ease;
}

.app-transition-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.success-checkmark {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: block;
    stroke-width: 2;
    stroke: #10b981;
    stroke-miterlimit: 10;
    box-shadow: inset 0px 0px 0px #10b981;
    animation: fill .4s ease-in-out .4s forwards, scale .3s ease-in-out .9s both;
}

.success-checkmark__circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 2;
    stroke-miterlimit: 10;
    stroke: #10b981;
    fill: none;
    animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.success-checkmark__check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

@keyframes stroke {
    100% { stroke-dashoffset: 0; }
}

@keyframes scale {
    0%, 100% { transform: none; }
    50% { transform: scale3d(1.1, 1.1, 1); }
}

@keyframes fill {
    100% { box-shadow: inset 0px 0px 0px 30px rgba(16, 185, 129, 0.1); }
}

/* Global Page Entry */
#app.nav-transitioning {
    opacity: 0;
    transform: translateY(5px);
    transition: none;
}

#app.nav-ready {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.4s ease, transform 0.4s ease;
}


/* Clean Input Style for Tables */
.input-clean {
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    padding: 4px 8px !important;
    transition: all 0.2s ease !important;
}

.input-clean:focus {
    background-color: rgba(var(--primary-color-rgb), 0.05) !important;
    box-shadow: inset 0 0 0 1px rgba(var(--primary-color-rgb), 0.2) !important;
    border-radius: 4px !important;
}

.dark .input-clean:focus {
    background-color: rgba(255, 255, 255, 0.03) !important;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1) !important;
}
