/* ===========================
   THEME VARIABLES
   =========================== */
:root {
    --primary-color: #00ff00;
    --primary-glow: rgba(0, 255, 0, 0.6);
    --primary-shadow: rgba(0, 255, 0, 0.3);
    --bg-primary: #000000;
    --bg-secondary: #0a0a0a;
    --bg-panel: rgba(0, 20, 0, 0.4);
    --border-color: rgba(0, 255, 0, 0.4);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.8);
    --text-dim: rgba(255, 255, 255, 0.5);
}

.theme-green {
    --primary-color: #00ff00;
    --primary-glow: rgba(0, 255, 0, 0.6);
    --primary-shadow: rgba(0, 255, 0, 0.3);
    --bg-panel: rgba(0, 20, 0, 0.4);
    --border-color: rgba(0, 255, 0, 0.4);
}

.theme-cyan {
    --primary-color: #00ffff;
    --primary-glow: rgba(0, 255, 255, 0.6);
    --primary-shadow: rgba(0, 255, 255, 0.3);
    --bg-panel: rgba(0, 20, 20, 0.4);
    --border-color: rgba(0, 255, 255, 0.4);
}

.theme-orange {
    --primary-color: #ff9500;
    --primary-glow: rgba(255, 149, 0, 0.6);
    --primary-shadow: rgba(255, 149, 0, 0.3);
    --bg-panel: rgba(20, 10, 0, 0.4);
    --border-color: rgba(255, 149, 0, 0.4);
}

.theme-pink {
    --primary-color: #ff00ff;
    --primary-glow: rgba(255, 0, 255, 0.6);
    --primary-shadow: rgba(255, 0, 255, 0.3);
    --bg-panel: rgba(20, 0, 20, 0.4);
    --border-color: rgba(255, 0, 255, 0.4);
}

.theme-red {
    --primary-color: #ff3333;
    --primary-glow: rgba(255, 51, 51, 0.6);
    --primary-shadow: rgba(255, 51, 51, 0.3);
    --bg-panel: rgba(20, 0, 0, 0.4);
    --border-color: rgba(255, 51, 51, 0.4);
}

.theme-amber {
    --primary-color: #ffaa00;
    --primary-glow: rgba(255, 170, 0, 0.6);
    --primary-shadow: rgba(255, 170, 0, 0.3);
    --bg-panel: rgba(20, 15, 0, 0.4);
    --border-color: rgba(255, 170, 0, 0.4);
}

/* ===========================
   RESET & BASE STYLES
   =========================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Courier New', 'Courier', monospace;
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    height: 100vh;
    position: relative;
}

pre {
    margin: 0;
    font-family: 'Courier New', 'Courier', monospace;
    line-height: 1.2;
}

/* ===========================
   CRT & SCANLINE EFFECTS
   =========================== */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15) 0px,
        transparent 1px,
        transparent 2px,
        rgba(0, 0, 0, 0.15) 3px
    );
    animation: scanlines-move 8s linear infinite;
}

@keyframes scanlines-move {
    0% { transform: translateY(0); }
    100% { transform: translateY(10px); }
}

.crt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9998;
    background: radial-gradient(ellipse at center, transparent 0%, rgba(0, 0, 0, 0.3) 100%);
    animation: flicker 0.15s infinite;
}

@keyframes flicker {
    0%, 100% { opacity: 0.97; }
    50% { opacity: 1; }
}

/* ===========================
   HEADER
   =========================== */
.header {
    background: var(--bg-secondary);
    border-bottom: 2px solid var(--primary-color);
    box-shadow: 0 0 20px var(--primary-glow);
    position: relative;
    z-index: 100;
}

.ascii-logo {
    text-align: center;
    padding: 10px 0 5px 0;
}

.logo-art {
    color: var(--primary-color);
    text-shadow: 0 0 10px var(--primary-glow);
    font-size: 10px;
    line-height: 1.1;
}

.header-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 20px 12px 20px;
    font-size: 12px;
}

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

.label {
    color: var(--text-dim);
    letter-spacing: 1px;
}

.value {
    color: var(--primary-color);
    font-weight: bold;
    text-shadow: 0 0 5px var(--primary-glow);
}

.separator {
    color: var(--text-dim);
}

.system-status {
    color: var(--primary-color);
    font-weight: bold;
    text-shadow: 0 0 10px var(--primary-glow);
}

.blink {
    animation: blink-animation 1.5s infinite;
}

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

.theme-selector {
    background: var(--bg-primary);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 5px 10px;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    cursor: pointer;
    outline: none;
    box-shadow: 0 0 5px var(--primary-shadow);
    transition: all 0.3s;
}

.theme-selector:hover {
    background: var(--primary-color);
    color: var(--bg-primary);
    box-shadow: 0 0 15px var(--primary-glow);
}

