/**
 * Density Inversion Page - Minimal Clean Style
 */

/* Status */
.status {
  margin: 15px 0;
  padding: 12px 20px;
  background: #eef0f2;
  border-radius: 8px;
  font-size: 13px;
  text-align: center;
  color: #5b6779;
}

.status.hidden {
  display: none;
}

.status.error {
  background: #fef2f2;
  color: #dc2626;
}

/* Page Blurb */
.page-blurb {
  margin: 24px 0 0;
  padding: 14px 18px;
  background: #f6f7f8;
  border: 1px solid #dfe2e6;
  border-radius: 10px;
  font-size: 13px;
  color: #4a5666;
  line-height: 1.5;
}

.page-blurb p {
  margin: 0;
}

/* Space Weather Banner */
.space-weather-banner {
  background: linear-gradient(135deg, #14203a, #14203a);
  color: #f6f7f8;
  padding: 14px 18px;
  border-radius: 12px;
  margin: 16px 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  position: relative;
  border: 1px solid rgba(143, 154, 171, 0.25);
  box-shadow: 0 10px 24px rgba(20, 32, 58, 0.15);
  overflow: hidden;
}

.space-weather-banner > * {
  position: relative;
  z-index: 1;
}

.space-weather-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.7;
}

.space-weather-content {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.space-weather-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
}

.space-weather-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
}

.space-weather-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: rgba(226, 232, 240, 0.8);
}

.space-weather-chip {
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  letter-spacing: 0.4px;
}

.space-weather-time {
  white-space: nowrap;
}

.space-weather-banner[data-level="quiet"] .space-weather-dot {
  background: #22c55e;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.6);
}

.space-weather-banner[data-level="active"] .space-weather-dot {
  background: #eab308;
  box-shadow: 0 0 10px rgba(234, 179, 8, 0.6);
}

.space-weather-banner[data-level="storm"] .space-weather-dot {
  background: #f97316;
  box-shadow: 0 0 12px rgba(249, 115, 22, 0.7);
}

.space-weather-banner[data-level="severe"] .space-weather-dot {
  background: #ef4444;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.75);
}

@keyframes space-weather-shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

@keyframes space-weather-glow-storm {
  0%, 100% {
    box-shadow: 0 0 14px rgba(249, 115, 22, 0.2);
  }
  50% {
    box-shadow: 0 0 28px rgba(249, 115, 22, 0.45);
  }
}

@keyframes space-weather-glow-active {
  0%, 100% {
    box-shadow: 0 0 12px rgba(234, 179, 8, 0.2);
  }
  50% {
    box-shadow: 0 0 24px rgba(234, 179, 8, 0.45);
  }
}

@keyframes space-weather-glow-severe {
  0%, 100% {
    box-shadow: 0 0 16px rgba(239, 68, 68, 0.25);
  }
  50% {
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.6);
  }
}

.space-weather-banner[data-level="storm"],
.space-weather-banner[data-level="severe"] {
  border-width: 1px;
  border-style: solid;
}

.space-weather-banner[data-level="active"] {
  border-width: 1px;
  border-style: solid;
  border-color: rgba(234, 179, 8, 0.6);
  animation: space-weather-glow-active 2.6s ease-in-out infinite;
}

.space-weather-banner[data-level="active"]::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(234, 179, 8, 0.12) 25%,
    rgba(234, 179, 8, 0.3) 50%,
    rgba(234, 179, 8, 0.12) 75%,
    transparent 100%
  );
  border-radius: 12px;
  animation: space-weather-shimmer 2.8s ease-in-out infinite;
  pointer-events: none;
}

.space-weather-banner[data-level="storm"] {
  border-color: rgba(249, 115, 22, 0.6);
  animation: space-weather-glow-storm 2.6s ease-in-out infinite;
}

