/* ══════════════════════════════════════════════════════════════
   AEROFIELD — MARS OBSERVATORY
   CSS for mars.html
   Mars palette: Primary #c1440e · Accent #ff6633 · Glow #ff4422
   ══════════════════════════════════════════════════════════════ */

/* ── RESET & BASE ───────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    width: 100%; height: 100vh;
    overflow: hidden;
    background: var(--bg-primary, #0a0a0f);
    color: #e0d0c0;
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
    cursor: default;
}

::selection { background: rgba(193,68,14,0.35); color: #fff; }

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: rgba(193,68,14,0.08); }
::-webkit-scrollbar-thumb { background: rgba(193,68,14,0.25); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(193,68,14,0.4); }


/* ── BACKGROUND LAYERS ──────────────────────────────────────── */
.mars-bg-grid {
    position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background-image:
        linear-gradient(rgba(193,68,14,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(193,68,14,0.04) 1px, transparent 1px);
    background-size: 60px 60px;
}

.mars-bg-radial {
    position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background:
        radial-gradient(ellipse 60% 50% at 50% 50%, rgba(193,68,14,0.06) 0%, transparent 70%),
        radial-gradient(ellipse 80% 60% at 30% 70%, rgba(255,68,34,0.03) 0%, transparent 60%),
        radial-gradient(ellipse 40% 40% at 70% 30%, rgba(255,102,51,0.04) 0%, transparent 50%);
}


/* ── NAVBAR ──────────────────────────────────────────────────── */
.mars-navbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    display: flex; align-items: center; justify-content: space-between;
    height: 52px; padding: 0 20px;
    background: rgba(10,10,15,0.88);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(193,68,14,0.15);
}

.mars-nav-logo {
    display: flex; align-items: center; gap: 10px;
    text-decoration: none; color: #c1440e;
}

.mars-logo-icon {
    width: 28px; height: 28px;
    background: linear-gradient(135deg, #c1440e, #ff6633);
    border-radius: 6px; display: flex; align-items: center; justify-content: center;
}
.mars-logo-icon svg { width: 18px; height: 18px; }

.mars-logo-text {
    font-family: 'Cinzel', serif; font-weight: 600; font-size: 14px;
    letter-spacing: 2px; text-transform: uppercase; color: #ff6633;
}

.mars-nav-center { display: flex; flex-direction: column; align-items: center; gap: 2px; }

.mars-nav-title {
    font-family: 'Rajdhani', sans-serif; font-weight: 600; font-size: 13px;
    letter-spacing: 3px; text-transform: uppercase; color: #ff6633;
    display: flex; align-items: center; gap: 6px;
}

.mars-nav-status { display: flex; align-items: center; gap: 6px; }

.mars-status-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: #ff4422; animation: marsPulse 2s ease-in-out infinite;
}

.mars-status-text {
    font-family: 'Rajdhani', sans-serif; font-size: 10px;
    letter-spacing: 2px; text-transform: uppercase; color: rgba(255,102,51,0.5);
}

.mars-nav-controls { display: flex; align-items: center; gap: 6px; }

