/* ==========================================================================
   SPACE SCIENCE MISSION CONTROL - CORE DESIGN SYSTEM
   ========================================================================== */

:root {
  --bg-space: #060814;
  --bg-deep: #0a0e24;
  --bg-card: rgba(13, 19, 46, 0.75);
  --bg-card-hover: rgba(22, 33, 76, 0.85);
  --bg-hud: rgba(6, 12, 34, 0.88);
  --border-glow: rgba(0, 242, 254, 0.3);
  --border-neon: rgba(79, 172, 254, 0.45);
  --border-accent: rgba(255, 0, 127, 0.4);

  --accent-cyan: #00f2fe;
  --accent-blue: #4facfe;
  --accent-gold: #ffb703;
  --accent-pink: #ff007f;
  --accent-green: #10b981;
  --accent-purple: #9d4edd;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --text-glow: rgba(255, 255, 255, 0.95);

  --font-hud: 'Orbitron', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --shadow-glow: 0 0 25px rgba(0, 242, 254, 0.25);
  --shadow-neon: 0 0 30px rgba(79, 172, 254, 0.35);
  --shadow-pink: 0 0 30px rgba(255, 0, 127, 0.3);
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  background-color: var(--bg-space);
  color: var(--text-main);
  font-family: var(--font-body);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Cosmic Background Starfield Canvas */
#starfield-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  pointer-events: none;
}

.cosmic-nebula-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  background: 
    radial-gradient(circle at 20% 20%, rgba(79, 172, 254, 0.12) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(255, 0, 127, 0.08) 0%, transparent 60%),
    radial-gradient(circle at 50% 50%, rgba(157, 78, 221, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

/* App Container */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-bottom: 80px; /* Space for mobile nav */
}

@media (min-width: 768px) {
  .app-container {
    padding-bottom: 20px;
  }
}

/* ==========================================================================
   HEADER / MISSION CONTROL HUD
   ========================================================================== */

.hud-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: var(--bg-hud);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-glow);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

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

.brand-icon {
  font-size: 1.8rem;
  filter: drop-shadow(0 0 10px var(--accent-cyan));
  animation: pulse-glow 3s infinite alternate;
}

@keyframes pulse-glow {
  0% { transform: scale(1); filter: drop-shadow(0 0 8px var(--accent-cyan)); }
  100% { transform: scale(1.08); filter: drop-shadow(0 0 16px var(--accent-pink)); }
}

.brand-text h1 {
  font-family: var(--font-hud);
  font-size: 1.15rem;
  letter-spacing: 1.5px;
  font-weight: 700;
  background: linear-gradient(90deg, var(--accent-cyan), #ffffff, var(--accent-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-badge {
  font-family: var(--font-hud);
  font-size: 0.65rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent-gold);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.badge-dot {
  width: 6px;
  height: 6px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 8px #10b981;
  animation: blink 1.5s infinite;
}

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

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

.hud-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glow);
  color: var(--text-main);
  padding: 8px 14px;
  border-radius: var(--radius-full);
  font-family: var(--font-hud);
  font-size: 0.8rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.hud-btn:hover {
  background: rgba(0, 242, 254, 0.15);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.4);
  transform: translateY(-1px);
}

.hud-btn:active {
  transform: scale(0.96);
}

/* Desktop Navigation */
.desktop-nav {
  display: none;
}

@media (min-width: 768px) {
  .desktop-nav {
    display: flex;
    gap: 8px;
  }
}

.nav-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-family: var(--font-hud);
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}

.nav-tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.nav-tab-btn.active {
  color: #ffffff;
  background: rgba(0, 242, 254, 0.12);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 16px rgba(0, 242, 254, 0.3);
}

/* ==========================================================================
   MOBILE BOTTOM NAVIGATION BAR
   ========================================================================== */

.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 64px;
  background: var(--bg-hud);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-glow);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 999;
  padding: 4px 8px;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.6);
}

@media (min-width: 768px) {
  .mobile-bottom-nav {
    display: none;
  }
}

