/**
 * 🛡️ DISASTERS PANEL - Unified Styling
 * Tabbed interface for Seismic Waves + Floods
 * @version 1.0.0 (2025-12-02)
 */

/* ========================================
   PANEL CONTAINER
   ======================================== */

.disasters-panel {
  position: fixed;
  top: 80px;
  right: 20px;
  width: 460px;
  max-height: calc(100vh - 100px);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.98) 0%, rgba(30, 41, 59, 0.98) 100%);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(20px);
  z-index: 10000;
  display: none;
  flex-direction: column;
  overflow: hidden;
  transform: translateX(20px);
  opacity: 0;
  transition: transform 0.25s cubic-bezier(0.4, 0.14, 0.3, 1), 
              opacity 0.25s cubic-bezier(0.4, 0.14, 0.3, 1);
}

.disasters-panel.open {
  display: flex;
  transform: translateX(0);
  opacity: 1;
}

/* ========================================
   HEADER
   ======================================== */

.disasters-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: rgba(15, 23, 42, 0.6);
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.disasters-panel-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.disasters-panel-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #f1f5f9;
  letter-spacing: 0.3px;
}

.disasters-panel-badges {
  display: flex;
  gap: 6px;
}

.disasters-badge {
  padding: 3px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.disasters-badge.ai {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: white;
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.disasters-panel-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.15s;
}

.disasters-panel-close:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

/* ========================================
   TAB NAVIGATION
   ======================================== */

.disasters-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 12px;
  background: rgba(15, 23, 42, 0.4);
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.disasters-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.disasters-tab:hover {
  background: rgba(148, 163, 184, 0.08);
  color: #e2e8f0;
}

.disasters-tab.active {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.4);
  color: #60a5fa;
}

.disasters-tab .tab-icon {
  font-size: 14px;
}

.disasters-tab .tab-label {
  font-weight: 600;
}

.disasters-tab .tab-badge {
  background: #ef4444;
  color: white;
  padding: 2px 6px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  text-align: center;
}