.mars-btn {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 5px 10px; border: 1px solid rgba(193,68,14,0.25);
    border-radius: 4px; background: rgba(193,68,14,0.08);
    color: rgba(255,102,51,0.6); font-family: 'Rajdhani', sans-serif;
    font-size: 11px; font-weight: 500; letter-spacing: 1px;
    text-transform: uppercase; cursor: pointer; text-decoration: none;
    transition: all 0.25s ease;
}
.mars-btn:hover {
    background: rgba(193,68,14,0.18); color: #ff6633;
    border-color: rgba(193,68,14,0.4);
}
.mars-btn.active {
    background: rgba(193,68,14,0.25); color: #ff6633;
    border-color: #c1440e; box-shadow: 0 0 8px rgba(255,68,34,0.2);
}
.mars-btn--reset { padding: 5px 8px; }
.mars-btn--reset svg { width: 14px; height: 14px; }
.mars-btn--back { color: rgba(255,102,51,0.4); }
.mars-btn--back:hover { color: #ff6633; }


/* ── 3D VIEWPORT ─────────────────────────────────────────────── */
.mars-viewport {
    position: fixed; inset: 0; z-index: 1;
    cursor: grab;
}
.mars-viewport:active { cursor: grabbing; }
.mars-viewport canvas { display: block; width: 100% !important; height: 100% !important; }


/* ── CORNER FRAMES ───────────────────────────────────────────── */
.mars-frame {
    position: fixed; z-index: 50; pointer-events: none;
    width: 40px; height: 40px;
}
.mars-frame--tl { top: 56px; left: 8px; border-top: 1px solid rgba(193,68,14,0.2); border-left: 1px solid rgba(193,68,14,0.2); }
.mars-frame--tr { top: 56px; right: 8px; border-top: 1px solid rgba(193,68,14,0.2); border-right: 1px solid rgba(193,68,14,0.2); }
.mars-frame--bl { bottom: 56px; left: 8px; border-bottom: 1px solid rgba(193,68,14,0.2); border-left: 1px solid rgba(193,68,14,0.2); }
.mars-frame--br { bottom: 56px; right: 8px; border-bottom: 1px solid rgba(193,68,14,0.2); border-right: 1px solid rgba(193,68,14,0.2); }


/* ── ATMOSPHERE LEGEND (left sidebar) ────────────────────────── */
.mars-atmos-legend {
    position: fixed; top: 70px; left: 16px; z-index: 60;
    width: 210px; padding: 14px;
    background: rgba(10,10,15,0.85);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(193,68,14,0.12);
    border-radius: 6px;
    display: none;
}
.mars-atmos-legend.visible { display: block; }

.mal-title {
    font-family: 'Rajdhani', sans-serif; font-weight: 600; font-size: 11px;
    letter-spacing: 2px; text-transform: uppercase; color: #ff6633;
    margin-bottom: 12px; padding-bottom: 6px;
    border-bottom: 1px solid rgba(193,68,14,0.15);
}

.mal-subtitle {
    font-family: 'Rajdhani', sans-serif; font-weight: 600; font-size: 10px;
    letter-spacing: 2px; text-transform: uppercase; color: rgba(255,102,51,0.5);
    margin: 10px 0 8px;
}

.mal-item {
    display: flex; align-items: center; gap: 8px;
    padding: 5px 0; cursor: pointer;
    transition: opacity 0.2s;
}
.mal-item:hover { opacity: 0.8; }

.mal-color {
    width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0;
}

.mal-info { display: flex; flex-direction: column; }

.mal-name {
    font-family: 'Rajdhani', sans-serif; font-size: 11px;
    font-weight: 500; color: #e0d0c0; letter-spacing: 0.5px;
}

.mal-range {
    font-family: 'Rajdhani', sans-serif; font-size: 9px;
    color: rgba(255,102,51,0.4); letter-spacing: 0.5px;
}

.mal-divider {
    height: 1px; margin: 8px 0;
    background: rgba(193,68,14,0.1);
}


/* ── MOON LEGEND (right sidebar) ─────────────────────────────── */
.mars-moon-legend {
    position: fixed; top: 70px; right: 16px; z-index: 60;
    width: 220px; padding: 14px;
    background: rgba(10,10,15,0.85);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(193,68,14,0.12);
    border-radius: 6px;
    display: none;
}
.mars-moon-legend.visible { display: block; }

.mml-title {
    font-family: 'Rajdhani', sans-serif; font-weight: 600; font-size: 11px;
    letter-spacing: 2px; text-transform: uppercase; color: #ff6633;
    margin-bottom: 12px; padding-bottom: 6px;
    border-bottom: 1px solid rgba(193,68,14,0.15);
}

.mml-item {
    display: flex; align-items: flex-start; gap: 8px;
    padding: 6px 0; cursor: pointer;
    transition: all 0.25s;
}
.mml-item:hover { background: rgba(193,68,14,0.08); border-radius: 4px; padding-left: 4px; }

.mml-color { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; margin-top: 2px; }

.mml-info { display: flex; flex-direction: column; gap: 1px; }

.mml-name {
    font-family: 'Rajdhani', sans-serif; font-size: 12px;
    font-weight: 600; color: #e0d0c0; letter-spacing: 1px;
}

.mml-range {
    font-family: 'Rajdhani', sans-serif; font-size: 9px;
    color: rgba(255,102,51,0.45); letter-spacing: 0.5px;
}

.mml-detail {
    font-family: 'Rajdhani', sans-serif; font-size: 9px;
    color: rgba(255,102,51,0.3); letter-spacing: 0.5px;
}

.mml-divider { height: 1px; margin: 8px 0; background: rgba(193,68,14,0.1); }

.mml-note {
    font-family: 'Inter', sans-serif; font-size: 9px;
    color: rgba(255,102,51,0.3); line-height: 1.5;
}


/* ── PANELS (structure, geology, mythology) ──────────────────── */
.mars-structure-panel,
.mars-geology-panel,
.mars-mythology-panel {
    position: fixed; z-index: 80;
    background: rgba(10,10,15,0.92);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(193,68,14,0.15);
    border-radius: 8px;
    display: none;
    overflow-y: auto;
}

.mars-structure-panel.visible,
.mars-geology-panel.visible,
.mars-mythology-panel.visible { display: block; }

.mars-structure-panel {
    bottom: 60px; left: 50%; transform: translateX(-50%);
    width: 700px; max-height: 320px; padding: 20px;
}

.mars-geology-panel {
    bottom: 60px; right: 16px;
    width: 380px; max-height: 400px; padding: 18px;
}

.mars-mythology-panel {
    top: 70px; left: 240px;
    width: 440px; max-height: calc(100vh - 140px); padding: 18px;
}

.mars-panel-close {
    position: absolute; top: 10px; right: 14px;
    background: none; border: none; color: rgba(255,102,51,0.5);
    font-size: 20px; cursor: pointer; transition: color 0.2s;
}
.mars-panel-close:hover { color: #ff6633; }

/* Structure panel */
.msp-title, .mgp-title, .mmp-title {
    font-family: 'Rajdhani', sans-serif; font-weight: 600; font-size: 12px;
    letter-spacing: 2px; text-transform: uppercase; color: #ff6633;
    margin-bottom: 14px; display: flex; align-items: center; gap: 8px;
}

.msp-body { display: flex; flex-direction: column; gap: 8px; }

.msp-layer {
    display: flex; align-items: center; gap: 12px;
    padding: 8px 12px; border-radius: 4px;
    background: rgba(193,68,14,0.06);
    border-left: 3px solid transparent;
    transition: all 0.2s;
}
.msp-layer:hover { background: rgba(193,68,14,0.12); }
.msp-layer-color { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; }
.msp-layer-info { display: flex; flex-direction: column; gap: 2px; }
.msp-layer-name {
    font-family: 'Rajdhani', sans-serif; font-size: 12px;
    font-weight: 600; color: #e0d0c0; letter-spacing: 0.5px;
}
.msp-layer-data {
    font-family: 'Inter', sans-serif; font-size: 10px;
    color: rgba(255,102,51,0.4); line-height: 1.4;
}

/* Geology panel */
.mgp-body { display: flex; flex-direction: column; gap: 10px; }

.mgp-feature {
    padding: 10px 12px; border-radius: 4px;
    background: rgba(193,68,14,0.06);
    border-left: 3px solid #c1440e;
}
.mgp-feature-name {
    font-family: 'Rajdhani', sans-serif; font-size: 12px;
    font-weight: 600; color: #ff6633; letter-spacing: 1px;
    margin-bottom: 4px;
}
.mgp-feature-desc {
    font-family: 'Inter', sans-serif; font-size: 10px;
    color: rgba(224,208,192,0.6); line-height: 1.5;
}

/* Mythology panel */
.mmp-body { display: flex; flex-direction: column; gap: 12px; }

.mmp-section {
    padding: 10px 12px; border-radius: 4px;
    background: rgba(193,68,14,0.05);
}
.mmp-section-title {
    font-family: 'Cinzel', serif; font-size: 12px;
    font-weight: 600; color: #ff6633; margin-bottom: 6px;
    letter-spacing: 1px;
}
.mmp-section-body {
    font-family: 'Inter', sans-serif; font-size: 10px;
    color: rgba(224,208,192,0.6); line-height: 1.6;
}

.mmp-jyotish {
    padding: 12px; border-radius: 6px;
    background: rgba(193,68,14,0.08);
    border: 1px solid rgba(193,68,14,0.12);
}
.mmp-jyotish-title {
    font-family: 'Cinzel', serif; font-size: 13px;
    font-weight: 700; color: #ff6633; margin-bottom: 8px;
    letter-spacing: 1.5px; text-align: center;
}
.mmp-jyotish-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
}
.mmp-jyotish-item {
    display: flex; justify-content: space-between; padding: 3px 0;
    font-family: 'Rajdhani', sans-serif; font-size: 11px;
}
.mmp-jyotish-label { color: rgba(255,102,51,0.45); }
.mmp-jyotish-value { color: #e0d0c0; font-weight: 600; }


/* ── TELEMETRY HUD ───────────────────────────────────────────── */
.mars-telemetry {
    position: fixed; top: 62px; right: 16px; z-index: 55;
    padding: 10px 14px;
    background: rgba(10,10,15,0.7);
    border: 1px solid rgba(193,68,14,0.1);
    border-radius: 4px;
    display: flex; flex-direction: column; gap: 4px;
}

.mt-row { display: flex; align-items: center; gap: 10px; }

.mt-label {
    font-family: 'Rajdhani', sans-serif; font-size: 9px;
    font-weight: 500; letter-spacing: 2px; text-transform: uppercase;
    color: rgba(255,102,51,0.35); min-width: 42px;
}

.mt-value {
    font-family: 'Rajdhani', sans-serif; font-size: 11px;
    font-weight: 600; color: #ff6633; letter-spacing: 1px;
}


/* ── STATS BAR ───────────────────────────────────────────────── */
.mars-stats-bar {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 90;
    display: flex; align-items: center; justify-content: center; gap: 0;
    height: 36px; padding: 0 20px;
    background: rgba(10,10,15,0.9);
    border-top: 1px solid rgba(193,68,14,0.12);
}

.msb-item { display: flex; align-items: center; gap: 6px; padding: 0 16px; }

.msb-label {
    font-family: 'Rajdhani', sans-serif; font-size: 9px;
    font-weight: 500; letter-spacing: 2px; text-transform: uppercase;
    color: rgba(255,102,51,0.3);
}

.msb-value {
    font-family: 'Rajdhani', sans-serif; font-size: 11px;
    font-weight: 600; color: rgba(255,102,51,0.6); letter-spacing: 0.5px;
}

.msb-sep {
    width: 1px; height: 16px;
    background: rgba(193,68,14,0.12);
}


/* ── HUD ─────────────────────────────────────────────────────── */
.mars-hud {
    position: fixed; bottom: 44px; left: 16px; right: 16px; z-index: 55;
    display: flex; align-items: flex-end; justify-content: space-between;
    pointer-events: none;
}

.mars-hud-label {
    font-family: 'Rajdhani', sans-serif; font-weight: 600; font-size: 14px;
    letter-spacing: 3px; text-transform: uppercase; color: rgba(255,102,51,0.25);
    display: flex; align-items: center; gap: 8px;
}

.mars-hud-hint {
    font-family: 'Inter', sans-serif; font-size: 9px;
    color: rgba(255,102,51,0.15); margin-top: 4px; letter-spacing: 0.5px;
}

.mars-hud-coord {
    font-family: 'Rajdhani', sans-serif; font-size: 11px;
    font-weight: 500; color: rgba(255,102,51,0.2); letter-spacing: 2px;
}


/* ── FOOTER STRIP ────────────────────────────────────────────── */
.footer-strip {
    position: fixed; bottom: 36px; left: 0; right: 0; z-index: 85;
    height: 22px; overflow: hidden;
    background: rgba(10,10,15,0.6);
    border-top: 1px solid rgba(193,68,14,0.08);
    border-bottom: 1px solid rgba(193,68,14,0.06);
}

.footer-strip-inner { width: 100%; height: 100%; overflow: hidden; }

.sanskrit-marquee { width: 100%; height: 100%; overflow: hidden; position: relative; }

.sanskrit-marquee-track {
    display: flex; align-items: center; gap: 18px;
    height: 100%; white-space: nowrap;
    animation: marsMarquee 60s linear infinite;
}

.sanskrit-quote {
    font-family: 'Noto Sans Devanagari', sans-serif; font-size: 11px;
    font-weight: 400; color: rgba(193,68,14,0.2); letter-spacing: 1px;
    flex-shrink: 0;
}

.sanskrit-sep {
    font-size: 8px; color: rgba(193,68,14,0.1); flex-shrink: 0;
}


/* ── LOADING OVERLAY ─────────────────────────────────────────── */
.mars-loading {
    position: fixed; inset: 0; z-index: 10000;
    display: flex; align-items: center; justify-content: center;
    background: #0a0a0f;
    transition: opacity 0.8s ease;
}
.mars-loading.hidden { opacity: 0; pointer-events: none; }

.mars-loading-inner { text-align: center; }

.mars-loading-orbit {
    position: relative; width: 100px; height: 100px; margin: 0 auto 24px;
}

.mars-loading-ring {
    position: absolute; inset: 0;
    border: 1px solid transparent; border-radius: 50%;
}
.mars-loading-ring--1 {
    border-top-color: #c1440e; border-bottom-color: rgba(193,68,14,0.3);
    animation: marsLoadSpin 1.8s linear infinite;
}
.mars-loading-ring--2 {
    inset: 12px;
    border-left-color: #ff6633; border-right-color: rgba(255,102,51,0.3);
    animation: marsLoadSpin 2.4s linear infinite reverse;
}

.mars-loading-globe {
    position: absolute; top: 50%; left: 50%;
    width: 24px; height: 24px; margin: -12px 0 0 -12px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #ff6633, #c1440e, #6a2205);
    box-shadow: 0 0 20px rgba(255,68,34,0.3);
}

.mars-loading-text {
    font-family: 'Cinzel', serif; font-size: 16px;
    font-weight: 600; color: #ff6633;
    letter-spacing: 3px; text-transform: uppercase;
}

.mars-loading-sub {
    font-family: 'Inter', sans-serif; font-size: 11px;
    color: rgba(255,102,51,0.35); margin-top: 8px;
}

.mars-loading-bar {
    width: 200px; height: 2px; margin: 16px auto 0;
    background: rgba(193,68,14,0.15); border-radius: 1px;
    overflow: hidden;
}

.mars-loading-bar-fill {
    width: 0; height: 100%;
    background: linear-gradient(90deg, #c1440e, #ff6633);
    border-radius: 1px;
    animation: marsLoadBar 2s ease-in-out forwards;
}


/* ── ANIMATIONS ──────────────────────────────────────────────── */
@keyframes marsPulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 4px #ff4422; }
    50% { opacity: 0.4; box-shadow: 0 0 8px #ff4422; }
}

@keyframes marsMarquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

@keyframes marsLoadSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes marsLoadBar {
    0% { width: 0; }
    50% { width: 60%; }
    100% { width: 100%; }
}

@keyframes marsDustFloat {
    0%, 100% { transform: translateY(0) translateX(0); opacity: 0.3; }
    50% { transform: translateY(-10px) translateX(5px); opacity: 0.6; }
}


/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 1200px) {
    .mars-navbar { padding: 0 12px; }
    .mars-nav-controls { gap: 4px; }
    .mars-btn { padding: 4px 7px; font-size: 10px; }
    .mars-structure-panel { width: 90vw; }
    .mars-mythology-panel { left: 16px; width: calc(100vw - 260px); }
}

@media (max-width: 900px) {
    .mars-atmos-legend { width: 180px; }
    .mars-moon-legend { width: 190px; }
    .mars-btn span:not(.ci) { display: none; }
    .mars-logo-text { display: none; }
    .mars-geology-panel { width: 300px; }
}
