/**
 * Indian Space Live - ISRO Satellite Tracker
 *
 * Tool styles. Inherits the global dark "space" theme from the site
 * stylesheet (loaded inline by build/generate.js); only adds the
 * tool-specific layout and components.
 *
 * Mobile-first: everything sized in clamp() so it works from a 320px
 * phone all the way up to 1440px desktop without media-query bloat.
 */

/* ============================================================ */
/* STATUS BAR — live / cached / snapshot indicator              */
/* ============================================================ */

.isro-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  margin: 0 0 12px;
  border-radius: 999px;
  background: rgba(110, 193, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
  font-size: 13px;
  border: 1px solid rgba(110, 193, 255, 0.2);
}

.isro-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fde047;
  box-shadow: 0 0 6px rgba(253, 224, 71, 0.6);
  flex-shrink: 0;
}

.isro-status[data-state="live"] .isro-status-dot {
  background: #4ade80;
  box-shadow: 0 0 6px rgba(74, 222, 128, 0.6);
  animation: isro-pulse 2s ease-in-out infinite;
}

.isro-status[data-state="cached"] .isro-status-dot {
  background: #6ec1ff;
  box-shadow: 0 0 6px rgba(110, 193, 255, 0.6);
}

.isro-status[data-state="snapshot"] .isro-status-dot {
  background: #ffb86c;
  box-shadow: 0 0 6px rgba(255, 184, 108, 0.6);
}

@keyframes isro-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ============================================================ */
/* MAP — Leaflet container + India bbox styling                 */
/* ============================================================ */

.isro-map-wrap {
  margin: 0 0 16px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

.isro-map {
  width: 100%;
  height: clamp(360px, 60vw, 560px);
  background: #0a0e1f;
}

/* Leaflet popup theming so it matches the dark space look. */
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: #0f1230 !important;
  color: #fff !important;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.leaflet-popup-content {
  margin: 12px 14px !important;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.5;
}

.leaflet-popup-content strong {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
  color: #fff;
}

.leaflet-popup-content .isro-popup-cat {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(110, 193, 255, 0.15);
  color: #6ec1ff;
  margin-bottom: 6px;
}

.leaflet-popup-content .isro-popup-coords {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.65);
  margin-top: 4px;
}

.leaflet-popup-content a {
  color: #6ec1ff;
  text-decoration: underline;
  text-decoration-color: rgba(110, 193, 255, 0.4);
}

.leaflet-popup-close-button {
  color: rgba(255, 255, 255, 0.7) !important;
}

/* OpenStreetMap attribution — keep readable but unobtrusive on dark. */
.leaflet-control-attribution {
  background: rgba(15, 18, 48, 0.85) !important;
  color: rgba(255, 255, 255, 0.65) !important;
  font-size: 10px !important;
  padding: 2px 6px !important;
}

.leaflet-control-attribution a {
  color: #6ec1ff !important;
}

/* Custom satellite marker — small coloured dot with glow. We bypass
   Leaflet's default marker icon entirely so the look stays consistent. */
.isro-marker {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 8px currentColor, 0 0 0 2px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.isro-marker:hover {
  transform: scale(1.3);
}

.isro-marker[data-highlight="true"] {
  width: 18px;
  height: 18px;
  border-width: 3px;
  animation: isro-marker-highlight 2.4s ease-in-out infinite;
}

@keyframes isro-marker-highlight {
  0%, 100% { box-shadow: 0 0 8px currentColor, 0 0 0 2px rgba(0, 0, 0, 0.4); }
  50% { box-shadow: 0 0 16px currentColor, 0 0 0 4px rgba(255, 255, 255, 0.2); }
}

/* India bounding box outline — drawn as a polygon overlay so users
   can see what counts as "over India" at a glance. */
.isro-india-bbox {
  stroke: rgba(110, 193, 255, 0.45);
  stroke-width: 1.5;
  stroke-dasharray: 6 4;
  fill: rgba(110, 193, 255, 0.05);
}

/* ============================================================ */
/* OVER INDIA NOW STRIP                                         */
/* ============================================================ */

.isro-over-india {
  margin: 0 0 24px;
  padding: 14px 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255, 153, 51, 0.12), rgba(19, 136, 8, 0.12));
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.isro-over-india-title {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.7);
}

.isro-over-india-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.isro-over-india-list li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 13px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.isro-over-india-list li::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cat-color, #6ec1ff);
  box-shadow: 0 0 4px var(--cat-color, #6ec1ff);
}

.isro-over-india-empty {
  color: rgba(255, 255, 255, 0.55) !important;
  background: transparent !important;
  border: none !important;
  font-style: italic;
  padding-left: 0 !important;
}

.isro-over-india-empty::before {
  display: none;
}

/* ============================================================ */
/* SATELLITE CARDS                                              */
/* ============================================================ */

.isro-cards {
  margin: 0 0 24px;
}

.isro-cards-loading {
  text-align: center;
  color: rgba(255, 255, 255, 0.55);
  padding: 24px;
}

.isro-cards-group {
  margin: 0 0 20px;
}

.isro-cards-group-title {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.65);
  display: flex;
  align-items: center;
  gap: 8px;
}

.isro-cards-group-title::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--cat-color, #6ec1ff);
  box-shadow: 0 0 6px var(--cat-color, #6ec1ff);
}

.isro-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.isro-card {
  position: relative;
  padding: 14px 14px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.isro-card:hover {
  border-color: rgba(110, 193, 255, 0.3);
  background: rgba(255, 255, 255, 0.06);
}

.isro-card[data-over-india="true"] {
  border-color: rgba(255, 153, 51, 0.5);
  background: linear-gradient(135deg, rgba(255, 153, 51, 0.08), rgba(19, 136, 8, 0.08));
}

.isro-card-name {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.isro-card-name .isro-card-highlight {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, #ff9933, #138808);
  color: #fff;
  vertical-align: middle;
}

.isro-card-cat {
  display: inline-block;
  margin: 0 0 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--cat-bg, rgba(110, 193, 255, 0.12));
  color: var(--cat-color, #6ec1ff);
}

.isro-card-purpose {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.78);
}

.isro-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
}

.isro-card-meta a {
  color: rgba(110, 193, 255, 0.8);
  text-decoration: underline;
  text-decoration-color: rgba(110, 193, 255, 0.3);
}

.isro-card-coords {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 4px;
}

.isro-card-over-india-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, #ff9933, #138808);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ============================================================ */
/* DEEP-SPACE SECTION (Aditya-L1, Chandrayaan-3) — special card */
/* style so they read clearly as "not on the map".              */
/* ============================================================ */

.isro-deep-space {
  margin: 24px 0 0;
  padding-top: 18px;
  border-top: 1px dashed rgba(255, 255, 255, 0.15);
}

.isro-deep-space-title {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.65);
}

.isro-deep-space-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.isro-deep-space-card {
  padding: 14px;
  border-radius: 10px;
  background: rgba(167, 139, 250, 0.06);
  border: 1px solid rgba(167, 139, 250, 0.2);
}

.isro-deep-space-card .isro-card-name {
  color: #d8c8ff;
}

.isro-deep-space-note {
  margin: 8px 0 0;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
  font-style: italic;
}

/* ============================================================ */
/* RESPONSIVE TWEAKS                                            */
/* ============================================================ */

@media (max-width: 480px) {
  .isro-cards-grid,
  .isro-deep-space-grid {
    grid-template-columns: 1fr;
  }

  .isro-status {
    font-size: 12px;
    padding: 5px 10px;
  }

  .isro-card {
    padding: 12px;
  }
}