.mobile-nav-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: 1;
  height: 100%;
  cursor: pointer;
  font-family: var(--font-hud);
  font-size: 0.65rem;
  letter-spacing: 0.5px;
  transition: var(--transition);
  border-radius: var(--radius-sm);
  padding: 2px 0;
}

.mobile-nav-btn span.icon {
  font-size: 1.3rem;
  transition: transform 0.2s;
}

.mobile-nav-btn.active {
  color: var(--accent-cyan);
}

.mobile-nav-btn.active span.icon {
  transform: scale(1.18);
  filter: drop-shadow(0 0 8px var(--accent-cyan));
}

/* ==========================================================================
   VIEW CONTAINERS & SECTIONS
   ========================================================================== */

.view-section {
  display: none;
  padding: 16px;
  max-width: 1300px;
  margin: 0 auto;
  width: 100%;
  animation: fadeIn 0.3s ease-out;
}

.view-section.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-header {
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.section-title h2 {
  font-family: var(--font-hud);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 1px;
}

.section-title span.tag {
  font-family: var(--font-hud);
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: rgba(0, 242, 254, 0.12);
  color: var(--accent-cyan);
  border: 1px solid var(--border-glow);
}

.section-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ==========================================================================
   1. SOLAR SYSTEM SIMULATOR VIEW
   ========================================================================== */

.simulator-container {
  position: relative;
  width: 100%;
  height: calc(100vh - 160px);
  min-height: 480px;
  max-height: 820px;
  background: radial-gradient(circle at center, #0c1538 0%, #050814 80%);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), inset 0 0 40px rgba(0, 242, 254, 0.05);
}

#solar-canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: none;
}

#solar-canvas:active {
  cursor: grabbing;
}

/* Simulator Floating Controls */
.sim-controls-panel {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(6, 12, 34, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glow);
  z-index: 10;
  pointer-events: auto;
}

.sim-speed-box {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.sim-speed-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 90px;
  height: 6px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  outline: none;
}

.sim-speed-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan);
  cursor: pointer;
}

.sim-quick-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glow);
  color: var(--text-main);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-family: var(--font-hud);
  cursor: pointer;
  transition: var(--transition);
}

.sim-quick-btn:hover, .sim-quick-btn.active {
  background: rgba(0, 242, 254, 0.2);
  border-color: var(--accent-cyan);
  color: #fff;
}

/* Planet Quick Selector Bar */
.planet-quick-bar {
  position: absolute;
  bottom: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 4px;
  z-index: 10;
  scrollbar-width: none;
}

.planet-quick-bar::-webkit-scrollbar {
  display: none;
}

.planet-pill-btn {
  background: rgba(6, 12, 34, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-glow);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  color: var(--text-main);
  font-size: 0.78rem;
  font-family: var(--font-hud);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  cursor: pointer;
  transition: var(--transition);
}

.planet-pill-btn:hover {
  background: rgba(0, 242, 254, 0.25);
  border-color: var(--accent-cyan);
  transform: translateY(-2px);
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.4);
}

.planet-indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.sim-hint-overlay {
  position: absolute;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  color: var(--text-muted);
  pointer-events: none;
  text-align: center;
  white-space: nowrap;
  animation: fadePulse 4s infinite ease-in-out;
}

@keyframes fadePulse {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 0.3; }
}

