/* ==========================================================================
   WebGIS TP.HCM — GD3 Unified Layout Enhancements
   Loaded after GD2 styles. Maintains clean hierarchy and design tokens.
   ========================================================================== */

/* Year picker widget in data filters */
.wgd3-year-picker {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 8px 0 0;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
}
.wgd3-year-picker label {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  margin: 0;
  white-space: nowrap;
}
.wgd3-year-picker select {
  flex: 1;
  min-width: 0;
  min-height: 30px;
  height: 30px;
  font-size: 12.5px;
  color: var(--accent);
  font-weight: 750;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  padding: 2px 6px;
}

/* Remove duplicate wheel hint since zoom controls and gestures work natively */
.map-wheel-hint {
  display: none !important;
}

/* Desktop Charts view height consistency */
@media (min-width: 1024px) {
  body[data-view="charts-view"] #charts-view {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow: hidden;
  }
  body[data-view="charts-view"] .chart-grid {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    align-items: stretch;
    margin: 0;
  }
  body[data-view="charts-view"] .chart-card.interactive-chart {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 12px 14px;
    overflow: hidden;
  }
  body[data-view="charts-view"] .canvas-wrap {
    flex: 1 1 auto;
    min-height: 0;
    height: 100% !important;
    position: relative;
  }
  body[data-view="charts-view"] .canvas-wrap canvas {
    height: 100% !important;
    max-height: 100%;
  }
}


/* ==========================================================================
   WebGIS TP.HCM — Smart Context Banner (Overview / Reliability tabs)
   ========================================================================== */
.context-banner {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  margin: 10px 0;
  border-radius: 8px;
  background: rgba(14, 165, 233, 0.08);
  border: 1px solid rgba(14, 165, 233, 0.28);
  font-size: 0.82rem;
  color: var(--text);
}
.context-banner .btn-link {
  appearance: none;
  background: none;
  border: none;
  padding: 0;
  color: #0284c7;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  font-size: 0.84rem;
  transition: color 0.15s ease;
}
.context-banner .btn-link:hover {
  color: #0369a1;
  text-decoration: underline;
}
[data-theme="dark"] .context-banner {
  background: rgba(14, 165, 233, 0.12);
  border-color: rgba(56, 189, 248, 0.3);
}
[data-theme="dark"] .context-banner .btn-link {
  color: #38bdf8;
}

/* ==========================================================================
   Drought Map View — 30-Year SPI Time-Series Sidebar Card (#drought-preview)
   ========================================================================== */
.drought-preview-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  border-top: 3px solid #f59e0b;
}
.drought-preview-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.drought-preview-head h2 {
  font-size: 0.96rem;
  font-weight: 700;
  margin: 2px 0 0;
  color: var(--text);
}
.station-chip-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.14);
  color: #d97706;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}
[data-theme="dark"] .station-chip-badge {
  background: rgba(245, 158, 11, 0.22);
  color: #fbbf24;
}
.drought-quick-ranges {
  display: flex;
  gap: 5px;
  margin-top: 2px;
}
.drought-range-pill {
  appearance: none;
  background: var(--surface-soft, rgba(0,0,0,0.04));
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s ease;
}
.drought-range-pill:hover {
  color: var(--text);
  border-color: var(--text-secondary);
}
.drought-range-pill.is-active {
  background: #f59e0b;
  border-color: #f59e0b;
  color: #ffffff;
}
.drought-preview-chart-wrap {
  width: 100%;
  height: 140px;
  position: relative;
  margin-top: 4px;
}
.drought-threshold-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 2px;
}
.drought-threshold-tags .d-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.drought-threshold-tags .d-tag i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* ==========================================================================
   Figure Library — Filter Tabs/Pills (28 Figures)
   ========================================================================== */
.gallery-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.gallery-pill {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-secondary, #64748b);
  padding: 5px 12px;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.gallery-pill:hover {
  border-color: var(--text-muted);
  background: var(--surface-soft, rgba(0,0,0,0.03));
  color: var(--text);
}
.gallery-pill.is-active {
  background: #0d9488;
  color: #ffffff;
  border-color: #0d9488;
}

/* ==========================================================================
   LOSO Methodology Section — Academic 2-Card Layout
   ========================================================================== */
.notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
  margin-top: 1.25rem;
}
.note-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid #0284c7;
  border-radius: 8px;
  padding: 1.25rem;
}
.note-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 0.6rem;
}
.note-card p {
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.6;
  margin: 0;
}
.metric-definitions {
  margin: 0.6rem 0 0;
  padding-left: 1.25rem;
  color: var(--text-secondary);
  font-size: 0.86rem;
}
.metric-definitions li {
  margin-bottom: 0.45rem;
  line-height: 1.5;
}
