/* ============================================================================
   SITE INTEL - INTELLIGENCE PLATFORM THEME SYSTEM
   Inspired by: Palantir Foundry, Anduril Lattice, Bloomberg Terminal
   ============================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

/* ============================================================================
   THEME VARIABLES - DARK MODE (PRIMARY)
   ============================================================================ */

:root[data-theme="dark"] {
    /* Backgrounds */
    --bg-primary: #0B0B0B;
    --bg-panel: #111111;
    --bg-panel-secondary: #161616;
    --bg-hover: #1A1A1A;
    --bg-active: #202020;

    /* Borders */
    --border-primary: #333333;
    --border-hover: #444444;
    --border-accent: #4A9EFF;

    /* Text */
    --text-primary: #E6E6E6;
    --text-secondary: #9CA3AF;
    --text-muted: #6B7280;
    --text-inverse: #111111;

    /* Accents */
    --accent-cyan: #06B6D4;
    --accent-amber: #F59E0B;
    --accent-green: #10B981;
    --accent-red: #EF4444;
    --accent-signal: #4A9EFF;

    /* System */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(74, 158, 255, 0.2);

    /* Grid */
    --grid-line: rgba(51, 51, 51, 0.5);
}

/* ============================================================================
   THEME VARIABLES - LIGHT MODE
   ============================================================================ */

:root[data-theme="light"] {
    /* Backgrounds */
    --bg-primary: #FAFAFA;
    --bg-panel: #FFFFFF;
    --bg-panel-secondary: #F5F5F5;
    --bg-hover: #F0F0F0;
    --bg-active: #E8E8E8;

    /* Borders */
    --border-primary: #D4D4D4;
    --border-hover: #B8B8B8;
    --border-accent: #2563EB;

    /* Text */
    --text-primary: #111111;
    --text-secondary: #4B5563;
    --text-muted: #6B7280;
    --text-inverse: #FFFFFF;

    /* Accents */
    --accent-cyan: #0891B2;
    --accent-amber: #D97706;
    --accent-green: #059669;
    --accent-red: #DC2626;
    --accent-signal: #2563EB;

    /* System */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 20px rgba(37, 99, 235, 0.15);

    /* Grid */
    --grid-line: rgba(212, 212, 212, 0.5);
}

/* Default to dark mode */
:root {
    --bg-primary: #0B0B0B;
    --bg-panel: #111111;
    --bg-panel-secondary: #161616;
    --bg-hover: #1A1A1A;
    --bg-active: #202020;
    --border-primary: #333333;
    --border-hover: #444444;
    --border-accent: #4A9EFF;
    --text-primary: #E6E6E6;
    --text-secondary: #9CA3AF;
    --text-muted: #6B7280;
    --text-inverse: #111111;
    --accent-cyan: #06B6D4;
    --accent-amber: #F59E0B;
    --accent-green: #10B981;
    --accent-red: #EF4444;
    --accent-signal: #4A9EFF;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(74, 158, 255, 0.2);
    --grid-line: rgba(51, 51, 51, 0.5);
}

