/* sim-ai.com - Simulation Monitoring Interface */
/* Color Palette:
   Background/Void:    #0A0E17
   Surface/Panel:      #111827
   Grid/Borders:       #1E293B
   Primary Data/Text:  #C8D6E5
   Secondary Data:     #607B8D
   Accent/Active:      #00D4FF
   Signal/Pulse:       #7B61FF
   Warning/Threshold:  #FF6B6B
   Success/Converge:   #00E896
*/

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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #0A0E17;
    color: #C8D6E5;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 400;
    line-height: 1.5;
    letter-spacing: 0;
    cursor: none;
}

/* Boot Sequence Overlay */
#boot-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #0A0E17;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease;
}

#boot-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

#boot-text {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: #00D4FF;
    max-width: 480px;
}

.boot-line {
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.boot-line.visible {
    opacity: 1;
    transform: translateY(0);
}

.boot-line:last-child.visible {
    color: #00E896;
}

/* Canvas Layers */
#grid-canvas {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

#wave-canvas {
    position: fixed;
    inset: 0;
    z-index: 2;
    pointer-events: none;
}

#main-canvas {
    position: fixed;
    top: 0;
    left: 15%;
    width: 70%;
    height: calc(100% - 48px);
    z-index: 3;
    pointer-events: none;
}

/* Data Rails */
.data-rail {
    position: fixed;
    top: 0;
    width: 15%;
    height: calc(100% - 48px);
    z-index: 4;
    background: #111827;
    border: 1px solid #1E293B;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.data-rail.visible {
    opacity: 1;
}

#left-rail {
    left: 0;
    border-left: none;
}

#right-rail {
    right: 0;
    border-right: none;
}

.rail-header {
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #607B8D;
    padding: 12px 10px 8px;
    border-bottom: 1px solid #1E293B;
}

.rail-data {
    padding: 8px 10px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: #607B8D;
    line-height: 1.6;
    overflow: hidden;
    height: calc(100% - 40px);
}

.rail-data .data-line {
    white-space: nowrap;
    overflow: hidden;
}

.rail-data .data-line.highlight {
    color: #00D4FF;
}

.rail-data .data-line.warning {
    color: #FF6B6B;
}

.rail-data .data-line.success {
    color: #00E896;
}

/* Sparkline containers in right rail */
.sparkline-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px solid rgba(30, 41, 59, 0.5);
}

.sparkline-label {
    font-size: 9px;
    color: #607B8D;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sparkline-value {
    font-size: 10px;
    color: #C8D6E5;
    font-weight: 700;
}

.sparkline-canvas {
    width: 100%;
    height: 20px;
}

/* Status indicators in right rail */
.status-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 0;
}

.status-indicator {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-indicator.green {
    background: #00E896;
    box-shadow: 0 0 4px #00E896;
    animation: blink-green 2s infinite;
}

.status-indicator.amber {
    background: #FFB84D;
    box-shadow: 0 0 4px #FFB84D;
    animation: blink-amber 1.5s infinite;
}

.status-indicator.cyan {
    background: #00D4FF;
    box-shadow: 0 0 4px #00D4FF;
}

@keyframes blink-green {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

@keyframes blink-amber {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Frame Label */
#frame-label {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#frame-label.visible {
    opacity: 1;
}

.frame-title {
    display: block;
    font-family: 'Space Mono', monospace;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #C8D6E5;
    text-shadow: 0 0 1px #00D4FF, 0 0 8px rgba(0, 212, 255, 0.3);
}

.frame-narrative {
    display: block;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    font-weight: 400;
    color: #607B8D;
    margin-top: 6px;
}

/* Cursor Flashlight */
#cursor-flashlight {
    position: fixed;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 212, 255, 0.06) 0%, transparent 70%);
    pointer-events: none;
    z-index: 6;
    transform: translate(-50%, -50%);
    display: none;
}

/* Bottom Telemetry Strip */
#telemetry-strip {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 48px;
    z-index: 10;
    background: #111827;
    border-top: 1px solid #1E293B;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    opacity: 0;
    transition: opacity 0.5s ease;
}

#telemetry-strip.visible {
    opacity: 1;
}

#telemetry-left,
#telemetry-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

#telemetry-center {
    display: flex;
    align-items: center;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #607B8D;
    flex-shrink: 0;
}

.status-dot.active {
    background: #00E896;
    box-shadow: 0 0 6px #00E896;
    animation: blink-green 2s infinite;
}

.telemetry-label {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.1em;
    color: #C8D6E5;
}

.telemetry-separator {
    color: #1E293B;
}

.telemetry-value {
    color: #607B8D;
}

.telemetry-hint {
    color: #607B8D;
    font-size: 10px;
}

/* Frame Indicator Buttons */
#frame-indicators {
    display: flex;
    gap: 4px;
}

.frame-btn {
    width: 32px;
    height: 28px;
    background: #0A0E17;
    border: 1px solid #1E293B;
    color: #607B8D;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.frame-btn:hover {
    border-color: #607B8D;
    color: #C8D6E5;
}

.frame-btn.active {
    background: rgba(0, 212, 255, 0.1);
    border-color: #00D4FF;
    color: #00D4FF;
    box-shadow: 0 0 8px rgba(0, 212, 255, 0.2);
}

/* Frame Transition Effect */
#main-canvas.transitioning {
    filter: blur(2px);
    transition: filter 0.15s ease;
}

#main-canvas.transition-done {
    filter: blur(0px);
    transition: filter 0.15s ease;
}

/* Timeline in telemetry strip */
.timeline-bar {
    width: 100%;
    height: 2px;
    background: #1E293B;
    position: absolute;
    top: 0;
    left: 0;
}

.timeline-progress {
    height: 100%;
    background: #00D4FF;
    transition: width 0.1s linear;
}

.timeline-tick {
    position: absolute;
    top: -2px;
    width: 1px;
    height: 6px;
    background: #1E293B;
}

/* Histogram mini bars in right rail */
.histogram-bar {
    display: inline-block;
    width: 3px;
    margin-right: 1px;
    background: #7B61FF;
    vertical-align: bottom;
    transition: height 0.3s ease;
}

/* Selection disabled */
* {
    user-select: none;
    -webkit-user-select: none;
}