/* ===========================
   MAIN CONTROL INTERFACE
   =========================== */
.control-interface {
    display: grid;
    grid-template-columns: 1fr 1.5fr 1fr;
    gap: 15px;
    padding: 15px;
    height: calc(100vh - 220px);
    overflow-y: auto;
}

.left-column,
.center-column,
.right-column {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* ===========================
   PANELS
   =========================== */
.panel {
    background: var(--bg-panel);
    border: 2px solid var(--border-color);
    backdrop-filter: blur(10px);
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 20px var(--primary-shadow);
    transition: all 0.3s;
}

.panel:hover {
    box-shadow: 0 0 30px var(--primary-glow);
    border-color: var(--primary-color);
}

.panel-header {
    padding: 8px 15px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.3);
}

.panel-title {
    font-size: 11px;
    color: var(--primary-color);
    letter-spacing: 1px;
    text-shadow: 0 0 10px var(--primary-glow);
    font-weight: bold;
}

.panel-content {
    padding: 15px;
    flex: 1;
    overflow: auto;
}

/* ===========================
   ASCII MAP
   =========================== */
.ascii-map {
    position: relative;
}

.map-display {
    color: var(--primary-color);
    font-size: 10px;
    line-height: 1.1;
    text-shadow: 0 0 8px var(--primary-glow);
    position: relative;
}

.map-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.orbit-line {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200px;
    height: 200px;
    border: 1px solid var(--primary-color);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.3;
}

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

@keyframes rotate-orbit {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.station-marker {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 15px var(--primary-glow);
}

.pulse {
    animation: pulse-marker 2s infinite;
}

@keyframes pulse-marker {
    0%, 100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 0.5; transform: translate(-50%, -50%) scale(1.5); }
}

.map-legend {
    margin-top: 10px;
    display: flex;
    justify-content: space-around;
    font-size: 10px;
    color: var(--text-secondary);
}

/* ===========================
   ASCII RADAR
   =========================== */
.ascii-radar {
    position: relative;
}

.radar-grid {
    color: var(--primary-color);
    font-size: 9px;
    line-height: 1.1;
    text-shadow: 0 0 8px var(--primary-glow);
}

.radar-sweep-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1px;
    height: 100px;
    background: linear-gradient(to bottom, var(--primary-color), transparent);
    transform-origin: top center;
    transform: translate(-50%, 0);
    animation: radar-sweep 4s linear infinite;
    opacity: 0.6;
}

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

.contact-list {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.contact-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.4);
    border-left: 3px solid var(--primary-color);
    font-size: 10px;
    transition: all 0.3s;
}

.contact-item:hover {
    background: rgba(0, 0, 0, 0.6);
    box-shadow: 0 0 10px var(--primary-shadow);
}

.contact-id {
    color: var(--primary-color);
    font-weight: bold;
}

.contact-dist {
    color: var(--text-secondary);
}

.contact-type {
    color: var(--text-dim);
    font-size: 9px;
}

/* ===========================
   NAVIGATION CONSOLE
   =========================== */
.nav-display {
    margin-bottom: 15px;
}

.ascii-viewport {
    color: var(--primary-color);
    font-size: 9px;
    line-height: 1.1;
    text-shadow: 0 0 8px var(--primary-glow);
}

.nav-data-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.data-item {
    background: rgba(0, 0, 0, 0.4);
    padding: 10px;
    border: 1px solid var(--border-color);
}

.data-label {
    display: block;
    font-size: 9px;
    color: var(--text-dim);
    margin-bottom: 5px;
    letter-spacing: 1px;
}

.data-value-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 11px;
}

