/**
 * Density Inversion Page - Card Layout
 */

.density-note {
  margin: 20px 0;
  padding: 14px 18px;
  background: #f8fafc;
  border-left: 3px solid #64748b;
  border-radius: 4px;
  font-size: 13px;
  color: #475569;
  line-height: 1.5;
}

.density-note p {
  margin: 0;
}

.density-note strong {
  color: #334155;
}

.density-note em {
  font-style: italic;
}

.status {
  padding: 12px 20px;
  background: #f1f5f9;
  border-radius: 8px;
  font-size: 13px;
  text-align: center;
  color: #64748b;
  margin: 16px 0;
}

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

/* Satellite Cards */
.satellite-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  margin-bottom: 12px;
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.satellite-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.card-main {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  cursor: pointer;
  gap: 20px;
}

.card-info {
  flex-shrink: 0;
  min-width: 140px;
}

.card-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 8px;
}

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

.card-stats {
  display: flex;
  gap: 16px;
}

.card-stat {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #94a3b8;
  font-weight: 600;
}

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

/* Sparkline Container */
.card-sparkline {
  flex: 1;
  height: 80px;
  min-width: 200px;
}

/* Expand Button */
.card-expand {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: none;
  background: #f1f5f9;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  transition: all 0.15s;
}

.card-expand:hover {
  background: #e2e8f0;
  color: #1e293b;
}

.card-expand svg {
  width: 18px;
  height: 18px;
}

/* Kp Legend */
.kp-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: #f8fafc;
  border-top: 1px solid #f1f5f9;
  font-size: 11px;
  color: #64748b;
}

.kp-legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.kp-bar {
  width: 12px;
  height: 8px;
  border-radius: 2px;
}

.kp-quiet { background: rgba(34, 197, 94, 0.5); }
.kp-active { background: rgba(234, 179, 8, 0.6); }
.kp-storm { background: rgba(249, 115, 22, 0.7); }
.kp-severe { background: rgba(220, 38, 38, 0.7); }

/* Detail Modal */
.detail-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  padding: 20px;
  overflow-y: auto;
}

.detail-modal.active {
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.detail-content {
  background: white;
  border-radius: 16px;
  width: 100%;
  max-width: 900px;
  margin-top: 40px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #f1f5f9;
}

.detail-header h3 {
  margin: 0;
  font-size: 18px;
  color: #1e293b;
}

.detail-close {
  width: 32px;
  height: 32px;
  border: none;
  background: #f1f5f9;
  border-radius: 8px;
  font-size: 20px;
  cursor: pointer;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
}

.detail-close:hover {
  background: #e2e8f0;
  color: #1e293b;
}

.detail-chart {
  height: 350px;
  padding: 16px;
}

.detail-altitude-chart {
  height: 250px;
  padding: 16px;
  border-top: 1px solid #f1f5f9;
}

/* Responsive */
@media (max-width: 600px) {
  .card-main {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .card-info {
    min-width: auto;
  }

  .card-sparkline {
    height: 60px;
  }

  .card-expand {
    align-self: flex-end;
  }

  .kp-legend {
    flex-wrap: wrap;
  }

  .detail-content {
    margin-top: 20px;
  }

  .detail-chart {
    height: 280px;
  }

  .detail-altitude-chart {
    height: 200px;
  }
}
