/* RESET */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* GLOBAL */
body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: radial-gradient(circle at 10% 0%, #020617, #020617 40%, #000 100%);
  color: #e5e7eb;
}

/* HEADER */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  margin: 16px 16px 8px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.9);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  font-size: 1.8rem;
}

.brand-text h1 {
  font-size: 1.2rem;
  font-weight: 600;
}

.brand-text p {
  font-size: 0.8rem;
  color: #9ca3af;
}

/* Header buttons */
.header-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

header .md-btn {
  background: rgba(148, 163, 184, 0.15) !important;
  border: none !important;
  color: #e5e7eb !important;
  font-size: 24px;
  padding: 8px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.1s ease;
}

header .md-btn:hover {
  background: rgba(148, 163, 184, 0.35) !important;
  transform: translateY(-1px);
}

/* LAYOUT */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.6fr);
  gap: 16px;
  padding: 8px 16px 24px;
}

.column {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }
}

/* PANELS */
.panel {
  background: rgba(15, 23, 42, 0.9);
  border-radius: 18px;
  padding: 16px 16px 18px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.panel-header h2 {
  font-size: 1rem;
  font-weight: 600;
}

.panel-tag {
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(248, 113, 113, 0.15);
  color: #fecaca;
  border: 1px solid rgba(248, 113, 113, 0.4);
}

/* DATA GRID */
.data-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.data-card {
  background: radial-gradient(circle at top left, rgba(56, 189, 248, 0.12), rgba(15, 23, 42, 0.95));
  border-radius: 14px;
  padding: 10px 12px;
  text-align: left;
  border: 1px solid rgba(148, 163, 184, 0.35);
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.data-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.9);
  border-color: rgba(56, 189, 248, 0.7);
}

.data-card h3 {
  font-size: 0.8rem;
  color: #9ca3af;
  margin-bottom: 4px;
}

.data-card p {
  font-size: 0.95rem;
  font-weight: 600;
  color: #e5e7eb;
}

/* ALERT BANNER */
.alert-banner {
  display: none;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 0.9rem;
  text-align: center;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
}

/* USER LOCATION */
.panel-user .coords-grid {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0 6px;
}

.panel-user .coords-grid div {
  flex: 1;
  text-align: center;
  font-size: 0.8rem;
  color: #9ca3af;
}

.panel-user .coords-grid span {
  display: block;
  margin-top: 4px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #e5e7eb;
}

.user-address {
  font-size: 0.85rem;
  color: #cbd5f5;
  margin-top: 4px;
}

.next-pass {
  font-size: 0.85rem;
  margin-top: 6px;
  color: #a5b4fc;
}

/* WEATHER */
.panel-weather .stargaze-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
  margin-top: 6px;
}

.panel-weather .stargaze-grid div {
  text-align: center;
  font-size: 0.8rem;
  color: #9ca3af;
}

.panel-weather .stargaze-grid span {
  display: block;
  margin-top: 4px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #e5e7eb;
}

/* MAP PANEL */
.panel-map {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.map-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.segmented {
  display: inline-flex;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.5);
}

.segmented button {
  background: transparent;
  border: none;
  color: #e5e7eb;
  padding: 6px 12px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.segmented button:hover {
  background: rgba(148, 163, 184, 0.3);
}

#liveSelect {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(15, 23, 42, 0.9);
  color: #e5e7eb;
  font-size: 0.8rem;
}

/* MAP & LIVE */
#map {
  height: 360px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.8);
}

.live-wrapper {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.live-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: #9ca3af;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #f97373;
  box-shadow: 0 0 10px rgba(248, 113, 113, 0.9);
}

iframe {
  width: 100%;
  height: 260px;
  border-radius: 16px;
  border: none;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.8);
}

/* DIALOGS */
.dialog-bg {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.dialog {
  background: rgba(15, 23, 42, 0.98);
  border-radius: 18px;
  padding: 20px 18px 16px;
  max-width: 420px;
  width: 90%;
  border: 1px solid rgba(148, 163, 184, 0.5);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.9);
  font-size: 0.9rem;
}

.dialog h3 {
  text-align: center;
  margin-bottom: 12px;
  font-size: 1rem;
  font-weight: 600;
}

.dialog p {
  margin-bottom: 8px;
  color: #e5e7eb;
}

.dialog a {
  color: #38bdf8;
  text-decoration: none;
}

.dialog a:hover {
  text-decoration: underline;
}

.dialog-buttons {
  margin-top: 10px;
  text-align: right;
}

.dialog-buttons button {
  padding: 6px 12px;
  border-radius: 999px;
  border: none;
  background: #38bdf8;
  color: #020617;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}

/* MINI PLAYER */
.mini-player-dialog {
  position: relative;
  text-align: center;
}

.close-btn {
  position: absolute;
  top: 8px;
  right: 10px;
  background: transparent;
  border: none;
  color: #9ca3af;
  font-size: 1.2rem;
  cursor: pointer;
}

.mini-player-dialog h3 {
  margin-top: 4px;
  margin-bottom: 6px;
}

.mini-player-dialog .description {
  font-size: 0.8rem;
  color: #9ca3af;
}

.player-controls {
  margin-top: 12px;
  display: flex;
  justify-content: center;
}

.player-controls button {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  border: none;
  background: radial-gradient(circle at 30% 0%, #38bdf8, #0ea5e9);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 16px 40px rgba(8, 47, 73, 0.9);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.player-controls button:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 50px rgba(8, 47, 73, 1);
}

/* FOOTER */
footer {
  text-align: center;
  padding: 16px 12px 24px;
  font-size: 0.85rem;
  color: #9ca3af;
}

footer a {
  color: #38bdf8;
  font-weight: 600;
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* MOBILE TWEAKS */
@media (max-width: 600px) {
  .app-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .brand-text h1 {
    font-size: 1.1rem;
  }

  .layout {
    padding-inline: 10px;
  }

  .panel {
    padding-inline: 14px;
  }

  #map {
    height: 300px;
  }

  iframe {
    height: 220px;
  }
}
