/* ============================================
   EYES.PLUS - HUD Interface Styles
   Palette: #0a0e17, #0d1b2a, #00e5ff, #76ff03, #ff00e4, #ff1744, #b0bec5
   Fonts: Orbitron 700, Share Tech Mono 400, Exo 2 300
   ============================================ */

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

html, body {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background: #0a0e17;
    font-family: 'Orbitron', sans-serif;
    color: #00e5ff;
    -webkit-font-smoothing: antialiased;
}

/* Scan line overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        transparent,
        transparent 2px,
        rgba(0, 229, 255, 0.03) 2px,
        rgba(0, 229, 255, 0.03) 4px
    );
    pointer-events: none;
    z-index: 9999;
}

/* ============================================
   HUD Container - 12x8 Grid
   ============================================ */

#hud-container {
    width: 100vw;
    height: 100vh;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: repeat(8, 1fr);
    position: relative;
    overflow: hidden;
}

/* ============================================
   Scan Sweep Effect
   ============================================ */

#scan-sweep {
    position: fixed;
    top: -3px;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(0, 229, 255, 0.15);
    z-index: 9998;
    pointer-events: none;
    animation: scanSweep 6s linear infinite;
    opacity: 0;
}

.mode-calibration #scan-sweep,
.mode-operational #scan-sweep {
    opacity: 1;
}

@keyframes scanSweep {
    0% { top: -3px; }
    100% { top: 100vh; }
}

/* ============================================
   HUD Panel Base Styles
   ============================================ */

.hud-panel {
    background: rgba(13, 27, 42, 0.85);
    border: 1px solid #00e5ff;
    box-shadow: 0 0 8px rgba(0, 229, 255, 0.15), inset 0 0 8px rgba(0, 229, 255, 0.05);
    padding: 10px;
    position: relative;
    opacity: 0;
    transition: opacity 0.8s ease, border-color 0.1s ease;
}

.mode-boot .hud-panel {
    opacity: 0;
}

.mode-calibration .hud-panel,
.mode-operational .hud-panel {
    opacity: 1;
}

.hud-panel.border-flash {
    border-color: #ff1744;
    box-shadow: 0 0 12px rgba(255, 23, 68, 0.3), inset 0 0 8px rgba(255, 23, 68, 0.1);
}

/* ============================================
   Top Banner
   ============================================ */

#top-banner {
    grid-column: 1 / 13;
    grid-row: 1 / 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 20px;
    z-index: 10;
}

.banner-left,
.banner-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.firmware-version {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.55rem, 0.9vw, 0.75rem);
    color: #b0bec5;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.signal-bars {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 16px;
}

.signal-bars .bar {
    width: 3px;
    background: #76ff03;
    display: block;
}

.bar-1 { height: 4px; }
.bar-2 { height: 7px; }
.bar-3 { height: 10px; }
.bar-4 { height: 13px; }
.bar-5 { height: 16px; }

.banner-center {
    flex: 1;
    text-align: center;
}

.domain-title {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: clamp(2.5rem, 7vw, 5rem);
    color: #00e5ff;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    text-shadow: 0 0 20px rgba(0, 229, 255, 0.4);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.mode-calibration .domain-title,
.mode-operational .domain-title {
    opacity: 1;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #76ff03;
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; box-shadow: 0 0 4px #76ff03; }
    50% { opacity: 0.4; box-shadow: 0 0 8px #76ff03; }
}

.status-text {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: clamp(0.6rem, 1vw, 0.8rem);
    color: #76ff03;
    letter-spacing: 0.25em;
}

/* ============================================
   Left Telemetry Column
   ============================================ */

#left-telemetry {
    grid-column: 1 / 4;
    grid-row: 2 / 8;
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: hidden;
    z-index: 10;
}

.telemetry-header {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: clamp(0.7rem, 1.2vw, 0.9rem);
    color: #00e5ff;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(0, 229, 255, 0.3);
}

.telemetry-item {
    display: flex;
    align-items: baseline;
    gap: 6px;
    padding: 6px 0;
}

.telemetry-label {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: clamp(0.55rem, 0.9vw, 0.7rem);
    color: #b0bec5;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    min-width: 80px;
}

.telemetry-value {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.85rem, 1.4vw, 1.1rem);
    color: #76ff03;
    letter-spacing: 0.1em;
    min-width: 60px;
    text-align: right;
    transition: color 0.05s;
}

.telemetry-value.glitch-flash {
    color: #ff1744;
    text-shadow: -2px 0 #ff1744, 2px 0 #00e5ff;
}

.telemetry-unit {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.5rem, 0.8vw, 0.65rem);
    color: #b0bec5;
    letter-spacing: 0.1em;
    opacity: 0.6;
}

