/* ================================================================
   MONARCH QUANTITATIVE SUITE | MODULE: STYLESHEET v9.0
   THEME: JARVIS FLIGHT TELEMETRY (HUD / Tech / High-Contrast)
   AUTHOR: Chidozie Daniels (Vetiva)
   ================================================================ */

:root {
    /* --- HUD PALETTE --- */
    --hud-bg: #000000;           /* Absolute Void */
    --hud-panel: rgba(10, 12, 16, 0.85); /* Glassy Panel */
    --hud-border: #1f2937;       /* Structure Lines */

    --gold-primary: #FFD700;     /* Core Systems */
    --gold-dim: rgba(255, 215, 0, 0.3);
    --gold-glow: rgba(255, 215, 0, 0.15);

    --text-bright: #ffffff;
    --text-mid: #9ca3af;
    --text-dark: #4b5563;

    --signal-green: #10b981;
    --signal-red: #ef4444;

    --font-ui: 'Inter', system-ui, sans-serif;
    --font-data: 'Roboto Mono', 'Consolas', monospace;
}

/* --- 1. GLOBAL CONTAINER & TELEMETRY GRID --- */
#geometry-view {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    min-height: 600px;
    background-color: var(--hud-bg);
    /* Subtle Telemetry Grid Background */
    background-image:
        linear-gradient(rgba(255, 215, 0, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 215, 0, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    font-family: var(--font-ui);
    color: var(--text-bright);
    overflow: hidden;
    position: relative;
}

#geometry-view * { box-sizing: border-box; outline: none; user-select: none; }

/* --- 2. COMMAND HEADER (The Flight Deck) --- */
#geometry-view .monarch-header {
    height: 52px;
    background: rgba(5, 5, 5, 0.95);
    border-bottom: 1px solid var(--gold-dim);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    flex-shrink: 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    z-index: 100;
}

#geometry-view .brand-section {
    display: flex; align-items: baseline; gap: 8px; width: 220px;
    border-right: 1px solid var(--hud-border); height: 100%;
    align-items: center;
}
#geometry-view .app-title {
    font-size: 14px; font-weight: 900; letter-spacing: 2px;
    color: var(--text-bright); margin: 0; text-transform: uppercase;
    text-shadow: 0 0 10px rgba(255,255,255,0.2);
}

/* --- TACTICAL NAV BUTTONS --- */
#geometry-view .monarch-nav {
    display: flex; height: 100%; gap: 4px; padding-left: 16px;
}

#geometry-view .nav-btn {
    appearance: none; background: transparent; border: none;
    color: var(--text-mid);
    font-family: var(--font-data);
    font-size: 11px; font-weight: 600; letter-spacing: 1px;
    text-transform: uppercase;
    height: 100%; padding: 0 20px;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    border-top: 2px solid transparent; /* Indicators on top for HUD feel */
}

/* Hover State: "Scanning" */
#geometry-view .nav-btn:hover {
    color: var(--text-bright);
    background: linear-gradient(to bottom, var(--gold-glow) 0%, transparent 100%);
}

/* Active State: "Locked On" */
#geometry-view .nav-btn.active {
    color: var(--gold-primary);
    border-top: 2px solid var(--gold-primary);
    background: linear-gradient(to bottom, var(--gold-glow) 0%, transparent 80%);
    text-shadow: 0 0 8px var(--gold-primary);
}

/* --- SYSTEM STATUS (Top Right) --- */
#geometry-view .system-status {
    display: flex; align-items: center; justify-content: flex-end; gap: 16px; width: 200px;
}
#geometry-view .status-indicator {
    width: 6px; height: 6px; border-radius: 50%; background: var(--signal-green);
    box-shadow: 0 0 8px var(--signal-green);
}
#geometry-view .status-indicator.loading { background: var(--gold-primary); animation: blink 0.5s infinite; }

#geometry-view .refresh-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--hud-border);
    color: var(--gold-primary);
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    clip-path: polygon(10% 0, 100% 0, 100% 90%, 90% 100%, 0 100%, 0 10%); /* Sci-Fi Corner Cut */
}
#geometry-view .refresh-btn:hover { background: var(--gold-glow); border-color: var(--gold-primary); }

/* --- 3. PULSE STRIP (Metrics Bar) --- */
#geometry-view .market-pulse-strip {
    height: 70px;
    background: rgba(0,0,0,0.6);
    border-bottom: 1px solid var(--hud-border);
    display: flex; align-items: center; padding: 0 20px; gap: 32px; flex-shrink: 0;
    backdrop-filter: blur(5px);
}

#geometry-view .pulse-module { display: flex; align-items: center; gap: 16px; }
#geometry-view .health-gauge-wrapper {
    padding-right: 32px; border-right: 1px solid var(--hud-border); min-width: 180px;
}

#geometry-view .pulse-info .label {
    font-family: var(--font-data); font-size: 9px; color: var(--text-mid); letter-spacing: 1px; text-transform: uppercase;
}
#geometry-view .pulse-info .value {
    font-family: var(--font-data); font-weight: 700; font-size: 20px; text-shadow: 0 0 10px currentColor;
}
#geometry-view .pulse-info .value.safe { color: var(--signal-green); }
#geometry-view .pulse-info .value.critical { color: var(--signal-red); }
#geometry-view .pulse-info .value.warning { color: var(--gold-primary); }

/* Icons in Hexagons */
#geometry-view .icon-box {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    background: var(--gold-glow);
    border: 1px solid var(--gold-dim);
    color: var(--gold-primary);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%); /* Hexagon Shape */
    font-size: 12px;
}

