/* === Variables === */
:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-tertiary: #1a1a25;
  --text-primary: #e0e0e0;
  --text-secondary: #888;
  --accent: #00d4ff;
  --accent-dim: #00d4ff33;
  --highlight: #ff6b35;
  --success: #00ff88;
  --border: #2a2a35;
  --font-mono: 'JetBrains Mono', monospace;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

/* === Base === */
html {
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
}

/* === Layout === */
.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* === Header === */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.logo {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.1em;
}

.nav {
  display: flex;
  gap: 1rem;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.2s;
}

.nav-link:hover {
  color: var(--accent);
}

/* === Time Section === */
.time-section {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.time-controls {
  display: flex;
  gap: 0.5rem;
}

.time-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem;
  color: var(--text-secondary);
  cursor: not-allowed;
  opacity: 0.5;
  font-size: 1rem;
}

.time-btn .icon {
  display: block;
  line-height: 1;
}

.time-display {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--text-primary);
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.utc-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--success);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.live-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* === Divider === */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1rem 0;
}

/* === Selectors === */
.selectors {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 1.5rem 0;
}

.selector-group {
  flex: 1;
  max-width: 180px;
}

.body-select {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: var(--font-sans);
  font-size: 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
}

.body-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-dim);
}

.body-select:hover {
  border-color: var(--text-secondary);
}

.selector-arrow {
  font-size: 1.5rem;
  color: var(--text-secondary);
}

/* === Distance Display === */
.distance-section {
  text-align: center;
  margin: 2rem 0;
}

.distance-km {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.distance-km .unit {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-secondary);
  margin-left: 0.5rem;
}

.distance-au {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.distance-au .unit {
  margin-left: 0.25rem;
}

/* === Delay Display === */
.delay-section {
  display: flex;
  justify-content: center;
  margin: 2rem 0;
}

.delay-box {
  background: var(--bg-secondary);
  border: 2px solid var(--accent);
  border-radius: 12px;
  padding: 1.5rem 2.5rem;
  box-shadow: 0 0 30px var(--accent-dim);
}

.delay-value {
  text-align: center;
}

.delay-number {
  display: block;
  font-family: var(--font-mono);
  font-size: 3rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.1em;
  line-height: 1.2;
}

.delay-unit {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-top: 0.25rem;
}

/* === Solar Map === */
.map-section {
  margin: 2rem 0;
}

#solar-map {
  width: 100%;
  height: 600px;
  background: transparent;
  display: block;
}

/* === Footer === */
.footer {
  margin-top: auto;
  padding-top: 2rem;
  text-align: center;
}

.footer-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.footer-credits {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.footer-credits a {
  color: var(--text-secondary);
  text-decoration: none;
}

.footer-credits a:hover {
  color: var(--accent);
}

/* === Accessibility === */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* === Responsive === */
@media (max-width: 480px) {
  .time-section {
    flex-direction: column;
    gap: 0.75rem;
  }

  .time-display {
    font-size: 1rem;
  }

  .distance-km {
    font-size: 1.5rem;
  }

  .delay-number {
    font-size: 2.5rem;
  }

  .delay-box {
    padding: 1.25rem 1.75rem;
  }

  .selectors {
    flex-direction: column;
    gap: 0.75rem;
  }

  .selector-group {
    max-width: 100%;
    width: 100%;
  }

  .selector-arrow {
    transform: rotate(90deg);
  }

  #solar-map {
    height: 500px;
  }
}
