/**
 * NeoGuard Admin - Shared Cyber Aesthetics & Animations
 * Aligned with index.php, download.php, and banned.php
 * Smooth cubic-bezier(0.16, 1, 0.3, 1) transitions & keyframes
 */

:root {
    --cyber-bg: #080c07;
    --cyber-card: rgba(13, 18, 12, 0.85);
    --cyber-card-solid: #0d120c;
    --cyber-border: rgba(38, 51, 33, 0.85);
    --cyber-border-glow: rgba(34, 197, 94, 0.4);
    --cyber-green: #22c55e;
    --cyber-green-light: #4ade80;
    --cyber-green-dim: rgba(34, 197, 94, 0.12);
    --cyber-text: #e3e7e2;
    --cyber-muted: #7d9178;
    --ease-cyber: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Fluid Entrance Keyframes (Framer Motion / GSAP Style) ── */
@keyframes cardFadeInUp {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes cyberPulseGlow {
    0%, 100% {
        opacity: 1;
        filter: drop-shadow(0 0 6px rgba(34, 197, 94, 0.6));
    }
    50% {
        opacity: 0.7;
        filter: drop-shadow(0 0 2px rgba(34, 197, 94, 0.2));
    }
}

.fade-in-item {
    animation: cardFadeInUp 0.42s var(--ease-cyber) backwards;
    animation-delay: calc(var(--stagger, 0) * 35ms);
}

/* ── Microinteractions: Modern Buttons ── */
.modern-btn {
    transition: all 0.3s var(--ease-cyber) !important;
    will-change: transform, box-shadow;
    cursor: pointer;
}

.modern-btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 20px -2px rgba(34, 197, 94, 0.25);
}

.modern-btn:active {
    transform: translateY(0) scale(0.99);
}

.modern-btn-danger {
    transition: all 0.3s var(--ease-cyber) !important;
    will-change: transform, box-shadow;
    cursor: pointer;
}

.modern-btn-danger:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 20px -2px rgba(239, 68, 68, 0.3);
}

.modern-btn-danger:active {
    transform: translateY(0) scale(0.99);
}

.modern-btn-warning {
    transition: all 0.3s var(--ease-cyber) !important;
    will-change: transform, box-shadow;
    cursor: pointer;
}

.modern-btn-warning:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 20px -2px rgba(234, 179, 8, 0.25);
}

.modern-btn-warning:active {
    transform: translateY(0) scale(0.99);
}

/* ── Cyber Glass Cards & Panels ── */
.cyber-card {
    background: rgba(13, 18, 12, 0.82) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(38, 51, 33, 0.85) !important;
    transition: all 0.3s var(--ease-cyber);
}

.cyber-card-hover {
    transition: all 0.3s var(--ease-cyber) !important;
}

.cyber-card-hover:hover {
    transform: translateY(-2px);
    border-color: rgba(34, 197, 94, 0.4) !important;
    box-shadow: 0 10px 30px -4px rgba(0, 0, 0, 0.7), 0 0 20px -5px rgba(34, 197, 94, 0.15) !important;
}

/* ── Top Bar, Header & Dropdown Stacking Context (Guarantees dropdowns stay on top) ── */
header.cyber-card,
header {
    position: relative !important;
    z-index: 50 !important;
}

main {
    position: relative !important;
    z-index: 1 !important;
}

#lang-switcher-dropdown {
    position: relative !important;
    z-index: 60 !important;
}

#lang-dropdown-options {
    position: absolute !important;
    z-index: 99999 !important;
    background-color: #0c120b !important;
    border: 1px solid rgba(38, 51, 33, 0.95) !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.98), 0 0 15px rgba(34, 197, 94, 0.25) !important;
}

/* ── Top Bar & Mobile Header ── */
.cyber-mobile-topbar {
    background: rgba(8, 12, 7, 0.92) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
    border-bottom: 1px solid rgba(38, 51, 33, 0.85) !important;
}

/* ── Sidebar & Navigation ── */
.cyber-sidebar {
    background: rgba(9, 13, 8, 0.96) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border-right: 1px solid rgba(38, 51, 33, 0.85) !important;
    transition: transform 0.3s var(--ease-cyber) !important;
}

.cyber-nav-item {
    transition: all 0.25s var(--ease-cyber) !important;
    position: relative;
}

.cyber-nav-item:hover:not(.active) {
    background: rgba(24, 33, 21, 0.5) !important;
    color: #e3e7e2 !important;
    transform: translateX(3px);
}

