/* ============================================
   NASA APOD — Styles
   Simple, centered, readable layout.
   ============================================ */

/* Reset default spacing so everything starts clean */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background-color: #0b0d17;
  color: #e0e0e0;
  line-height: 1.6;
  min-height: 100vh;
}

/* Center everything in a readable column */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

h1 {
  text-align: center;
  font-size: 1.8rem;
  color: #ffffff;
  margin-bottom: 1.5rem;
  letter-spacing: 0.02em;
}

/* ---- Loading & Error States ---- */

.loading {
  text-align: center;
  font-size: 1.1rem;
  color: #90caf9;
}

.error {
  text-align: center;
  font-size: 1rem;
  color: #ef5350;
  display: none; /* hidden by default, shown by JS when needed */
}

/* ---- APOD Content ---- */

.apod-content {
  animation: fadeIn 0.5s ease-in;
}

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

#apod-title {
  font-size: 1.5rem;
  color: #ffffff;
  margin-bottom: 0.25rem;
}

.date {
  font-size: 0.95rem;
  color: #90a4ae;
  margin-bottom: 1.25rem;
}

/* Make the image or video responsive */
.media-container {
  margin-bottom: 1.5rem;
  border-radius: 8px;
  overflow: hidden;
  /* Subtle glow around the media */
  box-shadow: 0 0 20px rgba(100, 180, 255, 0.15);
}

.media-container img {
  width: 100%;
  height: auto;
  display: block;
}

.media-container iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: none;
  display: block;
}

.explanation {
  font-size: 1rem;
  line-height: 1.75;
  color: #cfd8dc;
}
