/* AstroSphere 3D — Interface Estilo Stellarium Web Pro */
:root {
    --bg-space: #03060f;
    --panel-bg: rgba(10, 17, 34, 0.84);
    --panel-border: rgba(96, 165, 250, 0.25);
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --accent: #38bdf8;
    --accent-cyan: #00f5d4;
    --accent-gold: #fbbf24;
    --danger: #ff4d6d;
}

body.night-vision {
    --panel-bg: rgba(25, 3, 3, 0.9);
    --panel-border: rgba(255, 50, 50, 0.35);
    --text-main: #ff5555;
    --text-muted: #b83232;
    --accent: #ff3333;
    --accent-cyan: #ff4444;
    --accent-gold: #ff6666;
    filter: sepia(100%) hue-rotate(-50deg) saturate(450%) contrast(1.1);
}

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

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--bg-space);
    color: var(--text-main);
    font-family: 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
    user-select: none;
}

#viewport3d {
    position: fixed;
    inset: 0;
    z-index: 1;
}

#labelsLayer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
}

.sky-label {
    position: absolute;
    top: -10px;
    left: 6px;
    font-size: 11px;
    font-weight: 600;
    text-shadow: 0 1px 4px #000, 0 0 8px #000;
    white-space: nowrap;
}

.sky-label-cardinal {
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 1px;
}

.sky-label-constellation {
    font-size: 11px;
    opacity: 0.72;
    font-style: italic;
}

.sky-label-probe {
    font-size: 12px;
    font-weight: 700;
    background: rgba(0, 0, 0, 0.55);
    padding: 1px 5px;
    border-radius: 4px;
}

/* Barra Superior */
.top-bar {
    position: fixed;
    top: 12px;
    left: 12px;
    right: 12px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--panel-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    padding: 8px 14px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-title {
    font-weight: 700;
    font-size: 15px;
    color: var(--accent-cyan);
    letter-spacing: 0.4px;
}

.brand-sub {
    font-size: 11px;
    color: var(--text-muted);
}

.search-box {
    position: relative;
    flex: 1;
    max-width: 380px;
}

.search-box input {
    width: 100%;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid var(--panel-border);
    color: var(--text-main);
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 13px;
    outline: none;
}

.search-box input:focus {
    border-color: var(--accent-cyan);
}

.search-results {
    position: absolute;
    top: 38px;
    left: 0;
    right: 0;
    background: rgba(8, 14, 28, 0.96);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    max-height: 280px;
    overflow-y: auto;
    z-index: 30;
}

.search-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    font-size: 12px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.search-item:hover {
    background: rgba(56, 189, 248, 0.18);
}

.search-empty {
    padding: 10px;
    font-size: 12px;
    color: var(--text-muted);
}

.mode-switch {
    display: flex;
    gap: 6px;
}

/* Botões e Controles */
button, select {
    background: rgba(15, 23, 42, 0.85);
    color: var(--text-main);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
}

button:hover, select:hover {
    border-color: var(--accent);
}

button.active {
    background: rgba(56, 189, 248, 0.25);
    border-color: var(--accent-cyan);
    color: #fff;
    font-weight: 600;
}

.btn-sm {
    padding: 5px 9px;
    font-size: 11px;
}

.btn-primary {
    background: rgba(0, 245, 212, 0.2);
    border-color: var(--accent-cyan);
}

/* Inspetor de Objeto (Esquerda) */
.inspector-card {
    position: fixed;
    top: 72px;
    left: 12px;
    width: 330px;
    z-index: 12;
    background: var(--panel-bg);
    backdrop-filter: blur(14px);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    padding: 14px;
}

.btn-close {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 2px 7px;
    font-size: 12px;
}

.insp-header h3 {
    font-size: 16px;
    color: var(--accent-gold);
    margin-bottom: 3px;
    padding-right: 24px;
}

.insp-type {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.badge {
    display: inline-block;
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 99px;
    font-weight: 600;
    margin-bottom: 8px;
}

.badge-ok { background: rgba(0, 245, 212, 0.18); color: var(--accent-cyan); }
.badge-warn { background: rgba(255, 77, 109, 0.18); color: var(--danger); }

.tele-grid {
    display: flex;
    flex-direction: column;
    gap: 5px;
    border-top: 1px solid rgba(255,255,255,0.08);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding: 8px 0;
    margin: 6px 0;
    font-size: 12px;
}

.tele-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.tele-row span { color: var(--text-muted); }

.insp-desc {
    font-size: 12px;
    line-height: 1.45;
    color: #cbd5e1;
    margin: 8px 0 10px;
}

.insp-actions {
    display: flex;
    gap: 8px;
}

/* Painéis Laterais (Direita) */
.side-drawer {
    position: fixed;
    top: 72px;
    right: 12px;
    bottom: 68px;
    width: 370px;
    z-index: 12;
    background: var(--panel-bg);
    backdrop-filter: blur(14px);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    padding: 14px;
    overflow-y: auto;
}

.side-drawer h2 {
    font-size: 15px;
    color: var(--accent-cyan);
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 6px;
}

.probe-card, .event-card, .sat-item {
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(96, 165, 250, 0.2);
    border-radius: 9px;
    padding: 10px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: border-color 0.15s;
}

.probe-card:hover, .event-card:hover, .sat-item:hover {
    border-color: var(--accent-cyan);
}

.probe-card-top, .event-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    font-size: 13px;
}

.probe-alt.up { color: var(--accent-cyan); font-size: 11px; }
.probe-alt.down { color: var(--text-muted); font-size: 11px; }

.probe-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 11px;
    color: var(--text-muted);
}

.probe-metrics b { color: var(--text-main); }

.sat-tag {
    font-size: 10px;
    padding: 1px 5px;
    border-radius: 4px;
    font-weight: 700;
    margin-right: 5px;
}
.tag-iss { background: rgba(0, 245, 212, 0.2); color: #00f5d4; }
.tag-debris { background: rgba(255, 77, 109, 0.2); color: #ff4d6d; }
.tag-sat { background: rgba(251, 191, 36, 0.2); color: #fbbf24; }

.event-badge {
    background: rgba(56, 189, 248, 0.2);
    color: var(--accent);
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
}

.event-card p {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 4px;
    line-height: 1.4;
}

/* Calculadora de Distância 3D */
.dist-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.dist-form label {
    font-size: 11px;
    color: var(--text-muted);
}

.dist-result-box {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid var(--accent-gold);
    border-radius: 10px;
    padding: 12px;
}

.dist-pair {
    font-weight: 700;
    color: var(--accent-gold);
    font-size: 13px;
    margin-bottom: 8px;
}

.dist-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
}

.dist-grid div {
    display: flex;
    justify-content: space-between;
}

.dist-grid span { color: var(--text-muted); }

/* Barra Inferior (Dock estilo Stellarium) */
.bottom-dock {
    position: fixed;
    bottom: 12px;
    left: 12px;
    right: 12px;
    z-index: 10;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: var(--panel-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    padding: 7px 14px;
}

.dock-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.hud-readout {
    font-size: 11.5px;
    color: var(--text-muted);
    display: flex;
    gap: 10px;
    align-items: center;
}

.hud-readout strong {
    color: var(--accent-cyan);
    font-variant-numeric: tabular-nums;
}

.hidden {
    display: none !important;
}