.cyber-nav-item.active {
    background: rgba(34, 197, 94, 0.12) !important;
    border-left: 2px solid #22c55e !important;
    color: #22c55e !important;
    box-shadow: inset 4px 0 12px -2px rgba(34, 197, 94, 0.18);
}

/* ── Table Row Transitions ── */
.cyber-table-row {
    transition: background-color 0.2s var(--ease-cyber), transform 0.2s var(--ease-cyber);
}

.cyber-table-row:hover {
    background-color: rgba(34, 197, 94, 0.05) !important;
}

/* ── Inputs & Focus States ── */
.cyber-input {
    background: #080c07 !important;
    border: 1px solid rgba(38, 51, 33, 0.85) !important;
    color: #e3e7e2 !important;
    transition: all 0.25s var(--ease-cyber);
}

.cyber-input:focus {
    border-color: #22c55e !important;
    box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.5), 0 0 16px rgba(34, 197, 94, 0.2) !important;
    outline: none !important;
}

/* ── Scrollbars ── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #080c07;
}

::-webkit-scrollbar-thumb {
    background: #272f24;
    border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
    background: #22c55e;
}

.cyber-scroll {
    scrollbar-width: thin;
    scrollbar-color: #272f24 #080c07;
    -webkit-overflow-scrolling: touch;
}

.cyber-scroll::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

.cyber-scroll::-webkit-scrollbar-track {
    background: #080c07;
}

.cyber-scroll::-webkit-scrollbar-thumb {
    background: #272f24;
    border-radius: 2px;
}

.cyber-scroll::-webkit-scrollbar-thumb:hover {
    background: #22c55e;
}

/* ── Modals & Overlays ── */
.cyber-modal-overlay {
    transition: opacity 0.3s var(--ease-cyber);
}

.cyber-modal-content {
    transition: transform 0.3s var(--ease-cyber), opacity 0.3s var(--ease-cyber);
}

/* ── Robust Threat Modal Architecture (Never exceeds viewport, header & close button always reachable) ── */
.cyber-modal-container {
    display: flex !important;
    align-items: flex-start !important;
    justify-content: center !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 10px !important;
}

@media (min-width: 640px) {
    .cyber-modal-container {
        align-items: center !important;
        padding: 24px !important;
    }
}

#imgModal .modal-content {
    max-height: calc(100dvh - 24px) !important;
    max-height: calc(100vh - 24px) !important;
}

.threat-modal-overlay {
    position: fixed !important;
    inset: 0 !important;
    z-index: 9999 !important;
    background: rgba(3, 7, 3, 0.88) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 24px 16px !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.threat-modal-window {
    width: 100% !important;
    max-width: 580px !important;
    max-height: 82vh !important;
    background: #0b110a !important;
    border: 1px solid rgba(34, 197, 94, 0.35) !important;
    border-radius: 14px !important;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.95), 0 0 30px -5px rgba(34, 197, 94, 0.2) !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    position: relative !important;
    margin: auto !important;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

@media (max-width: 640px) {
    .threat-modal-overlay {
        padding: 20px 12px !important;
    }
    .threat-modal-window {
        max-width: 100% !important;
        max-height: 80vh !important;
        border-radius: 12px !important;
    }
}

.threat-modal-header {
    flex-shrink: 0 !important;
    background: #0d150b !important;
    border-bottom: 1px solid rgba(38, 51, 33, 0.9) !important;
    padding: 12px 16px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
    z-index: 10 !important;
}

.threat-modal-body {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain !important;
    padding: 14px 16px !important;
}

.threat-modal-footer {
    flex-shrink: 0 !important;
    background: #080d07 !important;
    border-top: 1px solid rgba(38, 51, 33, 0.9) !important;
    padding: 12px 16px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    z-index: 10 !important;
}

.threat-terminal-pre {
    background: #040704 !important;
    padding: 12px !important;
    font-family: 'JetBrains Mono', monospace !important;
    font-size: 10px !important;
    line-height: 1.45 !important;
    color: #d1e2cf !important;
    white-space: pre !important;
    overflow-x: auto !important;
    overflow-y: auto !important;
    max-height: 220px !important;
    border-radius: 0 0 8px 8px !important;
}

@media (min-width: 640px) {
    .threat-terminal-pre {
        max-height: 270px !important;
        padding: 14px !important;
        font-size: 11px !important;
    }
}

/* ── Pulse dot indicator ── */
.cyber-live-dot {
    animation: cyberPulseGlow 2s infinite ease-in-out;
}