/* ============================================================================
   TYPOGRAPHY SYSTEM
   ============================================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.2s ease, color 0.2s ease;
}

/* Monospace for metrics and data */
.metric, .timestamp, .coordinate, .code {
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

h1 { font-size: 28px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
h4 { font-size: 14px; }
h5 { font-size: 13px; }
h6 { font-size: 12px; }

/* ============================================================================
   LAYOUT SYSTEM
   ============================================================================ */

.app-container {
    display: flex;
    min-height: 100vh;
    background: var(--bg-primary);
}

.app-sidebar {
    width: 240px;
    background: var(--bg-panel);
    border-right: 1px solid var(--border-primary);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 100;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Collapsed State (Desktop) */
.app-sidebar.collapsed {
    width: 60px;
}

/* Hide text content when collapsed */
.app-sidebar.collapsed .nav-brand-title,
.app-sidebar.collapsed .nav-brand-subtitle,
.app-sidebar.collapsed .nav-section-label,
.app-sidebar.collapsed .nav-item span:not(.nav-icon),
.app-sidebar.collapsed .nav-badge,
.app-sidebar.collapsed .panel-footer .system-status span:not(.sidebar-collapse-inline-btn),
.app-sidebar.collapsed .panel-footer .timestamp {
    opacity: 0;
    pointer-events: none;
}

/* Keep collapse button visible when collapsed, but hide it */
.app-sidebar.collapsed .sidebar-collapse-inline-btn {
    display: none;
}

/* Adjust system status when collapsed */
.app-sidebar.collapsed .system-status {
    justify-content: center;
    padding: 6px;
}

/* Center icons when collapsed */
.app-sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 10px;
}

.app-sidebar.collapsed .nav-brand {
    align-items: center;
    justify-content: center;
    padding: 20px 10px;
}

.app-sidebar.collapsed .nav-brand-title {
    justify-content: center;
}

/* Rotate chevron when collapsed */
.app-sidebar.collapsed .sidebar-collapse-btn .collapse-chevron {
    transform: rotate(180deg);
}

.app-main {
    flex: 1;
    margin-left: 240px;
    padding: 24px;
    max-width: 100%;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Adjust main content when sidebar is collapsed (desktop only) */
@media (min-width: 969px) {
    .app-sidebar.collapsed ~ .app-main {
        margin-left: 60px;
    }
}

/* ============================================================================
   NAVIGATION COMPONENTS
   ============================================================================ */

/* Inline Collapse Button (in system status) */
.sidebar-collapse-inline-btn {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    opacity: 0.6;
}

.sidebar-collapse-inline-btn:hover {
    background: var(--bg-hover);
    color: var(--accent-cyan);
    opacity: 1;
}

.sidebar-collapse-inline-btn svg {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Floating Expand Button (when sidebar collapsed) */
.sidebar-expand-fab {
    position: fixed;
    left: 12px;
    bottom: 20px;
    width: 40px;
    height: 40px;
    background: var(--bg-panel);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.sidebar-expand-fab:hover {
    background: var(--bg-hover);
    border-color: var(--border-accent);
    color: var(--accent-signal);
    transform: translateX(2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.sidebar-expand-fab:active {
    transform: translateX(2px) scale(0.95);
}

/* Show chevron on desktop, hide hamburger */
.sidebar-expand-fab .fab-hamburger {
    display: none;
}

.sidebar-expand-fab .fab-chevron {
    display: block;
}

/* Sidebar Backdrop (Mobile) */
.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
    z-index: 99;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.nav-brand {
    padding: 20px 16px;
    border-bottom: 1px solid var(--border-primary);
    transition: all 0.3s ease;
}

.nav-brand-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-brand-subtitle {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

.nav-section {
    padding: 16px 12px;
}

.nav-section-label {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.08em;
    padding: 0 8px 8px 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 4px;
    margin-bottom: 2px;
    transition: all 0.15s ease;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid transparent;
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-primary);
}

.nav-item.active {
    background: var(--bg-active);
    color: var(--accent-signal);
    border-color: var(--border-accent);
}

/* Locked navigation items */
.nav-section-locked {
    opacity: 0.5;
}

.nav-item-locked {
    cursor: not-allowed;
    pointer-events: none;
    opacity: 0.6;
}

.nav-item-locked:hover {
    background: transparent;
    color: var(--text-secondary);
    border-color: transparent;
}

.nav-section-label .lock-icon {
    display: inline-block;
    vertical-align: middle;
}

.nav-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.nav-badge {
    margin-left: auto;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: 600;
    background: var(--bg-tertiary);
    color: var(--text-muted);
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
    font-family: 'IBM Plex Mono', monospace;
    transition: all 0.15s ease;
}

.nav-item:hover .nav-badge {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item.active .nav-badge {
    background: var(--accent-signal);
    color: white;
}

/* ============================================================================
   INTELLIGENCE PANEL SYSTEM
   ============================================================================ */

.intelligence-panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    overflow: hidden;
    transition: border-color 0.15s ease;
}

.intelligence-panel:hover {
    border-color: var(--border-hover);
}

.panel-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-panel-secondary);
}

.panel-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-subtitle {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
}

.panel-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.panel-body {
    padding: 16px;
}

.panel-body-dense {
    padding: 12px;
}

.panel-footer {
    padding: 10px 16px;
    border-top: 1px solid var(--border-primary);
    background: var(--bg-panel-secondary);
    font-size: 12px;
    color: var(--text-muted);
}

/* ============================================================================
   DATA GRID & TABLES
   ============================================================================ */

.data-grid {
    display: grid;
    gap: 16px;
}

.data-grid-2 { grid-template-columns: repeat(2, 1fr); }
.data-grid-3 { grid-template-columns: repeat(3, 1fr); }
.data-grid-4 { grid-template-columns: repeat(4, 1fr); }

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table thead {
    background: var(--bg-panel-secondary);
    border-top: 1px solid var(--border-primary);
    border-bottom: 1px solid var(--border-primary);
}

.data-table th {
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-primary);
    color: var(--text-primary);
}

.data-table tr:hover td {
    background: var(--bg-hover);
}

.data-table tr:last-child td {
    border-bottom: none;
}

/* ============================================================================
   METRIC DISPLAYS
   ============================================================================ */

.metric-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    padding: 16px;
    transition: all 0.15s ease;
}

.metric-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-sm);
}

.metric-label {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
}

.metric-value {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 28px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.metric-sublabel {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.metric-change {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 6px;
}

.metric-change.positive { color: var(--accent-green); }
.metric-change.negative { color: var(--accent-red); }

/* ============================================================================
   BUTTONS & CONTROLS
   ============================================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid var(--border-primary);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    background: var(--bg-panel);
    color: var(--text-primary);
}

.btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-hover);
}

.btn-primary {
    background: var(--accent-signal);
    color: var(--text-inverse);
    border-color: var(--accent-signal);
}

.btn-primary:hover {
    background: var(--border-accent);
    box-shadow: var(--shadow-glow);
}

.btn-danger {
    border-color: var(--accent-red);
    color: var(--accent-red);
}

.btn-danger:hover {
    background: var(--accent-red);
    color: var(--text-inverse);
}

.btn-sm {
    padding: 6px 10px;
    font-size: 12px;
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================================================
   FORM ELEMENTS
   ============================================================================ */

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-panel);
    border: 1px solid var(--border-primary);
    border-radius: 4px;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    transition: all 0.15s ease;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--border-accent);
    box-shadow: 0 0 0 2px rgba(74, 158, 255, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
    font-family: 'IBM Plex Mono', monospace;
}

/* ============================================================================
   STATUS INDICATORS
   ============================================================================ */

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 3px;
    border: 1px solid;
}

