/* monopole.ai - Sci-Fi HUD Overlay Stats */

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

:root {
    --bg-deep: #050A0F;
    --surface: #0A0F14;
    --primary: #0AFF0A;
    --secondary: #7FB87F;
    --alert: #FF4444;
    --accent: #00BFFF;
    --panel-bg: #0A0F1480;
    --panel-border: #0AFF0A30;
    --panel-border-hover: #0AFF0A99;
}

html, body {
    width: 100%;
    min-height: 100vh;
    background: var(--bg-deep);
    color: var(--secondary);
    font-family: 'Exo 2', sans-serif;
    font-weight: 300;
    font-size: 14px;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Scan line overlay */
#scan-lines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    background: repeating-linear-gradient(
        0deg,
        transparent 0px,
        transparent 1px,
        rgba(10, 255, 10, 0.02) 1px,
        rgba(10, 255, 10, 0.02) 2px
    );
}

/* Particle canvas */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

/* HUD Hero */
#hud-hero {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Radar grid */
#radar-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#radar-svg {
    width: 100%;
    height: 100%;
    opacity: 0;
}

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

.crosshair {
    stroke: var(--primary);
    stroke-opacity: 0.05;
    stroke-width: 1;
}

#radar-sweep {
    stroke: var(--primary);
    stroke-opacity: 0.4;
    stroke-width: 2;
    transform-origin: 500px 500px;
}

#radar-trail {
    fill: url(#sweepGradient);
    opacity: 0.15;
}

#grid-coords {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.grid-coord {
    position: absolute;
    font-family: 'Share Tech Mono', monospace;
    font-size: 10px;
    color: var(--primary);
    opacity: 0.15;
    letter-spacing: 0.05em;
}

/* Central visualization */
#central-viz {
    position: absolute;
    width: 60vw;
    height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
}

#wireframe-canvas {
    width: 100%;
    height: 100%;
}

/* Site title */
#site-title {
    position: absolute;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 48px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--primary);
    z-index: 50;
    opacity: 0;
    text-shadow: 0 0 20px rgba(10, 255, 10, 0.3);
}

/* Data panels */
.data-panel {
    position: absolute;
    width: 280px;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    z-index: 20;
    opacity: 0;
    transition: border-color 0.3s ease, background-color 0.3s ease;
}

.data-panel:hover {
    border-color: var(--panel-border-hover);
    background: rgba(10, 15, 20, 0.7);
}

#panel-top-left {
    top: 80px;
    left: 24px;
}

#panel-top-right {
    top: 80px;
    right: 24px;
}

#panel-bottom-left {
    bottom: 24px;
    left: 24px;
}

#panel-bottom-right {
    bottom: 24px;
    right: 24px;
}

.panel-header {
    padding: 12px 16px 8px;
    position: relative;
}

.panel-title {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--primary);
}

.scan-line-bar {
    height: 1px;
    background: var(--primary);
    margin-top: 8px;
    position: relative;
    overflow: hidden;
}

.scan-line-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    animation: scanLine 2s linear infinite;
}

@keyframes scanLine {
    0% { left: -100%; }
    100% { left: 100%; }
}

.panel-content {
    padding: 8px 16px 16px;
}

/* Status rows */
.status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    border-bottom: 1px solid rgba(10, 255, 10, 0.05);
}

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

.label {
    font-family: 'Exo 2', sans-serif;
    font-weight: 500;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--secondary);
}

.value {
    font-family: 'Share Tech Mono', monospace;
    font-size: 13px;
    letter-spacing: 0.05em;
}

.value.live {
    color: var(--primary);
}

.value.data {
    color: var(--primary);
}

.value.anomaly {
    color: var(--alert);
}

/* Live graphs */
.live-graph {
    width: 100%;
    height: 80px;
    margin-bottom: 8px;
}

.graph-line {
    fill: none;
    stroke: var(--primary);
    stroke-width: 1.5;
    vector-effect: non-scaling-stroke;
}

