/* ==========================================================================
   Milky Way & Celestial Rotation Simulator - Core Stylesheet
   Design Token System, Glassmorphism HUD, & Author Footer
   ========================================================================== */

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

:root {
  --bg-dark: #03071e;
  --panel-bg: rgba(13, 27, 42, 0.7);
  --panel-border: rgba(255, 255, 255, 0.12);
  --glass-blur: blur(16px);
  
  --primary-accent: #00f5d4;
  --secondary-accent: #7b2cbf;
  --sun-gold: #ffb703;
  --earth-blue: #4cc9f0;
  
  --text-main: #f8f9fa;
  --text-muted: #94a3b8;
  
  --font-heading: 'Orbitron', sans-serif;
  --font-body: 'Inter', sans-serif;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
}

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

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

/* ==========================================================================
   3D Canvas Container & Loading Overlay
   ========================================================================== */

#canvas-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

#loading-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #03071e;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  transition: opacity 0.6s ease;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(0, 245, 212, 0.2);
  border-top-color: var(--primary-accent);
  border-radius: 50%;
  animation: spin 1s infinite linear;
}

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

.loading-text {
  font-family: var(--font-heading);
  font-size: 14px;
  letter-spacing: 2px;
  color: var(--primary-accent);
  text-transform: uppercase;
}

/* ==========================================================================
   UI Glassmorphism Header HUD
   ========================================================================== */

.app-header {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--panel-bg);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  padding: 14px 22px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.app-title {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-title span {
  color: var(--primary-accent);
}

.info-btn {
  background: rgba(0, 245, 212, 0.12);
  border: 1px solid rgba(0, 245, 212, 0.35);
  color: var(--primary-accent);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 5px;
}

.info-btn:hover {
  background: var(--primary-accent);
  color: #03071e;
  box-shadow: 0 0 12px var(--primary-accent);
}

/* ==========================================================================
   Telemetry Physical Metrics Card
   ========================================================================== */

.telemetry-card {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 10;
  width: 320px;
  background: var(--panel-bg);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.card-header {
  font-family: var(--font-heading);
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: var(--primary-accent);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--primary-accent);
}

.metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.metric-label {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.metric-icon {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.icon-earth { background: var(--primary-accent); }
.icon-moon { background: #e2e8f0; }
.icon-sun { background: var(--sun-gold); }
.icon-galaxy { background: #9d4edd; }
.icon-universe { background: #ff007f; box-shadow: 0 0 6px #ff007f; }

.metric-value {
  font-family: var(--font-heading);
  font-weight: 700;
  color: #ffffff;
}

/* ==========================================================================
   Control Dock Toolbar
   ========================================================================== */

.control-dock {
  position: absolute;
  bottom: 175px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--panel-bg);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  padding: 12px 24px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
  max-width: 92vw;
  flex-wrap: wrap;
  justify-content: center;
}

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

.control-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-main);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.control-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

.control-btn.active {
  background: var(--primary-accent);
  color: #03071e;
  font-weight: 600;
  border-color: var(--primary-accent);
}

.divider {
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, 0.15);
}

/* Speed Slider Styling */
.speed-control {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-muted);
}

.speed-control input[type="range"] {
  appearance: none;
  width: 110px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  outline: none;
}

.speed-control input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--primary-accent);
  cursor: pointer;
  box-shadow: 0 0 6px var(--primary-accent);
}

/* Checkbox Toggles */
.toggle-group {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  color: var(--text-muted);
}

.toggle-item {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.toggle-item input[type="checkbox"] {
  accent-color: var(--primary-accent);
  cursor: pointer;
}

/* ==========================================================================
   Author Footer Section - Premium Glassmorphism & Cyan Glow
   ========================================================================== */

.app-footer {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  width: 92%;
  max-width: 620px;
  background: rgba(5, 14, 26, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 229, 255, 0.35);
  border-radius: 16px;
  padding: 14px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.75), inset 0 1px 0 rgba(0, 229, 255, 0.25);
  transition: all 0.3s ease;
}

.footer-line-author {
  font-size: 13px;
  color: #f1f5f9;
  font-weight: 500;
  letter-spacing: 0.2px;
}

.footer-line-author span {
  color: #00e5ff;
  font-weight: 700;
}

.footer-line-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 13px;
}

.footer-line-links a {
  color: #00e5ff;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s ease;
}

.footer-line-links a:hover {
  color: #ffffff;
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.9);
}

.footer-line-links .dot {
  color: #475569;
  font-size: 11px;
}

.footer-line-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 2px 0;
}

.pill-tag {
  border: 1px solid rgba(0, 229, 255, 0.45);
  color: #00e5ff;
  border-radius: 20px;
  padding: 3px 14px;
  font-size: 11px;
  font-family: var(--font-heading);
  font-weight: 500;
  letter-spacing: 0.5px;
  background: rgba(0, 229, 255, 0.05);
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.1);
  transition: all 0.2s ease;
}

.pill-tag:hover {
  border-color: #00e5ff;
  background: rgba(0, 229, 255, 0.15);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.4);
}

.footer-line-copyright {
  font-size: 11px;
  color: #64748b;
  letter-spacing: 0.2px;
}

/* ==========================================================================
   Cosmic Physics Modal Overlay & Card
   ========================================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(3, 7, 30, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  padding: 20px;
}

.modal-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.modal-card {
  background: rgba(13, 27, 42, 0.95);
  border: 1px solid rgba(0, 245, 212, 0.35);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 640px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85), inset 0 1px 0 rgba(0, 245, 212, 0.25);
  overflow: hidden;
}

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h2 {
  font-family: var(--font-heading);
  font-size: 15px;
  color: var(--primary-accent);
  letter-spacing: 0.5px;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  transition: color 0.2s ease;
}

.modal-close:hover {
  color: #ffffff;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.info-block {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 14px;
}

.info-tag {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 700;
  color: #03071e;
  flex-shrink: 0;
}

.info-details h3 {
  font-size: 13px;
  color: #ffffff;
  margin-bottom: 4px;
  font-weight: 600;
}

.info-details p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

@media (max-width: 768px) {
  .app-header {
    top: 12px;
    left: 12px;
    padding: 10px 14px;
  }
  
  .telemetry-card {
    top: 75px;
    right: 12px;
    left: 12px;
    width: auto;
  }
  
  .control-dock {
    bottom: 215px;
    gap: 10px;
    padding: 10px 14px;
  }
  
  .app-footer {
    width: 95%;
    padding: 10px 14px;
    bottom: 10px;
  }
}
