/**
 * ═══════════════════════════════════════════════════════════════════════════
 * LINKSCOUT COMMAND CENTER — DAYLIGHT THEME
 * A polished, warm light interface with subtle depth and accent gradients
 * ═══════════════════════════════════════════════════════════════════════════
 */

/* ==========================================================================
   §1. DESIGN TOKENS — DAYLIGHT PALETTE
   ========================================================================== */
:root {
    /* ─── SURFACES ─── */
    --void-abyss: #eef1f6;
    --void-deep: #f4f6fa;
    --void-surface: #ffffff;
    --void-elevated: #ffffff;

    /* ─── ENERGY SPECTRUM (Vibrant accents for light backgrounds) ─── */
    --energy-violet: #7c3aed;
    --energy-violet-bright: #6d28d9;
    --energy-violet-glow: rgba(124, 58, 237, 0.15);
    --energy-violet-subtle: rgba(124, 58, 237, 0.06);

    --energy-cyan: #0891b2;
    --energy-cyan-bright: #0e7490;
    --energy-cyan-glow: rgba(8, 145, 178, 0.15);
    --energy-cyan-subtle: rgba(8, 145, 178, 0.06);

    --energy-magenta: #c026d3;
    --energy-magenta-glow: rgba(192, 38, 211, 0.15);

    /* ─── STATUS INDICATORS ─── */
    --status-online: #059669;
    --status-online-glow: rgba(5, 150, 105, 0.15);
    --status-warning: #d97706;
    --status-warning-glow: rgba(217, 119, 6, 0.15);
    --status-danger: #dc2626;
    --status-danger-glow: rgba(220, 38, 38, 0.15);
    --status-info: #2563eb;
    --status-info-glow: rgba(37, 99, 235, 0.15);

    /* ─── TEXT HIERARCHY ─── */
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-tertiary: #64748b;
    --text-ghost: #94a3b8;

    /* ─── GLASS SYSTEM → FROSTED PANELS ─── */
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-bg-solid: rgba(255, 255, 255, 0.95);
    --glass-border: #e2e8f0;
    --glass-border-light: #cbd5e1;
    --glass-border-active: #94a3b8;
    --glass-shine: none;

    /* ─── ACCENT GRADIENT ─── */
    --holo-gradient: linear-gradient(
        135deg,
        rgba(124, 58, 237, 0.05) 0%,
        rgba(8, 145, 178, 0.05) 50%,
        rgba(192, 38, 211, 0.05) 100%
    );

    /* ─── SHADOWS (Richer depth) ─── */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.07), 0 2px 6px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.08), 0 4px 10px rgba(0, 0, 0, 0.04);
    --shadow-glow-violet: 0 4px 16px rgba(124, 58, 237, 0.15);
    --shadow-glow-cyan: 0 4px 16px rgba(8, 145, 178, 0.15);

    /* ─── TIMING — Subtle, fast transitions ─── */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-in-out-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}


/* ==========================================================================
   §2. REDUCE (NOT KILL) ANIMATIONS — Keep subtle transitions
   ========================================================================== */
*,
*::before,
*::after {
    animation-duration: 0.3s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.15s !important;
}

/* Allow specific animations to loop */
.loader-pulse,
.loader-spinner,
.scroll-more-arrow,
.criticalPulse {
    animation-iteration-count: infinite !important;
}


/* ==========================================================================
   §3. BODY & BACKGROUND
   ========================================================================== */
body {
    background: linear-gradient(160deg, #eef1f6 0%, #e8ecf4 40%, #f0eef6 100%) !important;
    background-attachment: fixed !important;
    color: var(--text-primary);
}

/* Hide heavy effects but keep subtle depth */
#nebula-canvas,
.scanline-overlay,
#cursor-glow,
#nebula-dimmer {
    display: none !important;
}


/* ==========================================================================
   §4. SELECTION & SCROLLBARS
   ========================================================================== */
::selection {
    background: var(--energy-violet);
    color: white;
}

::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #c1c9d6;
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
    background-clip: content-box;
}


/* ==========================================================================
   §5. LINKS
   ========================================================================== */
a {
    color: var(--energy-violet);
}

a:hover {
    color: var(--energy-violet-bright);
    text-shadow: none;
}


/* ==========================================================================
   §6. AUTH CARD
   ========================================================================== */
#auth-layer {
    background: linear-gradient(160deg, #eef1f6, #e0e5ef, #eee8f4);
}

.auth-card {
    background: #ffffff;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(124, 58, 237, 0.05);
}

.auth-card::before,
.auth-card::after {
    display: none !important;
}

.auth-title {
    background: linear-gradient(135deg, var(--energy-violet), var(--energy-cyan)) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}

.auth-shield {
    filter: none;
}