.disasters-tab .tab-status {
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.disasters-tab .tab-status.training {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* ========================================
   TAB CONTENT
   ======================================== */

.disasters-tab-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.disasters-loading,
.disasters-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: #64748b;
  text-align: center;
  gap: 12px;
}

.disasters-loading .spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(148, 163, 184, 0.2);
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ========================================
   SEISMIC TAB STYLES
   ======================================== */

.seismic-legend {
  display: flex;
  justify-content: center;
  gap: 16px;
  padding: 10px;
  background: rgba(15, 23, 42, 0.5);
  border-radius: 8px;
  margin-bottom: 12px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: #94a3b8;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dot.p-wave { background: #ef4444; }
.dot.s-wave { background: #22c55e; }
.dot.surface-wave { background: #3b82f6; }

.seismic-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.seismic-loading,
.seismic-empty,
.seismic-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  color: #64748b;
  gap: 8px;
}

.seismic-empty .icon,
.seismic-error .icon {
  font-size: 48px;
  margin-bottom: 8px;
}

.seismic-empty .title {
  font-size: 14px;
  color: #94a3b8;
}

.seismic-empty .subtitle {
  font-size: 12px;
}

.seismic-empty .legend-mini {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  font-size: 10px;
}

/* Section Cards */
.section-card {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  padding: 12px;
}

.section-card.seedlink {
  margin-bottom: 12px;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.section-header .icon {
  font-size: 14px;
}

.section-header .title {
  font-weight: 600;
  font-size: 12px;
  color: #e2e8f0;
}

.section-header .subtitle {
  font-size: 10px;
  color: #64748b;
}

.section-header.usgs {
  margin-bottom: 10px;
  padding-left: 4px;
}

.usgs-badge {
  background: #10b981;
  color: white;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.section-note {
  font-size: 9px;
  color: #64748b;
  margin-bottom: 10px;
  padding-left: 22px;
}

/* SeedLink Alerts */
.seedlink-alert {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 8px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  font-size: 11px;
}

.seedlink-alert:last-child {
  border-bottom: none;
}

.seedlink-alert .station {
  color: #94a3b8;
}

.seedlink-alert .waves {
  display: flex;
  gap: 4px;
}

.seedlink-alert .time {
  color: #64748b;
  font-size: 10px;
}

.wave-indicator {
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 600;
}

.wave-indicator.p {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.wave-indicator.s {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.wave-indicator.sf {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

/* Earthquake Cards */
.earthquake-card {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.earthquake-card:hover {
  border-color: rgba(59, 130, 246, 0.5);
  background: rgba(30, 41, 59, 0.8);
}

.eq-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.eq-info {
  flex: 1;
}

.eq-place {
  font-size: 14px;
  font-weight: 600;
  color: #f1f5f9;
  margin-bottom: 4px;
}

.eq-time {
  font-size: 11px;
  color: #94a3b8;
  margin-bottom: 6px;
}

.eq-waves {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 4px;
}

.wave-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.wave-badge.inactive {
  background: rgba(100, 116, 139, 0.1);
  border: 1px solid rgba(100, 116, 139, 0.3);
  color: #64748b;
  opacity: 0.5;
}

.wave-badge.p-wave {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid #ef4444;
  color: #ef4444;
}

.wave-badge.s-wave {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid #22c55e;
  color: #22c55e;
}

.wave-badge.surface-wave {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid #3b82f6;
  color: #3b82f6;
}

.full-event-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid #a855f7;
  color: #a855f7;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.3px;
  margin-top: 4px;
}

.eq-magnitude {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  color: white;
  text-transform: uppercase;
}

.eq-magnitude.mag-extreme { background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%); }
.eq-magnitude.mag-major { background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%); }
.eq-magnitude.mag-moderate { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); }
.eq-magnitude.mag-light { background: linear-gradient(135deg, #eab308 0%, #ca8a04 100%); }
.eq-magnitude.mag-minor { background: linear-gradient(135deg, #84cc16 0%, #65a30d 100%); }

.eq-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
  font-size: 11px;
  color: #94a3b8;
}

.eq-details strong {
  color: #f1f5f9;
}

/* Cameras Section */
.cameras-section {
  margin-top: 12px;
  border-top: 1px solid rgba(71, 85, 105, 0.3);
  padding-top: 10px;
}

.cameras-header {
  font-size: 10px;
  font-weight: 600;
  color: #94a3b8;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.camera-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(71, 85, 105, 0.4);
  border-radius: 6px;
  padding: 8px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.camera-card:hover {
  border-color: rgba(59, 130, 246, 0.6);
}

.cam-name {
  font-size: 10px;
  font-weight: 600;
  color: #f1f5f9;
  flex: 1;
}

.cam-status {
  font-size: 9px;
  padding: 2px 5px;
  border-radius: 4px;
}

.cam-status.live {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.cam-distance {
  font-size: 9px;
  font-weight: 500;
}

.cam-distance.close { color: #10b981; }
.cam-distance.medium { color: #f59e0b; }
.cam-distance.far { color: #94a3b8; }

/* ========================================
   FLOODS TAB STYLES
   ======================================== */

.floods-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 30px 20px;
  text-align: center;
}

.placeholder-icon {
  margin-bottom: 20px;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.placeholder-content {
  width: 100%;
}

.placeholder-title {
  margin: 0 0 4px 0;
  font-size: 20px;
  font-weight: 700;
  color: #f1f5f9;
  letter-spacing: 0.5px;
}

.placeholder-subtitle {
  margin: 0 0 20px 0;
  font-size: 13px;
  color: #94a3b8;
}

.training-status {
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 20px;
}

.status-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
}

.pulse-dot {
  width: 10px;
  height: 10px;
  background: #3b82f6;
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.1); }
}

.status-text {
  font-size: 12px;
  font-weight: 600;
  color: #60a5fa;
}

.status-detail {
  font-size: 11px;
  color: #94a3b8;
}

.features-preview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 20px;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 6px;
  padding: 10px;
  font-size: 11px;
  color: #94a3b8;
}

.feature-icon {
  font-size: 14px;
}

.datasets-info {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.dataset-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(168, 85, 247, 0.1);
  border: 1px solid rgba(168, 85, 247, 0.25);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 10px;
  color: #a855f7;
}

.badge-icon {
  font-size: 12px;
}

/* ========================================
   FLOODS TAB - LIVE CAMERA ROTATION
   ======================================== */

.floods-tab-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
}

/* Weather Status Card */
.floods-weather-card {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 10px;
  padding: 14px;
}

.weather-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 600;
  color: #f1f5f9;
}

.weather-icon {
  font-size: 18px;
}

.weather-placeholder {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.weather-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.weather-label {
  color: #94a3b8;
}

.weather-value {
  color: #f1f5f9;
  font-weight: 600;
}

.placeholder-shimmer {
  background: linear-gradient(90deg, #334155 25%, #475569 50%, #334155 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  padding: 2px 8px;
  border-radius: 4px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.weather-note {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
  text-align: center;
  color: #64748b;
  font-size: 11px;
}

/* Camera Display */
.floods-camera-display {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 10px;
  overflow: hidden;
}

.camera-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background: rgba(30, 41, 59, 0.6);
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.camera-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.camera-icon {
  font-size: 16px;
}

.camera-name {
  font-size: 13px;
  font-weight: 600;
  color: #f1f5f9;
}

.camera-controls {
  display: flex;
  gap: 6px;
}

.camera-control-btn {
  background: rgba(51, 65, 85, 0.6);
  border: 1px solid #475569;
  border-radius: 6px;
  color: #e2e8f0;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.15s;
}

.camera-control-btn:hover {
  background: rgba(71, 85, 105, 0.8);
  border-color: #60a5fa;
  transform: scale(1.05);
}

.camera-image-container {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  background: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
}

.camera-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.camera-loading {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(15, 23, 42, 0.95);
  color: #94a3b8;
  font-size: 13px;
}

.spinner {
  border: 3px solid rgba(148, 163, 184, 0.2);
  border-top-color: #60a5fa;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.camera-info {
  padding: 12px 14px;
  background: rgba(15, 23, 42, 0.6);
  border-top: 1px solid rgba(148, 163, 184, 0.1);
}

.camera-location {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #94a3b8;
  margin-bottom: 8px;
}

.info-icon {
  font-size: 14px;
}

.camera-stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #cbd5e1;
}

.stat-icon {
  font-size: 14px;
}

.camera-attribution {
  padding-top: 8px;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
}

.attribution-text {
  font-size: 10px;
  color: #64748b;
  font-style: italic;
}

.camera-rotation-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  background: rgba(30, 41, 59, 0.6);
  border-top: 1px solid rgba(148, 163, 184, 0.1);
  font-size: 11px;
}

.rotation-spot {
  color: #f59e0b;
  font-weight: 600;
}

.rotation-counter {
  color: #64748b;
}

/* System Status */
.floods-system-status {
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
}

.status-label {
  color: #94a3b8;
}

.status-value {
  color: #f1f5f9;
  font-weight: 600;
}

/* Prototype Notice */
.floods-prototype-notice {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 8px;
  padding: 12px;
}

.prototype-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.prototype-icon {
  font-size: 16px;
}

.prototype-title {
  font-size: 12px;
  font-weight: 700;
  color: #f59e0b;
  letter-spacing: 0.5px;
}

.prototype-text {
  font-size: 11px;
  color: #cbd5e1;
  line-height: 1.5;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
  .disasters-panel {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-height: 70vh;
    border-radius: 16px 16px 0 0;
    transform: translateY(100%);
  }

  .disasters-panel.open {
    transform: translateY(0);
  }

  .features-preview {
    grid-template-columns: 1fr;
  }

  .floods-tab-container {
    padding: 12px;
  }

  .camera-stats {
    flex-direction: column;
    gap: 8px;
  }
}





