/* ==========================================================================
   COSMIC WATCH 2026 - TACTICAL SPACE DESIGN SYSTEM
   Estilos CSS para HUD de Monitoreo Pro-Am, Glassmorphism y Viewport 3D
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
    --bg-space: #07090e;
    --bg-panel: rgba(12, 17, 28, 0.78);
    --bg-card: rgba(18, 24, 40, 0.65);
    --bg-card-hover: rgba(28, 38, 62, 0.85);
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-highlight: rgba(99, 102, 241, 0.35);
    
    --accent-primary: #6366f1;
    --accent-glow: rgba(99, 102, 241, 0.5);
    --accent-cyan: #38bdf8;
    --accent-emerald: #10b981;
    --accent-amber: #f59e0b;
    --accent-rose: #f43f5e;
    --accent-seestar: #818cf8;

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

* {
    box-sizing: border-box;
}

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: var(--bg-space);
    color: var(--text-primary);
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    user-select: none;
}

/* 3D WebGL Canvas Viewport */
#canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    background: radial-gradient(circle at 50% 50%, #0d1322 0%, #05070a 100%);
}

/* UI Overlay Layer (Pointer Events passthrough to 3D canvas) */
#ui-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10;
    display: flex;
    flex-direction: column;
    pointer-events: none;
}

/* Enable pointer events on actual interactive panels */
.interactive-panel {
    pointer-events: auto;
}

/* Glassmorphism Styles */
.glass-panel {
    background: var(--bg-panel);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--border-subtle);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-card:hover {
    background: var(--bg-card-hover);
    border-color: rgba(99, 102, 241, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), 0 0 15px rgba(99, 102, 241, 0.15);
}

/* Custom Tactical Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(10, 15, 26, 0.6);
}

::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.3);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.6);
}

/* Header HUD */
#hud-header {
    height: 60px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(7, 10, 18, 0.82);
    backdrop-filter: blur(14px);
    z-index: 50;
}

/* Pulse Beacons & Badges */
.pulse-live {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    animation: pulse-ring 2s infinite cubic-bezier(0.66, 0, 0, 1);
}

@keyframes pulse-ring {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

.pulse-seestar {
    animation: pulse-purple 2.5s infinite ease-in-out;
}

@keyframes pulse-purple {
    0%, 100% {
        box-shadow: 0 0 8px rgba(129, 140, 248, 0.3);
    }
    50% {
        box-shadow: 0 0 18px rgba(129, 140, 248, 0.7);
    }
}

/* Event Feed Cards */
.event-card {
    position: relative;
    cursor: pointer;
    overflow: hidden;
}

.event-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 3px;
    background: var(--card-border-color, #4f46e5);
    transition: width 0.2s ease;
}

.event-card:hover::before {
    width: 6px;
}

/* Target Inspector Drawer */
#target-drawer {
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
}

#target-drawer.hidden-drawer {
    transform: translateX(110%);
    opacity: 0;
    pointer-events: none;
}

/* Field of View (FoV) Simulator Widget */
.fov-circle {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 2px dashed rgba(99, 102, 241, 0.6);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle, rgba(14, 21, 37, 0.8) 0%, rgba(7, 10, 18, 0.95) 100%);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
}

.fov-circle::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-rose);
    box-shadow: 0 0 8px var(--accent-rose);
}

/* Crosshair Reticle in FoV */
.fov-crosshair-h {
    position: absolute;
    width: 100%;
    height: 1px;
    background: rgba(255, 255, 255, 0.15);
}

.fov-crosshair-v {
    position: absolute;
    height: 100%;
    width: 1px;
    background: rgba(255, 255, 255, 0.15);
}

/* 3D Canvas Reticle Tooltip */
#canvas-tooltip {
    position: absolute;
    transform: translate(-50%, -120%);
    pointer-events: none;
    z-index: 100;
    transition: opacity 0.15s ease;
}

/* Toast Animations */
@keyframes toastSlideIn {
    from {
        transform: translateY(20px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

@keyframes toastSlideOut {
    from {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    to {
        transform: translateY(20px) scale(0.95);
        opacity: 0;
    }
}

.toast-enter {
    animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.toast-exit {
    animation: toastSlideOut 0.25s ease forwards;
}

/* Alt-Az Radar Horizon Overlay */
#radar-horizon-view {
    position: fixed;
    top: 60px;
    left: 0;
    width: 100vw;
    height: calc(100vh - 60px);
    background: radial-gradient(circle at center, rgba(14, 21, 37, 0.95) 0%, rgba(5, 8, 14, 0.98) 80%);
    z-index: 25;
    display: none; /* Crucial: hidden by default so 3D Globe is visible */
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

#radar-horizon-view.active-radar,
#radar-horizon-view:not(.hidden):not([style*="display: none"]) {
    display: flex;
}

#radar-horizon-view.hidden,
#radar-horizon-view[style*="display: none"] {
    display: none !important;
}

.radar-grid {
    width: min(80vw, 80vh);
    height: min(80vw, 80vh);
    border-radius: 50%;
    border: 1px solid rgba(56, 189, 248, 0.25);
    position: relative;
    box-shadow: 0 0 50px rgba(56, 189, 248, 0.1), inset 0 0 50px rgba(56, 189, 248, 0.05);
}

.radar-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 1px dashed rgba(56, 189, 248, 0.2);
}

.radar-ring-30 { width: 33.3%; height: 33.3%; }
.radar-ring-60 { width: 66.6%; height: 66.6%; }

.radar-axis-h {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    background: rgba(56, 189, 248, 0.2);
}

.radar-axis-v {
    position: absolute;
    top: 0;
    left: 50%;
    width: 1px;
    height: 100%;
    background: rgba(56, 189, 248, 0.2);
}

.radar-sweep {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: conic-gradient(from 0deg, rgba(56, 189, 248, 0.15) 0deg, transparent 60deg);
    animation: radar-rotate 6s linear infinite;
    pointer-events: none;
}

@keyframes radar-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Responsive Rules */
@media (max-width: 1024px) {
    #left-hud-panel {
        width: 100%;
        max-width: 420px;
    }
}

@media (max-width: 768px) {
    #ui-content-area {
        flex-direction: column-reverse;
    }
    #left-hud-panel {
        max-width: 100%;
        height: 55%;
        border-right: none;
        border-top: 1px solid var(--border-subtle);
    }
    #target-drawer {
        width: 100% !important;
        height: 70%;
        bottom: 0;
        top: auto !important;
        right: 0;
    }
    #target-drawer.hidden-drawer {
        transform: translateY(110%);
    }
}