.telemetry-divider {
    width: 100%;
    height: 1px;
    background: rgba(0, 229, 255, 0.15);
}

/* ============================================
   Reticule Zone (Center)
   ============================================ */

#reticule-zone {
    grid-column: 4 / 10;
    grid-row: 2 / 7;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 5;
}

#reticule-svg {
    width: min(100%, 300px);
    height: min(100%, 300px);
    opacity: 0;
    transition: opacity 1s ease;
}

.mode-calibration #reticule-svg {
    opacity: 0.5;
}

.mode-operational #reticule-svg {
    opacity: 1;
}

.reticule-outer {
    transform-origin: 150px 150px;
    animation: rotateClockwise 60s linear infinite;
}

.reticule-inner {
    transform-origin: 150px 150px;
    animation: rotateCounterClockwise 90s linear infinite;
}

.reticule-center {
    animation: pulseCenter 2s ease-in-out infinite;
}

@keyframes rotateClockwise {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

@keyframes pulseCenter {
    0%, 100% { fill: #00e5ff; }
    50% { fill: #ff00e4; }
}

/* About overlay */
#about-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 280px;
    text-align: center;
    opacity: 0;
    transition: opacity 1.5s ease;
    pointer-events: none;
    z-index: 6;
}

.mode-operational #about-overlay {
    opacity: 1;
    pointer-events: auto;
}

.about-header {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: clamp(0.6rem, 1vw, 0.8rem);
    color: #00e5ff;
    letter-spacing: 0.25em;
    margin-bottom: 12px;
}

#about-overlay p {
    font-family: 'Exo 2', sans-serif;
    font-weight: 300;
    font-size: clamp(0.8rem, 1.1vw, 1rem);
    line-height: 1.65;
    color: #b0bec5;
    margin-bottom: 10px;
}

#about-overlay .manifest-status {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: clamp(0.55rem, 0.9vw, 0.7rem);
    color: #76ff03;
    letter-spacing: 0.2em;
    margin-top: 16px;
}

/* ============================================
   Right Schematic Column
   ============================================ */

#right-schematic {
    grid-column: 10 / 13;
    grid-row: 2 / 8;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
    z-index: 10;
}

.schematic-header {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: clamp(0.7rem, 1.2vw, 0.9rem);
    color: #00e5ff;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(0, 229, 255, 0.3);
    width: 100%;
    text-align: center;
}

#schematic-svg {
    width: 100%;
    max-height: 100%;
    flex: 1;
}

.schematic-component {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.mode-calibration .schematic-component,
.mode-operational .schematic-component {
    opacity: 1;
}

.schematic-component.highlight {
    stroke: #ff00e4;
}

.schematic-component.highlight ellipse,
.schematic-component.highlight line,
.schematic-component.highlight rect,
.schematic-component.highlight circle {
    stroke: #ff00e4;
    transition: stroke 0.3s ease;
}

.schematic-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 8px;
    fill: #b0bec5;
    letter-spacing: 0.15em;
}

/* ============================================
   Bottom Data Tray
   ============================================ */

#bottom-tray {
    grid-column: 1 / 13;
    grid-row: 8 / 9;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 16px;
    z-index: 10;
    background: rgba(13, 27, 42, 0.85);
    position: relative;
    overflow: hidden;
}

/* Circuit trace background pattern */
#bottom-tray::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        linear-gradient(90deg, rgba(0, 229, 255, 0.03) 1px, transparent 1px),
        linear-gradient(rgba(0, 229, 255, 0.03) 1px, transparent 1px);
    background-size: 20px 20px;
    pointer-events: none;
}

.tray-label {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: clamp(0.55rem, 0.9vw, 0.7rem);
    color: #00e5ff;
    letter-spacing: 0.25em;
    white-space: nowrap;
    z-index: 1;
}

#ticker-container {
    flex: 1;
    overflow: hidden;
    z-index: 1;
}

#ticker-content {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.65rem, 1vw, 0.85rem);
    color: #76ff03;
    white-space: nowrap;
    letter-spacing: 0.05em;
}

#ticker-content .warn {
    color: #ff1744;
}

#ticker-content .info {
    color: #00e5ff;
}

/* ============================================
   Boot Overlay
   ============================================ */

#boot-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    background: #0a0e17;
    pointer-events: none;
    transition: opacity 1s ease;
}

.mode-calibration #boot-overlay,
.mode-operational #boot-overlay {
    opacity: 0;
}

#boot-title {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: clamp(2.5rem, 7vw, 5rem);
    color: #00e5ff;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    text-shadow: 0 0 30px rgba(0, 229, 255, 0.5);
}

