* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --background: #070817;
  --background-light: #0d1024;
  --card: rgba(18, 22, 45, 0.78);
  --card-border: rgba(255, 255, 255, 0.09);

  --text: #f4f6ff;
  --muted: #9da5c5;

  --accent: #7c8cff;
  --accent-light: #aab3ff;

  --white: #ffffff;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  font-family: "inter", sans-serif;
  color: var(--text);

  background:
    radial-gradient(
      circle at 50% -10%,
      rgba(76, 91, 190, 0.28),
      transparent 40%
    ),
    radial-gradient(
      circle at 90% 50%,
      rgba(90, 55, 170, 0.12),
      transparent 35%
    ),
    var(--background);

  overflow-x: hidden;
}

/* =========================
   NAVBAR
========================= */

.navbar {
  width: min(1180px, 92%);
  margin: auto;
  padding: 25px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;

  background: linear-gradient(135deg, #7282ff, #a15cff);

  font-size: 20px;

  box-shadow: 0 0 25px rgba(124, 140, 255, 025);
}

.logo h2 {
  font-size: 16px;
  font-weight: 700;
}

.logo span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--card-border);
  border-radius: 50px;
  color: var(--muted);
  font-size: 11px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #5de58a;
  box-shadow: 0 0 10px #5de58a;
}

/* =========================
   MAIN
========================= */

main {
  width: min(1100px, 92%);
  margin: auto;
}

/* =========================
   HERO
========================= */

.hero {
  text-align: center;
  padding: 75px 0 45px;
}

.eyebrow {
  margin-bottom: 15px;
  color: var(--accent-light);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3px;
}

.hero h1 {
  max-width: 750px;
  margin: auto;
  font-size: clamp(40px, 60vw, 68px);
  line-height: 1.05;
  letter-spacing: -3px;
}

.hero h1 span {
  display: block;
  background: linear-gradient(90deg, #8794ff, #c19cff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-text {
  max-width: 600px;
  margin: 22px auto 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
}

/* =========================
   CONTROLS
========================= */

.controls {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 35px;
}

.date-control {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.date-control label {
  color: var(--muted);
  font-size: 10px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.date-control input {
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  outline: none;
  color: var(--text);
  background: var(--card);
  font-family: inherit;
}

.date-control input:focus {
  border-color: var(--accent);
}

.nav-btn,
.random-btn {
  height: 42px;
  padding: 0 18px;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  cursor: pointer;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  font-family: inherit;
  font-weight: 600;
  transition:
    transform 0.2s ease,
    background 0.2s ease;
}

.nav-btn:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.1);
}

.random-btn {
  border: none;
  background: linear-gradient(135deg, #6577ff, #985cff);
}

.random-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(111, 105, 255, 0.25);
}

/* =========================
   APOD CONTAINER
========================= */

.apod-container {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 28px;
  padding: 20px;
  border: 1px solid var(--card-border);
  border-radius: 24px;
  background: linear-gradient(
    145deg,
    rgba(22, 27, 55, 0.9),
    rgba(12, 15, 32, 0.9)
  );
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.35);
}

/* =========================
   IMAGE
========================= */

.media-section {
  position: relative;
  min-height: 450px;
  overflow: hidden;
  border-radius: 16px;
  background: #05060e;
}

#apodImage {
  width: 100%;
  height: 100%;
  min-height: 450px;
  display: block;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.image-wrapper:hover #apodImage {
  transform: scale(1.02);
}

.media-bagde {
  position: absolute;
  top: 15px;
  left: 15px;
  padding: 7px 10px;
  border-radius: 6px;
  color: white;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(10px);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
}

.hd-button {
  width: fit-content;
  padding: 10px 14px;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  text-decoration: none;
  font-size: 11px;
  transition: background 0.2s ease;
}

.hd-button:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* =========================
   INFORMATION
========================= */

.info-section {
  padding: 25px 15px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.data-label {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--accent-light);
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 15px;
}

.info-section h2 {
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.15;
  letter-spacing: -1px;
}

.divider {
  width: 50px;
  height: 3px;
  margin: 22px 0;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--accent), transparent);
}

.info-section h3 {
  margin-bottom: 10px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #dfe3ff;
}

#apodExplanation {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

.copyright {
  display: flex;
  gap: 7px;
  margin-top: 20px;
  color: #707898;
  font-size: 10px;
}

/* =========================
   VIDEO
========================= */

.video-container {
  display: none;
  margin-top: 25px;
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid var(--card-border);
}

.video-container iframe {
  width: 100%;
  height: 600px;
  border: none;
}

/* =========================
   LOADING
========================= */

.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  gap: 15px;
}

.loading p {
  color: var(--muted);
  font-size: 13px;
}

.loader {
  width: 42px;
  height: 42px;
  border: 3px solid rgba(255, 255, 255, 01);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* =========================
   ERROR
========================= */

.error-message {
  display: none;
  text-align: center;
  padding: 50px;
  border: 1px solid rgba(255, 100, 100, 0.15);
  border-radius: 20px;
}

.error-message h3 {
  margin-bottom: 10px;
}

.error-message p {
  color: var(--muted);
  margin-bottom: 20px;
}

.error-message button {
  padding: 10px 18px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  color: white;
  background: var(--accent);
  font-family: inherit;
}

/* =========================
   BOTTOM CARDS
========================= */

.bottom-info {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin: 25px 0 50px;
}

.info-card {
  display: flex;
  gap: 13px;
  padding: 18px;
  border: 1px solid var(--card-border);
  border-radius: 14px;
}

.card-icon {
  font-size: 20px;
}

.info-card p {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

/* =========================
   FOOTER
========================= */

footer {
  width: min(1100px, 92%);
  margin: auto;
  padding: 25px 0 35px;
  display: flex;
  justify-content: space-between;
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 850px) {
  .apod-container {
    grid-template-columns: 1fr;
  }

  .image-wrapper,
  #apodImage {
    min-height: 400px;
  }

  .info-section {
    padding: 10px 5px 25px;
  }
  .bottom-info {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .navbar {
    padding: 18px 0;
  }
  .status {
    display: none;
  }
  .hero {
    padding-top: 45px;
  }
  .hero h1 {
    letter-spacing: -2px;
  }
  .controls {
    flex-direction: column;
    align-items: stretch;
  }
  .date-control input,
  .nav-btn,
  .random-btn {
    width: 100%;
  }
  .date-control label {
    text-align: left;
  }
  .apod-container {
    padding: 10px;
    border-radius: 16px;
  }
  .image-wrapper,
  #apodImage {
    min-height: 280px;
  }
  footer {
    flex-direction: column;
    gap: 8px;
  }
}
