/* =============================================
   METEOSPHERE — COMPONENTS CSS
   ============================================= */

/* ---- UV INDEX BADGE ---- */
.uv-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-data);
}
.uv-0  { background: rgba(105,240,174,0.2); color: #69F0AE; }
.uv-3  { background: rgba(255,241,118,0.2); color: #FFF176; }
.uv-6  { background: rgba(255,183,77,0.2);  color: #FFB74D; }
.uv-8  { background: rgba(255,82,82,0.2);   color: #FF5252; }
.uv-11 { background: rgba(206,147,216,0.2); color: #CE93D8; }

/* ---- AQI COLOR BANDS ---- */
.aqi-good        { color: #69F0AE; }
.aqi-moderate    { color: #FFF176; }
.aqi-sensitive   { color: #FFB74D; }
.aqi-unhealthy   { color: #FF5252; }
.aqi-very-unhealthy { color: #CE93D8; }
.aqi-hazardous   { color: #FF1744; }

/* ---- BEAUFORT SCALE ---- */
.beaufort-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-data);
  background: var(--accent-glow);
  color: var(--accent);
}

/* ---- PROGRESS BARS ---- */
.progress-bar-wrap {
  background: var(--bg-input);
  border-radius: 99px;
  height: 6px;
  overflow: hidden;
  margin-top: 6px;
}
.progress-bar-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-bright) 100%);
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- HUMIDITY GAUGE ---- */
.humidity-gauge {
  position: relative;
  width: 80px;
  height: 80px;
}
.humidity-gauge svg { transform: rotate(-90deg); }
.humidity-gauge .gauge-track { fill: none; stroke: var(--bg-input); stroke-width: 7; }
.humidity-gauge .gauge-fill { fill: none; stroke: var(--accent); stroke-width: 7; stroke-linecap: round; transition: stroke-dashoffset 1s ease; }
.humidity-gauge .gauge-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-data);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

/* ---- SKELETON LOADERS ---- */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-text.wide { width: 80%; }
.skeleton-text.medium { width: 55%; }
.skeleton-text.narrow { width: 35%; }
.skeleton-temp { height: 60px; width: 120px; border-radius: var(--radius-md); }

/* ---- WEATHER CONDITION BADGES ---- */
.condition-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

/* ---- DATA TABLE ENHANCEMENTS ---- */
.data-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-data);
}
.tag-hot    { background: rgba(255,82,82,0.15);   color: #FF5252; }
.tag-warm   { background: rgba(255,183,77,0.15);  color: #FFB74D; }
.tag-mild   { background: rgba(105,240,174,0.15); color: #69F0AE; }
.tag-cool   { background: rgba(79,195,247,0.15);  color: #4FC3F7; }
.tag-cold   { background: rgba(100,181,246,0.15); color: #64B5F6; }
.tag-freeze { background: rgba(206,147,216,0.15); color: #CE93D8; }

/* ---- ICON WITH LABEL ---- */
.icon-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}
.icon-label .icon { font-size: 16px; }

/* ---- MINI STAT ROW ---- */
.mini-stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.mini-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 80px;
}
.mini-stat .ms-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.mini-stat .ms-val { font-family: var(--font-data); font-size: 14px; font-weight: 600; color: var(--text-primary); }

/* ---- TOGGLE SWITCH ---- */
.toggle-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.toggle-label { font-size: 13px; color: var(--text-secondary); }
.toggle-switch {
  position: relative;
  width: 42px;
  height: 24px;
  cursor: pointer;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 99px;
  transition: background var(--transition);
}
.toggle-slider::after {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  background: var(--text-muted);
  border-radius: 50%;
  top: 3px; left: 3px;
  transition: transform var(--transition), background var(--transition);
}
.toggle-switch input:checked + .toggle-slider { background: var(--accent-glow); border-color: var(--accent); }
.toggle-switch input:checked + .toggle-slider::after { transform: translateX(18px); background: var(--accent); }

/* ---- EXPANDABLE SECTION ---- */
.expandable-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}
.expandable-arrow {
  transition: transform var(--transition);
  color: var(--text-muted);
  font-size: 12px;
}
.expandable-header.open .expandable-arrow { transform: rotate(180deg); }
.expandable-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}
.expandable-body.open { max-height: 1000px; }

/* ---- WIND DIRECTION ARROWS ---- */
.wind-dir-arrow {
  display: inline-block;
  font-size: 18px;
  transition: transform var(--transition);
}

/* ---- PRECIPITATION TYPE ICONS ---- */
.precip-rain   { color: #4FC3F7; }
.precip-snow   { color: #B0BEC5; }
.precip-sleet  { color: #80DEEA; }
.precip-hail   { color: #CE93D8; }
.precip-thunder { color: #FFD740; }

/* ---- CHART TOOLTIP OVERRIDE ---- */
.chartjs-tooltip {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-strong) !important;
  border-radius: var(--radius-md) !important;
  color: var(--text-primary) !important;
  font-family: var(--font-ui) !important;
  font-size: 13px !important;
  padding: 10px 14px !important;
  box-shadow: var(--shadow-modal) !important;
}

/* ---- LEAFLET DARK THEME OVERRIDES ---- */
.leaflet-container {
  background: #0A0E1A !important;
  font-family: var(--font-ui) !important;
}
.leaflet-control-zoom a {
  background: var(--bg-card) !important;
  color: var(--text-primary) !important;
  border-color: var(--border) !important;
}
.leaflet-control-zoom a:hover { background: var(--bg-card-hover) !important; }
.leaflet-popup-content-wrapper {
  background: var(--bg-card) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-strong) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-modal) !important;
}
.leaflet-popup-tip { background: var(--bg-card) !important; }
.leaflet-popup-content { font-family: var(--font-ui) !important; font-size: 13px !important; }
.leaflet-attribution-flag { display: none !important; }
.leaflet-control-attribution {
  background: rgba(8,12,24,0.7) !important;
  color: var(--text-muted) !important;
  font-size: 10px !important;
}
.leaflet-control-attribution a { color: var(--accent) !important; }

/* ---- POPUP WEATHER CARD ---- */
.map-popup {
  min-width: 180px;
}
.map-popup .mp-title { font-weight: 700; font-size: 14px; color: var(--text-primary); margin-bottom: 8px; }
.map-popup .mp-temp { font-family: var(--font-data); font-size: 28px; font-weight: 700; color: var(--accent); }
.map-popup .mp-row { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-secondary); margin-top: 4px; }

/* ---- CHART CONTAINER SIZING ---- */
canvas { display: block; }

/* ---- EMPTY STATE ---- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 64px 24px;
  color: var(--text-muted);
  text-align: center;
}
.empty-state .es-icon { font-size: 56px; opacity: 0.5; }
.empty-state .es-title { font-size: 16px; font-weight: 600; color: var(--text-secondary); }
.empty-state .es-desc { font-size: 13px; max-width: 280px; line-height: 1.6; }

/* ---- DIVIDER ---- */
.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

/* ---- INLINE BADGE ---- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-data);
}
.badge-blue   { background: rgba(79,195,247,0.15); color: var(--accent); }
.badge-green  { background: rgba(105,240,174,0.15); color: var(--accent-green); }
.badge-orange { background: rgba(255,183,77,0.15);  color: var(--accent-warm); }
.badge-red    { background: rgba(255,82,82,0.15);   color: var(--accent-red); }

/* ---- STATS TABLE ---- */
.stats-table {
  width: 100%;
  font-size: 13.5px;
}
.stats-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}
.stats-table td:last-child {
  font-family: var(--font-data);
  font-weight: 600;
  color: var(--text-primary);
  text-align: right;
}
.stats-table tr:last-child td { border-bottom: none; }

/* ---- NUMBER DISPLAY ---- */
.big-number {
  font-family: var(--font-data);
  font-size: 48px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -2px;
}
.big-number.highlight { color: var(--accent); }
.big-number.warm { color: var(--accent-warm); }
.big-number.cold { color: #64B5F6; }

/* ---- SECTION DIVIDER WITH LABEL ---- */
.section-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
}
.section-divider span {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  white-space: nowrap;
}
.section-divider::before,
.section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ---- RESPONSIVE TABLE SCROLL WRAPPER ---- */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ---- ICON GRID (for conditions legend) ---- */
.icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 8px;
}
.icon-grid-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  cursor: default;
}
.icon-grid-item .ig-icon { font-size: 28px; }

/* ---- FULLSCREEN BTN ---- */
.fullscreen-btn {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  padding: 5px 10px;
  font-size: 14px;
  transition: all var(--transition);
}
.fullscreen-btn:hover { color: var(--accent); border-color: var(--accent); }

/* ---- NOTIFICATION DOT ---- */
.notif-dot {
  position: absolute;
  top: -3px; right: -3px;
  width: 8px; height: 8px;
  background: var(--accent-red);
  border-radius: 50%;
  border: 2px solid var(--bg-surface);
}

/* ---- STEP INDICATOR ---- */
.step-dots {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 12px;
}
.step-dot {
  width: 6px; height: 6px;
  background: var(--border-strong);
  border-radius: 50%;
  transition: background var(--transition);
}
.step-dot.active { background: var(--accent); }

/* ---- CLIMATE TABLE MONTH COLORS ---- */
.month-cell { font-weight: 600; font-family: var(--font-data); }
.month-jan, .month-feb, .month-dec { color: #64B5F6; }
.month-mar, .month-nov { color: #80DEEA; }
.month-apr, .month-oct { color: var(--accent-green); }
.month-may, .month-sep { color: #FFF176; }
.month-jun, .month-aug { color: var(--accent-warm); }
.month-jul { color: var(--accent-red); }

/* ---- SATELLITE EMBED WRAPPER ---- */
.satellite-embed { border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--border); }