.status-badge.active {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--accent-green);
    color: var(--accent-green);
}

.status-badge.pending {
    background: rgba(245, 158, 11, 0.1);
    border-color: var(--accent-amber);
    color: var(--accent-amber);
}

.status-badge.error {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--accent-red);
    color: var(--accent-red);
}

.status-badge.info {
    background: rgba(74, 158, 255, 0.1);
    border-color: var(--accent-signal);
    color: var(--accent-signal);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.active { background: var(--accent-green); }
.status-dot.pending { background: var(--accent-amber); }
.status-dot.error { background: var(--accent-red); }
.status-dot.info { background: var(--accent-signal); }

/* ============================================================================
   THEME TOGGLE
   ============================================================================ */

.theme-toggle {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 40px;
    height: 40px;
    background: var(--bg-panel);
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    z-index: 1000;
}

.theme-toggle:hover {
    border-color: var(--border-accent);
    box-shadow: var(--shadow-glow);
}

/* ============================================================================
   UTILITY CLASSES
   ============================================================================ */

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-cyan { color: var(--accent-cyan); }
.text-amber { color: var(--accent-amber); }
.text-green { color: var(--accent-green); }
.text-red { color: var(--accent-red); }

.border-top { border-top: 1px solid var(--border-primary); }
.border-bottom { border-bottom: 1px solid var(--border-primary); }
.border-left { border-left: 1px solid var(--border-primary); }
.border-right { border-right: 1px solid var(--border-primary); }

.mb-4 { margin-bottom: 4px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }

.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

@media (max-width: 968px) {
    /* Mobile: Sidebar becomes overlay */
    .app-sidebar {
        width: 240px;
        box-shadow: var(--shadow-lg);
    }

    .app-sidebar.collapsed {
        transform: translateX(-100%);
        width: 240px;
    }

    /* Mobile: Position FAB as hamburger menu in top-left */
    .sidebar-expand-fab {
        left: 16px;
        top: 16px;
        bottom: auto;
        width: 48px;
        height: 48px;
        border-radius: 10px;
    }

    /* Show hamburger on mobile, hide chevron */
    .sidebar-expand-fab .fab-chevron {
        display: none;
    }

    .sidebar-expand-fab .fab-hamburger {
        display: block;
    }

    /* Show backdrop on mobile */
    .sidebar-backdrop {
        display: block;
    }

    .app-main {
        margin-left: 0;
        padding: 16px;
        width: 100%;
    }

    .data-grid-2, .data-grid-3, .data-grid-4 {
        grid-template-columns: 1fr;
    }
}

/* ============================================================================
   ANIMATIONS
   ============================================================================ */

@keyframes pulse-slow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes sweep {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.animate-pulse-slow {
    animation: pulse-slow 3s ease-in-out infinite;
}

.animate-rotate {
    animation: rotate 20s linear infinite;
}

/* ============================================================================
   SCROLLBAR STYLING
   ============================================================================ */

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

::-webkit-scrollbar-track {
    background: var(--bg-panel);
}

::-webkit-scrollbar-thumb {
    background: var(--border-primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-hover);
}

/* ============================================================================
   CUSTOM SVG ICON SYSTEM
   ============================================================================ */

.custom-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    vertical-align: middle;
}

.custom-icon svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.custom-icon-lg {
    width: 48px;
    height: 48px;
}

.custom-icon-xl {
    width: 64px;
    height: 64px;
}

/* Icon animations */
.icon-pulse {
    animation: icon-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes icon-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.icon-rotate {
    animation: icon-rotate 3s linear infinite;
}

@keyframes icon-rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.icon-sweep {
    animation: icon-sweep 4s ease-in-out infinite;
}

@keyframes icon-sweep {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* ============================================================================
   INTELLIGENCE DATA VISUALIZATIONS
   ============================================================================ */

.data-viz-panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    padding: 16px;
    position: relative;
    overflow: hidden;
}

.data-viz-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 20px,
        var(--grid-line) 20px,
        var(--grid-line) 21px
    ),
    repeating-linear-gradient(
        0deg,
        transparent,
        transparent 20px,
        var(--grid-line) 20px,
        var(--grid-line) 21px
    );
    opacity: 0.3;
    pointer-events: none;
}