/* ==========================================================================
   PLANET INSPECTOR MODAL HUD
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(3, 5, 15, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-backdrop.active {
  display: flex;
  animation: modalFadeIn 0.25s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-dialog {
  background: var(--bg-deep);
  border: 1px solid var(--border-neon);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow-neon), 0 20px 50px rgba(0, 0, 0, 0.8);
  padding: 24px;
  color: var(--text-main);
  animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.modal-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glow);
  color: var(--text-muted);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: var(--transition);
}

.modal-close-btn:hover {
  background: var(--accent-pink);
  color: #fff;
  border-color: var(--accent-pink);
  transform: rotate(90deg);
}

.planet-modal-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.planet-modal-sphere {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
  box-shadow: inset -10px -10px 20px rgba(0, 0, 0, 0.7), 0 0 25px rgba(0, 242, 254, 0.4);
}

.planet-modal-sphere.has-ring::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 110px;
  height: 24px;
  border: 4px solid rgba(254, 240, 138, 0.6);
  border-radius: 50%;
  transform: translate(-50%, -50%) rotate(-25deg);
  pointer-events: none;
}

.planet-modal-title h3 {
  font-family: var(--font-hud);
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
}

.planet-modal-title p {
  color: var(--accent-cyan);
  font-size: 0.85rem;
  margin-top: 2px;
}

.planet-grid-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.stat-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 12px;
  border-radius: var(--radius-md);
}

.stat-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--text-dim);
  font-family: var(--font-hud);
  letter-spacing: 0.5px;
}

.stat-val {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  margin-top: 4px;
}

.planet-facts-box {
  background: rgba(0, 242, 254, 0.05);
  border: 1px solid var(--border-glow);
  padding: 14px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}

.facts-title {
  font-family: var(--font-hud);
  font-size: 0.85rem;
  color: var(--accent-gold);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.planet-facts-list {
  list-style: none;
}

.planet-facts-list li {
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--text-main);
  margin-bottom: 8px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.planet-facts-list li::before {
  content: '🚀';
  font-size: 0.85rem;
}

/* ==========================================================================
   2. SPACE NEWS FEED VIEW
   ========================================================================== */

.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.category-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0;
  scrollbar-width: none;
}

.category-pills::-webkit-scrollbar {
  display: none;
}

.cat-pill {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glow);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

.cat-pill:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.cat-pill.active {
  background: var(--accent-blue);
  color: #fff;
  border-color: var(--accent-blue);
  box-shadow: 0 0 14px rgba(79, 172, 254, 0.4);
}

.news-search-box {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glow);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  width: 100%;
  max-width: 260px;
}

.news-search-box input {
  background: none;
  border: none;
  outline: none;
  color: var(--text-main);
  font-size: 0.85rem;
  margin-left: 8px;
  width: 100%;
}

.news-search-box input::placeholder {
  color: var(--text-dim);
}

.news-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

@media (min-width: 640px) {
  .news-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .news-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.news-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  backdrop-filter: blur(10px);
}

.news-card:hover {
  transform: translateY(-4px);
  background: var(--bg-card-hover);
  border-color: var(--accent-cyan);
  box-shadow: var(--shadow-glow);
}

.news-thumb {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: #0d1326;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.news-content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.news-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.news-source-tag {
  background: rgba(0, 242, 254, 0.12);
  color: var(--accent-cyan);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-family: var(--font-hud);
  font-weight: 600;
}

.news-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-main);
  margin-bottom: 8px;
}

.news-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.45;
  flex: 1;
  margin-bottom: 14px;
}

.news-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 10px;
}

.read-link-btn {
  color: var(--accent-cyan);
  text-decoration: none;
  font-size: 0.8rem;
  font-family: var(--font-hud);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: var(--transition);
}

.read-link-btn:hover {
  color: #fff;
  text-shadow: 0 0 8px var(--accent-cyan);
}

/* ==========================================================================
   3. SPACE PHOTO GALLERY VIEW
   ========================================================================== */

.gallery-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.btn-upload-primary {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  border: none;
  color: #050814;
  font-family: var(--font-hud);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.4);
  transition: var(--transition);
}

.btn-upload-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 0 30px rgba(0, 242, 254, 0.7);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.gallery-card {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  aspect-ratio: 4 / 3;
  cursor: pointer;
  transition: var(--transition);
}

.gallery-card:hover {
  transform: translateY(-4px) scale(1.01);
  border-color: var(--accent-cyan);
  box-shadow: var(--shadow-glow);
}

.gallery-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.gallery-card:hover img {
  transform: scale(1.06);
}