.space-weather-banner[data-level="storm"]::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(249, 115, 22, 0.15) 25%,
    rgba(249, 115, 22, 0.35) 50%,
    rgba(249, 115, 22, 0.15) 75%,
    transparent 100%
  );
  border-radius: 12px;
  animation: space-weather-shimmer 2.8s ease-in-out infinite;
  pointer-events: none;
}

.space-weather-banner[data-level="severe"] {
  border-color: rgba(239, 68, 68, 0.7);
  animation: space-weather-glow-severe 2.3s ease-in-out infinite;
}

.space-weather-banner[data-level="severe"]::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(239, 68, 68, 0.15) 25%,
    rgba(239, 68, 68, 0.35) 50%,
    rgba(239, 68, 68, 0.15) 75%,
    transparent 100%
  );
  border-radius: 12px;
  animation: space-weather-shimmer 2.4s ease-in-out infinite;
  pointer-events: none;
}

/* Aurora Activity Bar */
.aurora-activity-bar {
  background: linear-gradient(135deg, #0c1222 0%, #162033 100%);
  border: 1px solid rgba(43, 74, 118, 0.25);
  border-radius: 12px;
  padding: 14px 18px;
  margin: 0 0 24px;
}

.aurora-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.aurora-bar-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(226, 232, 240, 0.7);
  font-weight: 500;
}

.aurora-bar-update {
  font-size: 10px;
  color: rgba(143, 154, 171, 0.7);
}

.aurora-bar-content {
  display: flex;
  gap: 20px;
  align-items: stretch;
}

.aurora-metrics {
  display: flex;
  gap: 16px;
  flex-shrink: 0;
}

.aurora-metric {
  text-align: center;
  padding: 8px 12px;
  background: rgba(20, 32, 58, 0.5);
  border-radius: 8px;
  min-width: 70px;
}

.aurora-metric-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(143, 154, 171, 0.8);
  margin-bottom: 4px;
}

.aurora-metric-value {
  font-size: 22px;
  font-weight: 700;
  color: #f6f7f8;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.aurora-metric-unit {
  font-size: 10px;
  color: rgba(143, 154, 171, 0.6);
  margin-top: 2px;
}

/* Bz color coding */
.bz-metric.bz-positive .aurora-metric-value {
  color: #22c55e;
}

.bz-metric.bz-negative .aurora-metric-value {
  color: #ef4444;
}

.bz-metric.bz-strong-negative .aurora-metric-value {
  color: #f97316;
  text-shadow: 0 0 8px rgba(249, 115, 22, 0.5);
}

/* Aurora Chart Container */
.aurora-chart-container {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.aurora-chart-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(143, 154, 171, 0.8);
  margin-bottom: 4px;
}

.bz-chart {
  flex: 1;
  min-height: 60px;
  background: rgba(20, 32, 58, 0.3);
  border-radius: 6px;
}

/* Speed color coding based on typical thresholds */
.aurora-metric.speed-elevated .aurora-metric-value {
  color: #eab308;
}

.aurora-metric.speed-high .aurora-metric-value {
  color: #f97316;
}

/* GOES Magnetometer Bar */
.goes-mag-bar {
  background: linear-gradient(135deg, #0c1520 0%, #152238 100%);
  border: 1px solid rgba(34, 197, 94, 0.25);
  border-radius: 12px;
  padding: 14px 18px;
  margin: 0 0 24px;
}

.goes-mag-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.goes-mag-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(143, 154, 171, 0.9);
  font-weight: 500;
}

.goes-mag-update {
  font-size: 10px;
  color: rgba(143, 154, 171, 0.7);
}

.goes-mag-content {
  display: flex;
  gap: 20px;
  align-items: stretch;
}

.goes-mag-metrics {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

.goes-mag-metric {
  text-align: center;
  padding: 8px 14px;
  background: rgba(20, 32, 58, 0.5);
  border-radius: 8px;
  min-width: 85px;
}

.goes-mag-sat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  font-weight: 600;
}

.goes-mag-sat-label.goes-east {
  color: #22c55e;
}

.goes-mag-sat-label.goes-west {
  color: #1b3d75;
}