.auth-footer {
    background: linear-gradient(to bottom, #f8fafc, #f1f5f9);
    border-top: 1px solid var(--glass-border);
}


/* ==========================================================================
   §7. SIDEBAR
   ========================================================================== */
.sidebar {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    backdrop-filter: none;
    border-right: 1px solid var(--glass-border);
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.03);
}

.sidebar::after {
    display: none !important;
}

.sidebar-header {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.04) 0%, rgba(8, 145, 178, 0.04) 100%);
    border-bottom: 1px solid var(--glass-border);
}

.sidebar-logo {
    color: var(--text-primary);
}

.sidebar-logo span:first-child {
    filter: none;
}

.nav-item {
    color: var(--text-secondary);
    border-radius: 8px;
    margin: 1px 8px;
}

.nav-item:hover {
    color: var(--text-primary);
    background: linear-gradient(90deg, rgba(124, 58, 237, 0.04), transparent);
}

.nav-item.active {
    color: var(--energy-violet);
    background: linear-gradient(90deg, rgba(124, 58, 237, 0.08) 0%, rgba(124, 58, 237, 0.02) 100%);
    border-left-color: var(--energy-violet);
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--energy-violet);
}

.nav-item.active::before {
    box-shadow: none;
}

.nav-badge {
    background: #e8ecf4;
    color: var(--text-secondary);
    font-weight: 600;
}

.nav-badge.alert-badge {
    background: var(--status-danger);
    color: white;
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.3);
}

.sidebar-footer {
    background: linear-gradient(to bottom, transparent, #f1f5f9);
    border-top: 1px solid var(--glass-border);
}

.status-indicator.status-ok {
    box-shadow: 0 0 6px rgba(5, 150, 105, 0.4);
}

.status-indicator.status-ok::after {
    display: none !important;
}


/* ==========================================================================
   §8. HEADER — COMMAND BAR
   ========================================================================== */
.top-header {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(12px) saturate(1.2);
    -webkit-backdrop-filter: blur(12px) saturate(1.2);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
}

.breadcrumb {
    color: var(--text-primary);
}

.connection-status {
    background: rgba(5, 150, 105, 0.06);
    border: 1px solid rgba(5, 150, 105, 0.15);
    border-radius: 20px;
}

.pulse-aura {
    display: none !important;
}

.user-menu {
    background: #f8fafc;
    border: 1px solid var(--glass-border);
    border-radius: 10px;
}

.user-menu:hover {
    background: #f1f5f9;
    border-color: var(--energy-violet-subtle);
    box-shadow: var(--shadow-sm);
}

.user-avatar,
.card-avatar,
.roster-avatar,
.result-avatar {
    border: 2px solid rgba(124, 58, 237, 0.12);
    box-shadow: var(--shadow-sm);
}

.user-avatar::after,
.card-avatar::after {
    display: none !important;
}

.user-role {
    color: var(--energy-violet);
    font-weight: 600;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-radius: 8px;
}

.btn-ghost:hover {
    background: rgba(124, 58, 237, 0.06);
    color: var(--energy-violet);
}


/* ==========================================================================
   §9. GLASS PANELS → FROSTED CARDS
   ========================================================================== */
.glass-panel,
.allowlist-panel {
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-sm);
}

.glass-panel::before,
.allowlist-panel::before {
    display: none !important;
}

.glass-panel-subtle,
.view-toolbar,
.allowlist-toolbar {
    background: linear-gradient(135deg, #f8fafc, #f4f6fa);
    border: 1px solid var(--glass-border);
}


/* ==========================================================================
   §10. FORM ELEMENTS
   ========================================================================== */
.glass-input,
.toolbar-select,
select {
    background: #ffffff;
    border: 1px solid var(--glass-border-light);
    color: var(--text-primary);
    border-radius: 8px;
}

.glass-input::placeholder {
    color: var(--text-ghost);
}

.glass-input:focus,
select:focus {
    border-color: var(--energy-violet);
    background: #ffffff;
    box-shadow: 0 0 0 3px var(--energy-violet-subtle), var(--shadow-sm);
}

select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px #ffffff inset !important;
    -webkit-text-fill-color: var(--text-primary) !important;
}


/* ==========================================================================
   §11. BUTTONS
   ========================================================================== */