.radar-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.signal-line {
    stroke: var(--accent-cyan);
    stroke-width: 2;
    fill: none;
    animation: signal-flow 2s ease-in-out infinite;
}

@keyframes signal-flow {
    0%, 100% {
        stroke-dashoffset: 0;
    }
    50% {
        stroke-dashoffset: 20;
    }
}

/* ============================================================================
   SYSTEM STATUS INDICATORS
   ============================================================================ */

.system-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: var(--bg-panel-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 4px;
    font-size: 12px;
    font-family: 'IBM Plex Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    width: 100%;
}

.system-status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-green);
    animation: status-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes status-pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

.system-status-indicator.warning {
    background: var(--accent-amber);
}

.system-status-indicator.error {
    background: var(--accent-red);
}

.system-status-indicator.offline {
    background: var(--text-muted);
    animation: none;
}

/* ============================================================================
   TECHNICAL CARDS & MODULES
   ============================================================================ */

.tech-module {
    background: var(--bg-panel);
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.tech-module:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
}

.tech-module-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-panel-secondary);
    border-bottom: 1px solid var(--border-primary);
}

.tech-module-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.tech-module-body {
    padding: 16px;
}

.tech-module-footer {
    padding: 10px 16px;
    background: var(--bg-panel-secondary);
    border-top: 1px solid var(--border-primary);
    font-size: 11px;
    color: var(--text-muted);
    font-family: 'IBM Plex Mono', monospace;
}

/* ============================================================================
   COORDINATE & LOCATION DISPLAYS
   ============================================================================ */

.coordinate-display {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    color: var(--text-secondary);
    background: var(--bg-panel-secondary);
    padding: 8px 12px;
    border: 1px solid var(--border-primary);
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.coordinate-label {
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.coordinate-value {
    color: var(--accent-cyan);
    font-weight: 500;
}

/* ============================================================================
   TIMELINE COMPONENTS
   ============================================================================ */

.timeline {
    position: relative;
    padding-left: 32px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-primary);
}

.timeline-item {
    position: relative;
    padding-bottom: 24px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -28px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--bg-panel);
    border: 2px solid var(--accent-signal);
    box-shadow: 0 0 0 4px var(--bg-panel);
}

.timeline-item.active::before {
    background: var(--accent-signal);
    animation: timeline-pulse 2s ease-in-out infinite;
}

@keyframes timeline-pulse {
    0%, 100% {
        box-shadow: 0 0 0 4px var(--bg-panel), 0 0 0 8px rgba(74, 158, 255, 0);
    }
    50% {
        box-shadow: 0 0 0 4px var(--bg-panel), 0 0 0 8px rgba(74, 158, 255, 0.4);
    }
}

.timeline-time {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.timeline-content {
    font-size: 13px;
    color: var(--text-primary);
}

/* ============================================================================
   NETWORK NODE VISUALIZATIONS
   ============================================================================ */

.node-network {
    position: relative;
    width: 100%;
    height: 200px;
}

.network-node {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent-cyan);
    border: 2px solid var(--bg-panel);
    box-shadow: 0 0 8px var(--accent-cyan);
    animation: node-pulse 3s ease-in-out infinite;
}

.network-node.primary {
    width: 16px;
    height: 16px;
    background: var(--accent-signal);
    box-shadow: 0 0 12px var(--accent-signal);
}