.goes-mag-value {
  font-size: 22px;
  font-weight: 700;
  color: #f6f7f8;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.goes-mag-unit {
  font-size: 10px;
  color: rgba(143, 154, 171, 0.6);
  margin-top: 2px;
}

.goes-chart-container {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.goes-chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.goes-chart-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(143, 154, 171, 0.7);
}

.goes-chart-legend {
  display: flex;
  gap: 12px;
}

.goes-legend-item {
  font-size: 10px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.goes-legend-item.goes-east {
  color: #22c55e;
}

.goes-legend-item.goes-west {
  color: #1b3d75;
}

.goes-legend-dot {
  width: 8px;
  height: 3px;
  border-radius: 1px;
  background: currentColor;
}

.goes-hp-chart {
  flex: 1;
  min-height: 80px;
}

.goes-chart-hint {
  font-size: 9px;
  color: rgba(143, 154, 171, 0.5);
  text-align: center;
  margin-top: 4px;
}

@media (max-width: 720px) {
  .goes-mag-content {
    flex-direction: column;
    gap: 14px;
  }

  .goes-mag-metrics {
    justify-content: center;
  }

  .goes-mag-metric {
    min-width: 80px;
  }

  .goes-mag-value {
    font-size: 18px;
  }

  .goes-hp-chart {
    min-height: 70px;
  }
}

@media (max-width: 720px) {
  .aurora-bar-content {
    flex-direction: column;
    gap: 14px;
  }

  .aurora-metrics {
    flex-wrap: wrap;
    justify-content: center;
  }

  .aurora-metric {
    min-width: 65px;
    padding: 6px 10px;
  }

  .aurora-metric-value {
    font-size: 18px;
  }

  .bz-chart {
    min-height: 70px;
  }
}

/* Sections */
.section {
  margin: 24px 0;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.section-title {
  font-size: 16px;
  font-weight: 600;
  color: #14203a;
}

.section-note {
  font-size: 12px;
  color: #5b6779;
  margin: 0 0 12px;
  line-height: 1.4;
}

/* Chart Controls */
.chart-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.control-btn {
  padding: 6px 12px;
  border: 1px solid #dfe2e6;
  background: white;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #5b6779;
  cursor: pointer;
  transition: all 0.15s;
}

.control-btn:hover {
  border-color: #1b3d75;
  color: #1b3d75;
}

.control-btn.active {
  background: #1b3d75;
  border-color: #1b3d75;
  color: white;
}

.density-view.is-hidden,
.is-hidden {
  display: none;
}

.view-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.view-btn {
  padding: 6px 12px;
  border: 1px solid #dfe2e6;
  background: white;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #5b6779;
  cursor: pointer;
  transition: all 0.15s;
}

.view-btn:hover {
  border-color: #14203a;
  color: #14203a;
}

.view-btn.active {
  background: #14203a;
  border-color: #14203a;
  color: white;
}

/* Joy Division Plot */
.joy-division-card {
  background: linear-gradient(160deg, #0b0f1a, #14203a);
  border-radius: 12px;
  padding: 12px 16px 16px;
  border: 1px solid #1f2937;
  box-shadow: 0 12px 24px rgba(20, 32, 58, 0.2);
  position: relative;
}

.joy-division-meta {
  font-size: 11px;
  color: rgba(226, 232, 240, 0.75);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 8px;
}

.joy-division-plot {
  width: 100%;
  height: 360px;
}

.joy-division-kp-row {
  display: flex;
  align-items: center;
  margin-top: 12px;
  padding: 8px 10px;
  background: rgba(20, 32, 58, 0.5);
  border-radius: 4px;
  position: relative;
  z-index: 10;
}

.joy-division-kp-label {
  font-size: 10px;
  color: rgba(226, 232, 240, 0.7);
  margin-right: 8px;
  white-space: nowrap;
}

.joy-division-kp-cells {
  display: flex;
  flex: 1;
  gap: 0;
}

.joy-division-kp-cell {
  flex: 1;
  min-width: 1px;
  height: 14px;
  background: #14203a;
}

/* Kp color scale for Joy Division */
.joy-division-kp-cell[data-level="1"] { background: #22c55e; }
.joy-division-kp-cell[data-level="2"] { background: #eab308; }
.joy-division-kp-cell[data-level="3"] { background: #f97316; }
.joy-division-kp-cell[data-level="4"] { background: #ef4444; }

@media (max-width: 720px) {
  .joy-division-plot {
    height: 300px;
  }
}

/* Time Period Selector */
.time-period-selector {
  display: flex;
  align-items: center;
  gap: 6px;
}

.period-btn {
  padding: 5px 10px;
  border: 1px solid #dfe2e6;
  background: white;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  color: #5b6779;
  cursor: pointer;
  transition: all 0.15s;
}

.period-btn:hover {
  border-color: #1b3d75;
  color: #1b3d75;
}

.period-btn.active {
  background: #14203a;
  border-color: #14203a;
  color: white;
}

/* Activity Grid - fits page width */
.activity-grid {
  background: #0d1117;
  border-radius: 8px;
  padding: 12px;
}

.activity-row {
  display: flex;
  align-items: center;
  margin-bottom: 4px;
}

.activity-row:last-child {
  margin-bottom: 0;
}

.activity-row.kp-row {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #30363d;
}

.activity-label {
  width: 90px;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 500;
  color: #8b949e;
  padding-right: 8px;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.activity-cells {
  display: flex;
  flex: 1;
  gap: 1px;
}

.activity-cell {
  flex: 1;
  min-width: 0;
  aspect-ratio: 1;
  max-height: 14px;
  border-radius: 2px;
  background: #161b22;
}

/* Density levels - green scale */
.activity-cell[data-level="0"] { background: #161b22; }
.activity-cell[data-level="1"] { background: #0e4429; }
.activity-cell[data-level="2"] { background: #006d32; }
.activity-cell[data-level="3"] { background: #26a641; }
.activity-cell[data-level="4"] { background: #39d353; }

/* Kp levels - different color scale */
.activity-cell.kp-cell[data-level="0"] { background: #161b22; }
.activity-cell.kp-cell[data-level="1"] { background: #22c55e; }
.activity-cell.kp-cell[data-level="2"] { background: #eab308; }
.activity-cell.kp-cell[data-level="3"] { background: #f97316; }
.activity-cell.kp-cell[data-level="4"] { background: #ef4444; }

/* Grid Legends */
.legends-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  flex-wrap: wrap;
  gap: 12px;
}

.grid-legend {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-title {
  font-size: 10px;
  font-weight: 600;
  color: #5b6779;
}

.legend-label {
  font-size: 10px;
  color: #5b6779;
}

.legend-boxes {
  display: flex;
  align-items: center;
  gap: 2px;
}

.legend-box {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

/* Satellite Cards */
.satellite-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.satellite-card {
  background: white;
  border: 1px solid #dfe2e6;
  border-radius: 8px;
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #eef0f2;
}

.card-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.card-name {
  font-size: 14px;
  font-weight: 600;
  color: #14203a;
}

.card-flag {
  display: inline-block;
  font-size: 13px;
  margin-right: 6px;
  vertical-align: text-top;
}

.card-stats {
  display: flex;
  gap: 20px;
  margin-left: auto;
}

.card-stat {
  text-align: right;
}

.card-stat-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #8f9aab;
}

.card-stat-value {
  font-size: 13px;
  font-weight: 600;
  color: #14203a;
}

.card-chart {
  height: 160px;
  padding: 8px;
}

/* Globe Visualization */
.globe-container {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.satellite-globe {
  flex: 1;
  min-width: 0;
  height: 400px;
  background: #0a0e17;
  border-radius: 12px;
  border: 1px solid #14203a;
}

.satellite-position-list {
  width: 280px;
  flex-shrink: 0;
  background: #f6f7f8;
  border: 1px solid #dfe2e6;
  border-radius: 8px;
  padding: 12px;
  max-height: 400px;
  overflow-y: auto;
}

.sat-position-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-bottom: 1px solid #dfe2e6;
}

.sat-position-item:last-child {
  border-bottom: none;
}

.sat-position-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.sat-position-info {
  flex: 1;
  min-width: 0;
}

.sat-position-name {
  font-size: 12px;
  font-weight: 600;
  color: #14203a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sat-position-coords {
  font-size: 11px;
  color: #5b6779;
  font-family: monospace;
}

.sat-position-alt {
  font-size: 10px;
  color: #8f9aab;
}

.globe-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.globe-time {
  font-size: 12px;
  color: #5b6779;
  font-family: monospace;
}

/* Drag Stats Panel */
.drag-stats-panel {
  background: linear-gradient(135deg, #f6f7f8 0%, #eef0f2 100%);
  border: 1px solid #dfe2e6;
  border-radius: 12px;
  padding: 16px 20px;
  margin: 24px 0;
}

.stats-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.stats-title {
  font-size: 13px;
  font-weight: 600;
  color: #14203a;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stats-update {
  font-size: 10px;
  color: #5b6779;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 16px;
}

.stats-section {
  background: white;
  border-radius: 8px;
  padding: 12px 14px;
  border: 1px solid #dfe2e6;
}

.stats-section-wide {
  min-width: 0;
}

.stats-section-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #5b6779;
  margin-bottom: 10px;
  font-weight: 500;
}

.stats-trend-row {
  display: flex;
  gap: 8px;
}

.trend-item {
  flex: 1;
  text-align: center;
  padding: 6px 4px;
  background: #f6f7f8;
  border-radius: 6px;
}

.trend-period {
  display: block;
  font-size: 9px;
  color: #8f9aab;
  margin-bottom: 2px;
}

.trend-value {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #5b6779;
  font-variant-numeric: tabular-nums;
}

.trend-value.positive {
  color: #dc2626;
}

.trend-value.negative {
  color: #1b3d75;
}

.trend-value.neutral {
  color: #5b6779;
}

.trend-value.stale {
  color: #f59e0b;
  font-size: 9px;
}

.data-age {
  margin-top: 8px;
  font-size: 10px;
  color: #8f9aab;
  text-align: center;
}

.tle-age-metrics {
  margin-top: 4px;
  font-size: 9px;
  color: #8f9aab;
  text-align: center;
  line-height: 1.6;
}
.tle-age-label {
  color: #5b6779;
  font-weight: 600;
  margin-right: 2px;
}
.tle-age-item strong {
  color: #5b6779;
}
.tle-age-sep {
  margin: 0 3px;
  color: #c8ced6;
}
.tle-age-warn strong {
  color: #f59e0b;
}
.tle-age-stale {
  color: #ef4444;
  font-weight: 600;
}

.mini-plot {
  width: 100%;
  height: 70px;
  background: #f6f7f8;
  border-radius: 6px;
}

@media (max-width: 720px) {
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .stats-trend-row {
    gap: 6px;
  }

  .trend-item {
    padding: 8px 6px;
  }

  .trend-value {
    font-size: 14px;
  }

  .correlation-plot {
    height: 100px;
  }
}

/* Responsive */
@media (max-width: 600px) {
  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .activity-label {
    width: 60px;
    font-size: 9px;
  }

  .card-header {
    flex-wrap: wrap;
  }

  .card-stats {
    width: 100%;
    margin-left: 22px;
    margin-top: 8px;
  }

  .card-chart {
    height: 140px;
  }

  .section-note {
    font-size: 11px;
  }

  .chart-controls {
    width: 100%;
  }

  .control-btn {
    flex: 1;
    text-align: center;
  }

  .globe-container {
    flex-direction: column;
  }

  .satellite-globe {
    height: 300px;
  }

  .satellite-position-list {
    width: 100%;
    max-height: 200px;
  }
}
