/* ==========================
   Earth Satellite Simulation
   Theme: Earth - Satellite
   ========================== */

:root {
  --bg1: #0f2027;
  --bg2: #203a43;
  --bg3: #2c5364;
  --accent: #00c6ff;
  --accent-2: #ff6600;
  --card: rgba(255, 255, 255, 0.06);
}

html, body {
  height: 100%;
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background: linear-gradient(90deg, var(--bg1), var(--bg2), var(--bg3));
  color: #fff;
}

.wrap {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ===== Header ===== */
header {
  text-align: center;
  padding: 0.6rem 10px;
}

header h1 {
  font-size: clamp(16px, 2.5vw, 22px);
  font-weight: 600;
  background: linear-gradient(45deg, var(--accent), #0072ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

header p {
  margin-top: 6px;
  color: #d3dce0;
  font-size: clamp(12px, 1.5vw, 14px);
}

/* ===== Main Panel / Canvas ===== */
main {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 12px;
}

.panel {
  background: var(--card);
  border-radius: 10px;
  padding: 0px 16px;
  width: 100%;
  max-width: 1200px;
  box-sizing: border-box;
}

.top-row {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
}

#spaceCanvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16/7;
  border-radius: 8px;
  background: radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.02), transparent 20%);
}

/* ===== Controls ===== */
.controls {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.btn {
  background: var(--accent);
  border: none;
  padding: 8px 10px;
  border-radius: 8px;
  color: #001;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s;
}

.btn:hover {
  background: #33d1ff;
}

.btn.secondary {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

label {
  font-size: 13px;
  color: #dbe8ef;
  margin-right: 6px;
}

input[type="range"] {
  accent-color: var(--accent);
}

.legend {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 8px;
  flex-wrap: wrap;
}

.legend .item {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 13px;
  color: #dbe8ef;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.info {
  font-size: 13px;
  color: #cfe7f3;
  margin-top: 8px;
  line-height: 1.4;
}

/* ===== Footer ===== */
footer {
  text-align: center;
  padding: 0.8rem;
  font-size: 0.85rem;
  background: rgba(255, 255, 255, 0.05);
}

footer a {
  color: var(--accent);
  text-decoration: none;
  margin: 0 0.5rem;
}

footer a:hover {
  color: #fff;
}

/* ===== Small citations ===== */
small.cite {
  display: block;
  color: #9fb7c3;
  margin-top: 8px;
  font-size: 12px;
}

/* ===== Floating Buttons ===== */
.floating-btn {
  position: fixed;
  top: 12px;
  padding: 6px;
  font-size: 1.2em;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.1);
  z-index: 1000;
  transition: background 0.2s;
}

.floating-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

#homeBtn {
  left: 12px;
  width: 34px;
  height: 34px;
}

#homeBtn img {
  width: 100%;
  height: 100%;
  border-radius: 6px;
}

#fullscreenBtn {
  right: 12px;
}

/* ===== Responsive ===== */

/* Large tablets and smaller laptops */
@media (max-width: 1024px) {
  #spaceCanvas {
    aspect-ratio: 16/9;
  }
  .top-row {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
}

/* Tablets & landscape mobiles */
@media (max-width: 768px) {
  header h1 {
    font-size: 16px;
  }

  header p {
    font-size: 12px;
  }

  #spaceCanvas {
    aspect-ratio: 4/3;
  }

  .controls {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .btn,
  input[type="range"] {
    width: 100%;
    max-width: 85%;
  }

  .legend {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}

/* Mobile devices */
@media (max-width: 480px) {
  #spaceCanvas {
    aspect-ratio: 1/1;
  }

  footer {
    font-size: 0.7rem;
    padding: 0.6rem;
  }

  .panel {
    padding: 10px;
  }

  .controls {
    gap: 6px;
  }

  .btn {
    padding: 8px;
    font-size: 0.85rem;
  }

  label {
    font-size: 12px;
  }

  .floating-btn {
    top: 52px; /* lower to avoid overlapping header */
    font-size: 1em;
    padding: 5px;
  }
}