.prediction-line {
    stroke: var(--accent);
}

.accent-line {
    stroke: var(--accent);
}

/* Reading values */
.reading-values {
    display: flex;
    gap: 16px;
}

.reading {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.reading .label {
    font-size: 9px;
}

.reading .value {
    font-size: 14px;
}

/* Detection log */
#detection-log {
    max-height: 180px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) transparent;
}

.log-entry {
    display: flex;
    gap: 12px;
    padding: 3px 0;
    font-size: 12px;
    border-bottom: 1px solid rgba(10, 255, 10, 0.03);
}

.log-time {
    font-family: 'Share Tech Mono', monospace;
    color: var(--primary);
    font-size: 11px;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.log-msg {
    font-family: 'Exo 2', sans-serif;
    font-weight: 300;
    color: var(--secondary);
    font-size: 11px;
}

.log-msg.anomaly-msg {
    color: var(--alert);
}

/* Expanded data sections */
#expanded-data {
    padding: 60px 24px 120px;
    max-width: 1000px;
    margin: 0 auto;
}

.data-section {
    margin-bottom: 80px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.data-section.visible {
    opacity: 1;
    transform: translateY(0);
}

.section-border {
    height: 1px;
    background: var(--panel-border);
    margin-bottom: 0;
    position: relative;
    overflow: hidden;
    width: 0;
    transition: width 0.8s ease;
}

.data-section.visible .section-border {
    width: 100%;
}

.section-content {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-top: none;
    padding: 32px;
}

.section-title {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 24px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 24px;
}

.section-body p {
    margin-bottom: 20px;
    color: var(--secondary);
    font-family: 'Exo 2', sans-serif;
    font-weight: 300;
    font-size: 14px;
    line-height: 1.6;
}

.section-graph {
    margin-top: 24px;
}

.wide-graph {
    height: 120px;
}

/* Method grid */
.method-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 24px;
}

.method-item {
    background: rgba(10, 15, 20, 0.6);
    border: 1px solid var(--panel-border);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.method-label {
    font-family: 'Exo 2', sans-serif;
    font-weight: 500;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--secondary);
}

.method-value {
    font-family: 'Share Tech Mono', monospace;
    font-size: 18px;
    color: var(--primary);
    letter-spacing: 0.05em;
}

/* Event highlight */
.event-highlight {
    display: flex;
    align-items: center;
    gap: 24px;
    background: rgba(255, 68, 68, 0.05);
    border: 1px solid rgba(255, 68, 68, 0.3);
    padding: 16px 24px;
    margin-top: 24px;
}

.event-label {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 16px;
    color: var(--primary);
    letter-spacing: 0.1em;
}

.event-confidence {
    font-family: 'Share Tech Mono', monospace;
    font-size: 14px;
    color: var(--alert);
    letter-spacing: 0.05em;
}

.event-status {
    font-family: 'Share Tech Mono', monospace;
    font-size: 12px;
    color: var(--accent);
    letter-spacing: 0.05em;
    animation: statusBlink 2s ease-in-out infinite;
}

@keyframes statusBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 4px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--primary);
    opacity: 0.3;
}

/* Panel expand animation */
@keyframes borderDraw {
    0% { clip-path: polygon(0 0, 0 0, 0 0, 0 0); }
    25% { clip-path: polygon(0 0, 100% 0, 100% 0, 0 0); }
    50% { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 0); }
    75% { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
    100% { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
}

.panel-appear {
    animation: borderDraw 0.4s ease forwards, fadeIn 0.4s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Flicker effect for title */
@keyframes flicker {
    0% { opacity: 1; }
    10% { opacity: 0; }
    20% { opacity: 1; }
    30% { opacity: 0; }
    40% { opacity: 1; }
    50% { opacity: 0; }
    60% { opacity: 1; }
    100% { opacity: 1; }
}

.title-flicker {
    animation: flicker 0.3s ease forwards;
}