/* --- 4. TRIAD GRID (The HUD Panels) --- */
#geometry-view .monarch-triad-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    grid-template-rows: 280px;
    gap: 4px; /* Space for the background to show through */
    padding: 4px;
    flex-shrink: 0;
}

/* THE HUD PANEL (Complex Borders) */
#geometry-view .monarch-panel {
    background: var(--hud-panel);
    border: 1px solid var(--hud-border);
    display: flex; flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* Tech Corners (The JARVIS Bracket Effect) */
#geometry-view .monarch-panel::before,
#geometry-view .monarch-panel::after {
    content: ''; position: absolute; width: 8px; height: 8px;
    border: 1px solid var(--gold-primary);
    transition: all 0.3s ease; opacity: 0.5; pointer-events: none; z-index: 10;
}
#geometry-view .monarch-panel::before { top: 0; left: 0; border-right: none; border-bottom: none; }
#geometry-view .monarch-panel::after { bottom: 0; right: 0; border-left: none; border-top: none; }

#geometry-view .monarch-panel:hover::before,
#geometry-view .monarch-panel:hover::after { opacity: 1; width: 100%; height: 100%; border-color: var(--gold-dim); }

#geometry-view .panel-header {
    height: 36px; padding: 0 12px;
    background: linear-gradient(90deg, rgba(255,215,0,0.05) 0%, transparent 100%);
    border-bottom: 1px solid var(--hud-border);
    display: flex; align-items: center; justify-content: space-between;
}
#geometry-view .panel-header h3 {
    font-family: var(--font-data); font-size: 10px; font-weight: 700;
    color: var(--gold-primary); letter-spacing: 1.5px; margin: 0;
}

/* List Items (Leaders/Links) */
#geometry-view .list-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    font-size: 11px;
    font-family: var(--font-data);
}
#geometry-view .list-item:hover { background: rgba(255, 255, 255, 0.03); }
#geometry-view .ticker { color: var(--text-bright); font-weight: 700; }

/* --- 5. ANALYST CONSOLE (Terminal) --- */
#geometry-view .analyst-console {
    background: #000;
    border-top: 1px solid var(--hud-border);
    border-bottom: 1px solid var(--hud-border);
    padding: 0 16px;
    height: 32px;
    display: flex; align-items: center; gap: 12px;
}

/* --- 6. LEDGER (The Data Stream) --- */
#geometry-view .monarch-ledger-section {
    flex: 1;
    background: var(--hud-panel);
    display: flex; flex-direction: column; min-height: 0;
    border-top: 1px solid var(--gold-dim); /* Gold separator */
}

#geometry-view .ledger-header {
    height: 40px; background: rgba(0,0,0,0.5);
    padding: 0 16px; display: flex; align-items: center; justify-content: space-between;
    border-bottom: 1px solid var(--hud-border);
}

#geometry-view .ledger-search {
    background: rgba(0,0,0,0.5);
    border: 1px solid var(--hud-border);
    color: var(--gold-primary);
    font-family: var(--font-data); font-size: 11px;
    padding: 4px 8px; width: 200px;
    transition: border 0.3s;
}
#geometry-view .ledger-search:focus { border-color: var(--gold-primary); box-shadow: 0 0 5px var(--gold-glow); }

#geometry-view .monarch-table { width: 100%; border-collapse: collapse; font-family: var(--font-data); font-size: 11px; }

#geometry-view .monarch-table th {
    position: sticky; top: 0; z-index: 10;
    background: #050505; color: var(--text-mid);
    text-transform: uppercase; letter-spacing: 1px; font-weight: 400;
    padding: 10px 16px; text-align: right;
    border-bottom: 1px solid var(--gold-dim);
}
#geometry-view .monarch-table th.text-left { text-align: left; }

#geometry-view .monarch-table td {
    padding: 8px 16px; border-bottom: 1px solid rgba(255,255,255,0.02);
    color: var(--text-mid); text-align: right;
}
#geometry-view .monarch-table td.text-left { text-align: left; color: var(--text-bright); font-weight: 700; }

/* The Scanner Effect on Hover */
#geometry-view .monarch-table tr:hover td {
    background: linear-gradient(90deg, transparent 0%, rgba(255, 215, 0, 0.05) 50%, transparent 100%);
    color: var(--gold-primary);
    text-shadow: 0 0 5px rgba(255,215,0,0.3);
}

/* --- 7. UTILITIES & SCROLLBARS --- */
.text-gold { color: var(--gold-primary) !important; }
.text-green { color: var(--signal-green) !important; }
.text-red { color: var(--signal-red) !important; }
.mono { font-family: var(--font-data); }

/* Monolith Scrollbar */
#geometry-view ::-webkit-scrollbar { width: 6px; height: 6px; }
#geometry-view ::-webkit-scrollbar-track { background: #000; }
#geometry-view ::-webkit-scrollbar-thumb { background: #333; border: 1px solid #000; }
#geometry-view ::-webkit-scrollbar-thumb:hover { background: var(--gold-primary); }

/* View Switching Logic */
.view-section { display: none; flex-direction: column; flex: 1; height: 100%; overflow: hidden; }
.view-section.active-view { display: flex; animation: fadeIn 0.3s ease-in-out; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes blink { 50% { opacity: 0.3; } }

/* --- 8. NETWORK GRAPH CONTAINER --- */
#network-graph-container {
    flex: 1; position: relative; background: #000;
    background-image: radial-gradient(circle at center, #111 0%, #000 100%);
}

/* RESPONSIVE */
@media (max-width: 1024px) {
    #geometry-view .monarch-triad-grid {
        grid-template-columns: 1fr 1fr; grid-template-rows: 250px 250px;
    }
    #geometry-view .heatmap-panel { grid-column: 1 / -1; }
    #geometry-view { overflow-y: auto; display: block; }
}