#boot-title.glitch {
    text-shadow: -2px 0 #ff1744, 2px 0 #00e5ff, 0 0 30px rgba(0, 229, 255, 0.5);
}

/* ============================================
   Corner Brackets
   ============================================ */

.corner-bracket {
    position: fixed;
    width: 30px;
    height: 30px;
    z-index: 50;
    opacity: 0;
    transition: opacity 1s ease;
}

.mode-calibration .corner-bracket,
.mode-operational .corner-bracket {
    opacity: 1;
}

.corner-bracket.top-left {
    top: 8px;
    left: 8px;
    border-top: 2px solid #00e5ff;
    border-left: 2px solid #00e5ff;
}

.corner-bracket.top-right {
    top: 8px;
    right: 8px;
    border-top: 2px solid #00e5ff;
    border-right: 2px solid #00e5ff;
}

.corner-bracket.bottom-left {
    bottom: 8px;
    left: 8px;
    border-bottom: 2px solid #00e5ff;
    border-left: 2px solid #00e5ff;
}

.corner-bracket.bottom-right {
    bottom: 8px;
    right: 8px;
    border-bottom: 2px solid #00e5ff;
    border-right: 2px solid #00e5ff;
}

/* ============================================
   Mode Indicator
   ============================================ */

#mode-indicator {
    position: fixed;
    bottom: 12px;
    right: 50px;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mode-label {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: clamp(0.55rem, 0.9vw, 0.7rem);
    color: #b0bec5;
    letter-spacing: 0.25em;
}

#mode-value {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.65rem, 1vw, 0.85rem);
    color: #76ff03;
    letter-spacing: 0.15em;
}

/* ============================================
   Glitch Effects
   ============================================ */

@keyframes glitchRGB {
    0% { text-shadow: -2px 0 #ff1744, 2px 0 #00e5ff; }
    25% { text-shadow: 2px 0 #ff1744, -2px 0 #00e5ff; }
    50% { text-shadow: -1px 1px #ff1744, 1px -1px #00e5ff; }
    75% { text-shadow: 1px -1px #ff1744, -1px 1px #00e5ff; }
    100% { text-shadow: none; }
}

.glitch-active {
    animation: glitchRGB 0.15s ease-out;
}

/* Panel border draw-on animation for calibration mode */
@keyframes borderDrawOn {
    0% {
        clip-path: inset(0 100% 100% 0);
    }
    50% {
        clip-path: inset(0 0 100% 0);
    }
    100% {
        clip-path: inset(0 0 0 0);
    }
}

.mode-calibration .hud-panel {
    animation: borderDrawOn 1s ease-out forwards;
}

/* ============================================
   Schematic Assembly Animation
   ============================================ */

.mode-calibration .schematic-component[data-index="0"] {
    animation: assembleComponent 0.5s 0.2s ease-out forwards;
    opacity: 0;
    transform: translateY(-30px);
}

.mode-calibration .schematic-component[data-index="1"] {
    animation: assembleComponent 0.5s 0.4s ease-out forwards;
    opacity: 0;
    transform: translateY(-25px);
}

.mode-calibration .schematic-component[data-index="2"] {
    animation: assembleComponent 0.5s 0.6s ease-out forwards;
    opacity: 0;
    transform: translateY(-20px);
}

.mode-calibration .schematic-component[data-index="3"] {
    animation: assembleComponent 0.5s 0.8s ease-out forwards;
    opacity: 0;
    transform: translateY(-15px);
}

.mode-calibration .schematic-component[data-index="4"] {
    animation: assembleComponent 0.5s 1.0s ease-out forwards;
    opacity: 0;
    transform: translateY(15px);
}

.mode-calibration .schematic-component[data-index="5"] {
    animation: assembleComponent 0.5s 1.2s ease-out forwards;
    opacity: 0;
    transform: translateY(20px);
}

.mode-calibration .schematic-component[data-index="6"] {
    animation: assembleComponent 0.5s 1.4s ease-out forwards;
    opacity: 0;
    transform: translateY(25px);
}

@keyframes assembleComponent {
    0% {
        opacity: 0;
        transform: translateY(var(--translate-start, -20px));
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.mode-operational .schematic-component {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   Responsive adjustments
   ============================================ */

@media (max-width: 768px) {
    #left-telemetry {
        grid-column: 1 / 4;
        padding: 6px;
    }

    #right-schematic {
        grid-column: 10 / 13;
        padding: 6px;
    }

    .telemetry-label {
        min-width: 50px;
        font-size: 0.5rem;
    }

    .telemetry-value {
        font-size: 0.75rem;
    }

    #about-overlay {
        width: 200px;
    }

    #about-overlay p {
        font-size: 0.75rem;
    }
}
