/* ORBIT - Cinematic Space Intelligence UI */
:root {
  --bg-void: #030810;
  --bg-deep: #0a1628;
  --bg-panel: rgba(8, 20, 40, 0.85);
  --bg-card: rgba(12, 28, 52, 0.9);
  --accent-cyan: #00E5C8;
  --accent-amber: #FFB347;
  --accent-red: #FF4444;
  --accent-violet: #9B59B6;
  --accent-gold: #FFD700;
  --text-primary: #e8f0ff;
  --text-secondary: #7a8ba8;
  --text-dim: #3d5070;
  --border-glow: rgba(0, 229, 200, 0.2);
  --font-display: 'Orbitron', sans-serif;
  --font-body: 'Inter', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

body {
  font-family: var(--font-body);
  background: var(--bg-void);
  color: var(--text-primary);
  overflow: hidden;
  width: 100vw;
  height: 100vh;
}

/* === BOOT SEQUENCE === */
#boot-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-void);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}
#boot-overlay.fade-out { opacity: 0; visibility: hidden; }

.boot-content { text-align: center; }
.boot-logo {
  font-family: var(--font-display);
  font-size: 5rem;
  font-weight: 900;
  letter-spacing: 1.5rem;
  color: var(--accent-cyan);
  text-shadow: 0 0 40px rgba(0, 229, 200, 0.5), 0 0 80px rgba(0, 229, 200, 0.2);
  animation: logoGlow 2s ease-in-out infinite alternate;
}
@keyframes logoGlow {
  from { text-shadow: 0 0 40px rgba(0, 229, 200, 0.5), 0 0 80px rgba(0, 229, 200, 0.2); }
  to { text-shadow: 0 0 60px rgba(0, 229, 200, 0.8), 0 0 120px rgba(0, 229, 200, 0.3); }
}
.boot-sub {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-secondary);
  letter-spacing: 0.5rem;
  margin-top: 0.5rem;
}
.boot-loader {
  width: 300px;
  height: 2px;
  background: rgba(255,255,255,0.1);
  margin: 2rem auto;
  border-radius: 1px;
  overflow: hidden;
}
.boot-loader-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-amber));
  border-radius: 1px;
  animation: loadBar 2.5s ease-in-out forwards;
}
@keyframes loadBar { to { width: 100%; } }
.boot-status {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  letter-spacing: 0.2rem;
}

/* === GLOBE === */
#globe-container {
  position: fixed;
  inset: 0;
  z-index: 1;
}
#globe-container canvas {
  width: 100% !important;
  height: 100% !important;
}

/* === TOP BAR === */
#top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(180deg, rgba(3, 8, 16, 0.95) 0%, rgba(3, 8, 16, 0.7) 80%, transparent 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  z-index: 100;
  backdrop-filter: blur(10px);
}
.top-left { display: flex; align-items: baseline; gap: 1rem; }
.logo {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent-cyan);
  letter-spacing: 0.3rem;
  text-shadow: 0 0 20px rgba(0, 229, 200, 0.4);
}
.logo-sub {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-dim);
  letter-spacing: 0.15rem;
}
.top-center { flex: 1; max-width: 500px; margin: 0 2rem; }
.search-container { position: relative; }
#search-input {
  width: 100%;
  padding: 0.5rem 1rem 0.5rem 2.2rem;
  background: rgba(8, 20, 40, 0.8);
  border: 1px solid var(--border-glow);
  border-radius: 4px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
}
#search-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 15px rgba(0, 229, 200, 0.15);
}
#search-input::placeholder { color: var(--text-dim); }
.search-icon {
  position: absolute;
  left: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 1rem;
}
.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: 4px;
  margin-top: 4px;
  max-height: 300px;
  overflow-y: auto;
  display: none;
  backdrop-filter: blur(10px);
}
.search-results.active { display: block; }
.search-result-item {
  padding: 0.6rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  transition: background 0.2s;
}
.search-result-item:hover { background: rgba(0, 229, 200, 0.1); }
.search-result-name { font-weight: 500; font-size: 0.85rem; }
.search-result-meta { font-size: 0.7rem; color: var(--text-secondary); font-family: var(--font-mono); }