.mono {
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

/* ===========================
   STATUS DASHBOARD
   =========================== */
.status-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.status-module {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    padding: 12px;
    transition: all 0.3s;
}

.status-module:hover {
    background: rgba(0, 0, 0, 0.6);
    box-shadow: 0 0 15px var(--primary-shadow);
}

.module-header {
    margin-bottom: 10px;
}

.module-icon {
    color: var(--primary-color);
    font-size: 10px;
    text-shadow: 0 0 10px var(--primary-glow);
    line-height: 1.1;
}

.ascii-gauge {
    color: var(--text-secondary);
}

.gauge-display {
    font-size: 10px;
    line-height: 1.3;
}

.gauge-display .value {
    color: var(--primary-color);
    font-weight: bold;
    text-shadow: 0 0 8px var(--primary-glow);
}

/* ===========================
   CONTROL PANEL
   =========================== */
.control-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.control-button {
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid var(--border-color);
    color: var(--primary-color);
    padding: 5px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.control-button:hover {
    background: rgba(0, 0, 0, 0.7);
    border-color: var(--primary-color);
    box-shadow: 0 0 20px var(--primary-glow);
    transform: scale(1.05);
}

.control-button:active {
    background: var(--primary-color);
    color: var(--bg-primary);
}

.button-art {
    font-size: 9px;
    line-height: 1.1;
    text-shadow: 0 0 8px var(--primary-glow);
    pointer-events: none;
}

.control-button.autopilot {
    animation: pulse-button 2s infinite;
}

@keyframes pulse-button {
    0%, 100% { box-shadow: 0 0 10px var(--primary-shadow); }
    50% { box-shadow: 0 0 25px var(--primary-glow); }
}

/* ===========================
   COMMUNICATIONS
   =========================== */
.signal-visualizer {
    margin-bottom: 15px;
}

.signal-display {
    color: var(--primary-color);
    font-size: 10px;
    line-height: 1.2;
    text-shadow: 0 0 8px var(--primary-glow);
}

.channel-status {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.channel {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    transition: all 0.3s;
}

.channel:hover {
    background: rgba(0, 0, 0, 0.6);
    box-shadow: 0 0 10px var(--primary-shadow);
}

.channel.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 15px var(--primary-glow);
}

.channel-icon {
    font-size: 16px;
    color: var(--text-dim);
}

.channel.active .channel-icon {
    color: var(--primary-color);
    animation: blink-animation 1.5s infinite;
}

.channel-name {
    flex: 1;
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: bold;
}

.channel-state {
    font-size: 9px;
    color: var(--text-dim);
}

.channel.active .channel-state {
    color: var(--primary-color);
}

/* ===========================
   MISSION LOG TERMINAL
   =========================== */
.terminal {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
    padding: 10px;
    height: 150px;
    overflow-y: auto;
    margin-bottom: 10px;
}

.log-entry {
    font-size: 10px;
    color: var(--text-secondary);
    margin-bottom: 5px;
    padding: 4px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    animation: log-fade-in 0.5s ease-in;
}

@keyframes log-fade-in {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

.log-entry.warning {
    color: #ffaa00;
    animation: warning-flash 1s infinite;
}

.log-entry.success {
    color: #00ff00;
}

@keyframes warning-flash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.terminal-prompt {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
}

.prompt-symbol {
    color: var(--primary-color);
    font-weight: bold;
    text-shadow: 0 0 8px var(--primary-glow);
}

.prompt-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--primary-color);
    font-family: 'Courier New', monospace;
    font-size: 11px;
    outline: none;
}

.prompt-input::placeholder {
    color: var(--text-dim);
}

/* ===========================
   FOOTER
   =========================== */
.footer {
    background: var(--bg-secondary);
    border-top: 2px solid var(--primary-color);
    box-shadow: 0 0 20px var(--primary-glow);
    position: relative;
    z-index: 100;
}

.footer-section {
    padding: 5px 0;
}

.footer-art {
    color: var(--primary-color);
    font-size: 10px;
    line-height: 1.1;
    text-align: center;
    text-shadow: 0 0 8px var(--primary-glow);
}

.status-ok {
    color: #00ff00;
    font-weight: bold;
}

/* ===========================
   SCROLLBAR
   =========================== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    box-shadow: 0 0 10px var(--primary-glow);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
    box-shadow: 0 0 20px var(--primary-glow);
}

/* ===========================
   RESPONSIVE DESIGN
   =========================== */
@media (max-width: 1400px) {
    .control-interface {
        grid-template-columns: 1fr 1fr;
    }
    
    .right-column {
        grid-column: span 2;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
}

@media (max-width: 1024px) {
    .control-interface {
        grid-template-columns: 1fr;
    }
    
    .right-column {
        grid-column: 1;
        display: flex;
        flex-direction: column;
    }
    
    .status-grid {
        grid-template-columns: 1fr;
    }
    
    .logo-art {
        font-size: 8px;
    }
}

@media (max-width: 768px) {
    .header-info {
        flex-direction: column;
        gap: 10px;
    }
    
    .info-left,
    .info-center,
    .info-right {
        width: 100%;
        justify-content: center;
    }
    
    .control-interface {
        padding: 10px;
        gap: 10px;
    }
    
    .nav-data-grid {
        grid-template-columns: 1fr;
    }
    
    .control-grid {
        grid-template-columns: 1fr;
    }
}

/* ===========================
   ANIMATIONS
   =========================== */
@keyframes text-glow {
    0%, 100% { text-shadow: 0 0 5px var(--primary-glow); }
    50% { text-shadow: 0 0 20px var(--primary-glow); }
}

/* Subtle border pulse */
@keyframes border-pulse {
    0%, 100% { border-color: var(--border-color); }
    50% { border-color: var(--primary-color); }
}

.panel {
    animation: border-pulse 4s infinite;
}