.btn-primary {
    background: linear-gradient(135deg, var(--energy-violet), #6d28d9);
    color: white;
    border: none;
    box-shadow: var(--shadow-sm), 0 2px 8px rgba(124, 58, 237, 0.2);
}

.btn-primary:hover {
    box-shadow: var(--shadow-md), 0 4px 12px rgba(124, 58, 237, 0.3);
    transform: translateY(-1px);
}

.btn-primary::before {
    display: none !important;
}

.btn-accent {
    background: linear-gradient(135deg, var(--energy-cyan), #0e7490);
    color: white;
    border: none;
    box-shadow: var(--shadow-sm), 0 2px 8px rgba(8, 145, 178, 0.2);
}

.btn-accent:hover {
    box-shadow: var(--shadow-md), 0 4px 12px rgba(8, 145, 178, 0.3);
    transform: translateY(-1px);
}

.btn-outline {
    background: #ffffff;
    border: 1px solid var(--glass-border-light);
    color: var(--text-secondary);
}

.btn-outline:hover {
    border-color: var(--energy-violet);
    color: var(--energy-violet);
    background: rgba(124, 58, 237, 0.04);
    box-shadow: var(--shadow-sm);
}

.btn-danger {
    background: rgba(220, 38, 38, 0.06);
    color: var(--status-danger);
    border: 1px solid rgba(220, 38, 38, 0.15);
}

.btn-danger:hover {
    background: linear-gradient(135deg, var(--status-danger), #b91c1c);
    color: white;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}

.btn-warning {
    background: rgba(217, 119, 6, 0.06);
    color: var(--status-warning);
    border: 1px solid rgba(217, 119, 6, 0.15);
}

.btn-warning:hover {
    background: var(--status-warning);
    color: white;
}

.btn-success {
    background: rgba(5, 150, 105, 0.06);
    color: var(--status-online);
    border: 1px solid rgba(5, 150, 105, 0.15);
}

.btn-success:hover {
    background: var(--status-online);
    color: white;
}


/* ==========================================================================
   §12. DATA TABLES
   ========================================================================== */
.data-table th,
.allowlist-table th {
    color: var(--text-tertiary);
    border-bottom: 2px solid var(--glass-border);
    background: linear-gradient(to bottom, #f8fafc, #f4f6fa);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.72em;
    letter-spacing: 0.04em;
}

.data-table td,
.allowlist-table td {
    border-bottom: 1px solid #f1f5f9;
}

.data-table tbody tr:nth-child(even),
.allowlist-table tbody tr:nth-child(even) {
    background: rgba(248, 250, 252, 0.6);
}

.data-table tbody tr:hover,
.allowlist-table tbody tr:hover {
    background: rgba(124, 58, 237, 0.04);
}


/* ==========================================================================
   §13. STATUS BADGES & PILLS
   ========================================================================== */
.badge-status,
.badge {
    border: 1px solid currentColor;
    font-weight: 600;
}

.badge-allow,
.badge-ALLOW {
    background: rgba(5, 150, 105, 0.08);
    color: #059669;
    border-color: rgba(5, 150, 105, 0.2);
}

.badge-block,
.badge-BLOCK {
    background: rgba(220, 38, 38, 0.08);
    color: #dc2626;
    border-color: rgba(220, 38, 38, 0.2);
}

.badge-bypass {
    background: rgba(217, 119, 6, 0.08);
    color: #d97706;
    border-color: rgba(217, 119, 6, 0.2);
}


/* ==========================================================================
   §14. STAT CARDS & HEALTH CARDS
   ========================================================================== */
.report-stat-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-sm);
}

.report-stat-value {
    color: var(--energy-violet);
    font-weight: 700;
}

.health-card {
    background: linear-gradient(135deg, #ffffff, #fafbfc);
}


/* ==========================================================================
   §15. MODALS
   ========================================================================== */
.modal-backdrop {
    background: rgba(15, 23, 42, 0.3);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

dialog {
    border: 1px solid var(--glass-border) !important;
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(0,0,0,0.03) !important;
}

dialog::backdrop {
    background: rgba(15, 23, 42, 0.3) !important;
    backdrop-filter: blur(4px) !important;
    -webkit-backdrop-filter: blur(4px) !important;
}

.modal-content {
    background: #ffffff;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-lg);
}

.modal-content::before {
    display: none !important;
}

.modal-header {
    background: linear-gradient(to bottom, #f8fafc, #f4f6fa);
    border-bottom: 1px solid var(--glass-border);
}

.modal-footer {
    background: #f8fafc;
    border-top: 1px solid var(--glass-border);
}


/* ==========================================================================
   §16. TOASTS
   ========================================================================== */
.toast {
    background: #ffffff;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-lg);
    color: var(--text-primary);
    border-radius: 12px;
}

.toast::before {
    display: none !important;
}

.toast-success { border-left: 4px solid var(--status-online); }
.toast-error { border-left: 4px solid var(--status-danger); }
.toast-warning { border-left: 4px solid var(--status-warning); }
.toast-info { border-left: 4px solid var(--status-info); }


/* ==========================================================================
   §17. LOADER
   ========================================================================== */
#app-loader {
    background: linear-gradient(160deg, #eef1f6, #e8ecf4);
}

.loader-spinner {
    border-color: var(--glass-border);
    border-top-color: var(--energy-violet);
}


/* ==========================================================================
   §18. LIVE VIEW CARDS
   ========================================================================== */
.device-card {
    background: #ffffff;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-sm);
}

.device-card:hover {
    box-shadow: var(--shadow-md);
    border-color: rgba(124, 58, 237, 0.2);
    transform: translateY(-2px);
}

.device-card::before,
.device-card::after {
    display: none !important;
}

.device-card.device-selected {
    border-color: var(--energy-violet);
    box-shadow: var(--shadow-glow-violet);
}

.device-card .card-header {
    background: transparent;
}

.card-tag {
    background: #f1f5f9;
    color: var(--text-secondary);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
}


/* ==========================================================================
   §19. CLASSROOM VIEW
   ========================================================================== */
.class-card {
    background: #ffffff;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-sm);
}

.class-card:hover {
    box-shadow: var(--shadow-md);
    border-color: rgba(124, 58, 237, 0.15);
}

.class-card::before {
    display: none !important;
}

.class-details-section {
    background: #ffffff;
}


/* ==========================================================================
   §20. TABS
   ========================================================================== */
.tab-nav {
    border-bottom: 2px solid var(--glass-border);
}

.tab-btn {
    color: var(--text-secondary);
}

.tab-btn.active,
.tab-btn:hover {
    color: var(--energy-violet);
}

.tab-btn.active::after {
    background: var(--energy-violet);
    box-shadow: 0 2px 6px rgba(124, 58, 237, 0.3);
}


/* ==========================================================================
   §21. SETTING PANELS & TOGGLES
   ========================================================================== */
.setting-item {
    background: #f8fafc;
    border: 1px solid var(--glass-border);
}

.toggle-switch .toggle-track {
    background: #cbd5e1;
}

.toggle-switch .toggle-track.active,
.toggle-switch input:checked + .toggle-track,
.toggle-switch input:checked + .toggle-slider {
    background: var(--energy-violet);
    box-shadow: 0 2px 6px rgba(124, 58, 237, 0.3);
}


/* ==========================================================================
   §22. FLOATING ACTION BUTTON
   ========================================================================== */
.fab-trigger {
    background: linear-gradient(135deg, var(--energy-violet), #6d28d9);
    box-shadow: var(--shadow-md), 0 4px 12px rgba(124, 58, 237, 0.25);
}

.fab-trigger:hover {
    box-shadow: var(--shadow-lg), 0 6px 20px rgba(124, 58, 237, 0.35);
    transform: scale(1.05);
}

.fab-menu {
    background: #ffffff;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-lg);
    border-radius: 12px;
}


/* ==========================================================================
   §23. DROPDOWN MENUS
   ========================================================================== */
.dropdown-menu {
    background: #ffffff;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-lg);
    border-radius: 10px;
}

.dropdown-item:hover {
    background: rgba(124, 58, 237, 0.06);
}


/* ==========================================================================
   §24. EMPTY STATES
   ========================================================================== */
.empty-state {
    color: var(--text-tertiary);
}


/* ==========================================================================
   §25. CRITICAL / ALERT STATES
   ========================================================================== */
.alert-critical {
    background: rgba(220, 38, 38, 0.06);
    border: 1px solid rgba(220, 38, 38, 0.15);
    border-left: 4px solid var(--status-danger);
}

.alert-warning {
    background: rgba(217, 119, 6, 0.06);
    border: 1px solid rgba(217, 119, 6, 0.15);
    border-left: 4px solid var(--status-warning);
}


/* ==========================================================================
   §26. OU TABLE
   ========================================================================== */
.ou-table-header {
    background: linear-gradient(to bottom, #f8fafc, #f4f6fa);
}


/* ==========================================================================
   §27. THEME TOGGLE BUTTON
   ========================================================================== */
#btn-theme-toggle {
    font-size: 1rem;
    min-width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
}


/* ==========================================================================
   §28. SCROLL MORE INDICATOR (light theme)
   ========================================================================== */
.scroll-more-indicator {
    background: linear-gradient(transparent 0%, rgba(0,0,0,0.01) 60%, rgba(0,0,0,0.03) 100%);
}


/* ==========================================================================
   §29. BREADCRUMB TITLE
   ========================================================================== */
.top-header .breadcrumb span:first-child {
    filter: none;
}


/* ==========================================================================
   §30. CHARTS (Ensure readable axes on light bg)
   ========================================================================== */
.metrics-chart-body canvas {
    filter: none;
}


/* ==========================================================================
   §31. PRINT-FRIENDLY
   ========================================================================== */
@media print {
    .sidebar, .top-header, #nebula-canvas, .scanline-overlay {
        display: none !important;
    }
    .main-wrapper {
        margin-left: 0 !important;
    }
}