.top-right { text-align: right; }
.utc-clock {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--accent-cyan);
  font-weight: 500;
  letter-spacing: 0.1rem;
}
.obj-count {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* === FILTER PANEL === */
#filter-panel {
  position: fixed;
  top: 70px;
  left: 1rem;
  width: 220px;
  background: var(--bg-panel);
  border: 1px solid var(--border-glow);
  border-radius: 8px;
  padding: 1rem;
  z-index: 100;
  backdrop-filter: blur(15px);
  max-height: calc(100vh - 160px);
  overflow-y: auto;
}
.panel-header {
  font-family: var(--font-display);
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--accent-cyan);
  letter-spacing: 0.2rem;
  margin-bottom: 0.8rem;
}
.panel-divider { height: 1px; background: var(--border-glow); margin: 1rem 0; }

.filter-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0;
  cursor: pointer;
  transition: opacity 0.2s;
  opacity: 1;
}
.filter-item.disabled { opacity: 0.35; }
.filter-color {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 6px currentColor;
}
.filter-label {
  font-size: 0.78rem;
  color: var(--text-primary);
  flex: 1;
}
.filter-count {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-dim);
}

.shell-legend { padding-top: 0.3rem; }
.shell-item {
  font-size: 0.72rem;
  color: var(--text-secondary);
  padding: 0.3rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.shell-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* === DETAIL PANEL === */
#detail-panel {
  position: fixed;
  top: 70px;
  right: 1rem;
  width: 280px;
  background: var(--bg-panel);
  border: 1px solid var(--border-glow);
  border-radius: 8px;
  padding: 1.2rem;
  z-index: 100;
  backdrop-filter: blur(15px);
  transition: transform 0.3s ease, opacity 0.3s ease;
}
#detail-panel.hidden {
  transform: translateX(320px);
  opacity: 0;
  pointer-events: none;
}
.detail-header { margin-bottom: 1rem; }
.detail-close {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  cursor: pointer;
  color: var(--text-dim);
  font-size: 1rem;
  transition: color 0.2s;
}
.detail-close:hover { color: var(--accent-cyan); }
.detail-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  padding-right: 1.5rem;
}
.detail-norad {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent-cyan);
  margin-top: 0.3rem;
}
.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 0.45rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.detail-label {
  font-size: 0.72rem;
  color: var(--text-secondary);
}
.detail-value {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-primary);
  font-weight: 500;
}

/* === BOTTOM BAR === */
#bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 36px;
  background: linear-gradient(0deg, rgba(3, 8, 16, 0.9) 0%, transparent 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  z-index: 100;
}
.data-freshness {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.freshness-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-cyan);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
.disclaimer {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-dim);
  opacity: 0.7;
}

/* === SCANLINE === */
.scanline {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(0, 229, 200, 0.08), transparent);
  z-index: 99;
  animation: scanDown 8s linear infinite;
  pointer-events: none;
}
@keyframes scanDown {
  0% { top: 0; }
  100% { top: 100vh; }
}

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-glow); border-radius: 2px; }

/* === RESPONSIVE === */
@media (max-width: 768px) {
  #filter-panel { display: none; }
  #detail-panel { width: calc(100% - 2rem); right: 1rem; }
  .top-center { max-width: none; flex: 1; margin: 0 0.5rem; }
  .logo-sub { display: none; }
  .logo { font-size: 1rem; letter-spacing: 0.15rem; }
  #top-bar { height: 50px; padding: 0 0.6rem; }
  #search-input { font-size: 16px; padding: 0.45rem 0.8rem 0.45rem 2rem; }
  .utc-clock { font-size: 0.85rem; }
  .obj-count { font-size: 0.6rem; }
}

@media (max-width: 480px) {
  .top-left { gap: 0.3rem; }
  .top-right { min-width: 70px; }
  #search-input { font-size: 16px; padding: 0.4rem 0.6rem 0.4rem 1.8rem; }
}