.gallery-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px 12px 10px;
  background: linear-gradient(to top, rgba(5, 8, 20, 0.95) 0%, rgba(5, 8, 20, 0.5) 70%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.gallery-badge {
  align-self: flex-start;
  font-family: var(--font-hud);
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background: rgba(0, 242, 254, 0.2);
  color: var(--accent-cyan);
  margin-bottom: 4px;
}

.gallery-badge.user-badge {
  background: rgba(255, 0, 127, 0.25);
  color: var(--accent-pink);
}

.gallery-card-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gallery-card-author {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ==========================================================================
   PHOTO UPLOAD MODAL
   ========================================================================== */

.upload-dropzone {
  border: 2px dashed var(--border-glow);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: rgba(0, 242, 254, 0.03);
  margin-bottom: 16px;
}

.upload-dropzone:hover, .upload-dropzone.drag-over {
  border-color: var(--accent-cyan);
  background: rgba(0, 242, 254, 0.1);
}

.dropzone-icon {
  font-size: 2.2rem;
  margin-bottom: 8px;
}

.preview-container {
  display: none;
  margin-bottom: 16px;
  position: relative;
  max-height: 200px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-glow);
}

.preview-container img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.remove-preview-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  cursor: pointer;
}

.form-group {
  margin-bottom: 14px;
}

.form-label {
  display: block;
  font-size: 0.78rem;
  font-family: var(--font-hud);
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-sm);
  color: #fff;
  padding: 10px 12px;
  font-size: 0.88rem;
  font-family: var(--font-body);
  outline: none;
  transition: var(--transition);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.3);
}

.form-select option {
  background: var(--bg-deep);
  color: #fff;
}

/* ==========================================================================
   LIGHTBOX MODAL
   ========================================================================== */

.lightbox-dialog {
  max-width: 900px;
  padding: 16px;
}

.lightbox-image-wrap {
  width: 100%;
  max-height: 65vh;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
}

.lightbox-image-wrap img {
  max-width: 100%;
  max-height: 65vh;
  object-fit: contain;
}

.lightbox-info {
  margin-top: 14px;
}

.lightbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

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

/* ==========================================================================
   4. SPACE FACT & CADET QUIZ VIEW
   ========================================================================== */

.trivia-card-container {
  max-width: 680px;
  margin: 20px auto;
  background: var(--bg-card);
  border: 1px solid var(--border-neon);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-neon);
}

.trivia-badge-card {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 183, 3, 0.15);
  border: 1px solid var(--accent-gold);
  color: var(--accent-gold);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-family: var(--font-hud);
  font-size: 0.78rem;
  margin-bottom: 16px;
}

.trivia-question {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.4;
  margin-bottom: 20px;
}

.trivia-options-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 20px;
}

.trivia-opt-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glow);
  color: var(--text-main);
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
}

.trivia-opt-btn:hover {
  background: rgba(0, 242, 254, 0.15);
  border-color: var(--accent-cyan);
  transform: translateX(4px);
}

.trivia-opt-btn.correct {
  background: rgba(16, 185, 129, 0.25) !important;
  border-color: var(--accent-green) !important;
  color: #fff;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.5);
}

.trivia-opt-btn.wrong {
  background: rgba(239, 68, 68, 0.25) !important;
  border-color: #ef4444 !important;
  color: #fff;
}

.trivia-result-box {
  display: none;
  background: rgba(0, 242, 254, 0.08);
  border: 1px solid var(--border-glow);
  padding: 18px;
  border-radius: var(--radius-md);
  margin-top: 16px;
  animation: fadeIn 0.3s ease;
}

.trivia-result-box.show {
  display: block;
}

.cadet-badge-award {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 12px;
  background: rgba(255, 183, 3, 0.12);
  border: 1px dashed var(--accent-gold);
  border-radius: var(--radius-md);
}

.cadet-badge-icon {
  font-size: 2rem;
}

/* ==========================================================================
   EMPTY / LOADING STATES
   ========================================================================== */

.loading-state, .empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(0, 242, 254, 0.2);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spin 1s infinite linear;
  margin: 0 auto 14px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 80px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

@media (min-width: 768px) {
  .toast-container {
    bottom: 24px;
  }
}

.toast {
  background: var(--bg-deep);
  border: 1px solid var(--border-neon);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toastIn 0.3s ease;
}

@keyframes toastIn {
  from { transform: translateX(50px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