@keyframes node-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

.network-connection {
    position: absolute;
    height: 1px;
    background: var(--border-primary);
    transform-origin: left center;
    opacity: 0.5;
}

/* ============================================================================
   DATA DENSITY & INFO DISPLAYS
   ============================================================================ */

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-primary);
    font-size: 13px;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.info-value {
    color: var(--text-primary);
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 500;
}

.info-value.highlight {
    color: var(--accent-cyan);
}

/* ============================================================================
   RADAR SWEEP ANIMATIONS
   ============================================================================ */

.radar-sweep-container {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 1px solid var(--border-primary);
    overflow: hidden;
}

.radar-sweep {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    transform-origin: center;
    animation: radar-sweep-rotate 3s linear infinite;
}

@keyframes radar-sweep-rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.radar-grid {
    position: absolute;
    inset: 0;
    border-radius: 50%;
}

.radar-grid circle {
    stroke: var(--border-primary);
    stroke-width: 1;
    fill: none;
}

/* ============================================================================
   WAVEFORM PATTERNS
   ============================================================================ */

.waveform-container {
    width: 100%;
    height: 60px;
    position: relative;
    overflow: hidden;
}

.waveform {
    stroke: var(--accent-cyan);
    stroke-width: 2;
    fill: none;
    opacity: 0.8;
}

.waveform-overlay {
    stroke: var(--accent-signal);
    stroke-width: 1.5;
    fill: none;
    opacity: 0.6;
    animation: waveform-flow 3s ease-in-out infinite;
}

@keyframes waveform-flow {
    0%, 100% {
        stroke-dashoffset: 0;
    }
    50% {
        stroke-dashoffset: 40;
    }
}

/* ============================================================================
   MAPBOX GL POPUP OVERRIDES - LIGHT & DARK MODE
   ============================================================================ */

/* Popup Container */
.mapboxgl-popup-content {
    background: var(--bg-panel) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-primary) !important;
    border-radius: 6px !important;
    padding: 12px !important;
    box-shadow: var(--shadow-lg) !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    font-size: 13px !important;
    line-height: 1.5 !important;
}

/* Popup Tip (Arrow) */
.mapboxgl-popup-tip {
    border-top-color: var(--bg-panel) !important;
    border-bottom-color: var(--bg-panel) !important;
    border-left-color: var(--bg-panel) !important;
    border-right-color: var(--bg-panel) !important;
}

/* Close Button */
.mapboxgl-popup-close-button {
    color: var(--text-secondary) !important;
    font-size: 20px !important;
    padding: 0 !important;
    width: 24px !important;
    height: 24px !important;
    border-radius: 4px !important;
    transition: all 0.2s !important;
}

.mapboxgl-popup-close-button:hover {
    background: var(--bg-hover) !important;
    color: var(--text-primary) !important;
}

/* Popup Typography Classes */
.popup-title,
.mapboxgl-popup strong {
    color: var(--text-primary) !important;
    font-weight: 600 !important;
    font-size: 14px !important;
}

.popup-subtitle,
.mapboxgl-popup small {
    color: var(--text-secondary) !important;
    font-size: 12px !important;
}

.popup-muted {
    color: var(--text-muted) !important;
    font-size: 11px !important;
}

.popup-coords {
    color: var(--text-secondary) !important;
    font-family: 'IBM Plex Mono', monospace !important;
    font-size: 11px !important;
}

.popup-info {
    color: var(--text-secondary) !important;
    font-size: 12px !important;
    margin-top: 4px !important;
}

/* Feature Popup (Dataset Details) */
.feature-popup {
    min-width: 200px;
}

.feature-popup-title {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-primary);
}

.feature-popup-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 0;
    font-size: 12px;
}

.feature-popup-key {
    color: var(--text-secondary);
    font-weight: 500;
}

.feature-popup-value {
    color: var(--text-primary);
    font-weight: 400;
    text-align: right;
}

/* Hover Tooltip (Non-clickable) */
.mapboxgl-popup.hover-tooltip .mapboxgl-popup-content {
    padding: 8px 12px !important;
    background: var(--bg-panel-secondary) !important;
    border: 1px solid var(--border-primary) !important;
    font-size: 12px !important;
}

.mapboxgl-popup.hover-tooltip .mapboxgl-popup-tip {
    border-top-color: var(--bg-panel-secondary) !important;
    border-bottom-color: var(--bg-panel-secondary) !important;
    border-left-color: var(--bg-panel-secondary) !important;
    border-right-color: var(--bg-panel-secondary) !important;
}
