/* Flora & Ecosystem Intelligence — accent overrides (shared rules in hub-base.css)
   Hub accent uses --severity-success ("lodgepole forest" #157347) so flora
   owns the deeper editorial green. Civic/governance hubs keep #16A34A. */
.fl-root { --hub-accent: var(--guide-color-action); }

/* ═══ Forest Tab Visual Cards ═════════════════════════════════════════════════ */

/* Forest tool cards */
.flora-tool-card {
  padding: 6px 8px;
  border-radius: 4px;
  background: var(--bg-3, #F7F5F0);
  transition: background 0.15s, transform 0.1s;
  cursor: pointer;
}
.flora-tool-card:hover { background: var(--bg-4, #EDEAE2); transform: translateX(2px); }
.flora-tool-card-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary, #1A1A1F);
}
.flora-tool-card-desc {
  font-size: var(--text-xxs);
  color: var(--text-secondary, #4A4A52);
  margin: 1px 0 3px;
  line-height: 1.3;
}
.flora-tool-card-meta {
  display: flex;
  gap: 8px;
  font-size: var(--text-xs);
  color: var(--text-tertiary, #6B6B73);
}

/* ─── NDVI Comparison Bars ────────────────────────────────────────────────── */
.ndvi-bar-row {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 3px 0;
}
.ndvi-bar-label {
  font-size: var(--text-xs);
  font-weight: 600;
  min-width: 80px;
  color: var(--text-primary, #1A1A1F);
}
.ndvi-bar-track {
  flex: 1;
  height: 8px;
  background: var(--bg-0, #e5ddd0);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}
.ndvi-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}
.ndvi-bar-baseline {
  position: absolute;
  top: 0;
  width: 2px;
  height: 100%;
  background: rgba(0,0,0,0.3);
}
.ndvi-bar-value {
  font-size: var(--text-xs);
  font-weight: 700;
  min-width: 30px;
  text-align: right;
}

/* ─── Riparian Corridor Cards ─────────────────────────────────────────────── */
.riparian-corridor-card {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 6px 8px;
  background: var(--bg-3, #F7F5F0);
  border-radius: 4px;
  transition: background 0.15s;
}
.riparian-corridor-card:hover { background: var(--bg-4, #EDEAE2); }

.riparian-grade-badge {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-lg);
  font-weight: 800;
  color: var(--guide-color-text-on-accent, #fff);
  flex-shrink: 0;
}

.riparian-corridor-info {
  flex: 1;
  min-width: 0;
}
.riparian-corridor-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary, #1A1A1F);
}
.riparian-corridor-stats {
  display: flex;
  gap: 8px;
  font-size: var(--text-xs);
  color: var(--text-tertiary, #6B6B73);
  margin-top: 2px;
}
.riparian-health-bar {
  height: 6px;
  background: var(--bg-0, #e5ddd0);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 3px;
}
.riparian-health-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s;
}

/* ─── Fire Risk Indicators ────────────────────────────────────────────────── */
.fire-risk-gauge {
  text-align: center;
  padding: 8px;
  border-radius: 6px;
  background: var(--bg-3, #F7F5F0);
}
.fire-risk-value {
  font-size: var(--guide-fs-2xl);
  font-weight: 800;
}
.fire-risk-label {
  font-size: var(--text-xs);
  color: var(--text-tertiary, #6B6B73);
  margin-top: 2px;
}

/* ─── Flora Layer Toggle ──────────────────────────────────────────────────── */

/* ─── Flora Insights Panel ────────────────────────────────────────────────── */
.flora-insight-card {
  display: flex;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 4px;
  background: var(--bg-3, #F7F5F0);
  border: 1px solid var(--guide-color-line);
}

/* ─── Hex Mode Toggle ─────────────────────────────────────────────────────── */
.hex-mode-btn {
  transition: opacity 0.15s;
}
.hex-mode-btn:hover {
  opacity: 0.8;
}

/* ── Dark-theme overrides ── */
[data-theme="dark"] .ndvi-bar-track,
[data-theme="dark"] .riparian-health-bar {
  background: rgba(255,255,255,0.12);
}
[data-theme="dark"] .ndvi-bar-baseline { background: rgba(255,255,255,0.25); }
[data-theme="dark"] .fire-risk-gauge { background: var(--bg-3, #252A33); }

/* ═══ Mobile Responsive — Flora Panels ═══════════════════════════════════ */
@media (max-width: 768px) {
  /* Flora sub-panels full width */
  #flora-forest, #flora-vegetation, #flora-riparian {
    padding: 0 4px;
  }

  /* Tool cards compact */
  .flora-tool-card-meta { flex-wrap: wrap; }
  .flora-tool-card { padding: 4px 6px; }

  /* NDVI bars */
  .ndvi-bar-label { min-width: 60px; font-size: var(--guide-fs-2xs); }

  /* Riparian cards stack */
  .riparian-corridor-card { flex-direction: column; align-items: flex-start; gap: 4px; }
  .riparian-corridor-stats { flex-wrap: wrap; }

  /* Hex grids compact */
  [id$="-panel"] [style*="grid-template-columns:repeat(5"] { grid-template-columns: repeat(3, 1fr) !important; }

  /* Dashboard grids */
  #flora-dashboard-panel [style*="grid-template-columns:repeat(3"] { grid-template-columns: repeat(2, 1fr) !important; }

  /* Ecoregion table */
  #ecoregion-report-panel table { font-size: var(--guide-fs-2xs); }
  #ecoregion-report-panel th, #ecoregion-report-panel td { padding: 2px 3px; }

  /* Scorecard */
  #flora-scorecard-panel [style*="font-size:32px"] { font-size: var(--guide-fs-2xl) !important; }

  /* Layer toggles */
  
  

  /* Fire risk gauges */
  .fire-risk-gauge { padding: 4px; }
  .fire-risk-value { font-size: var(--guide-fs-lg); }
}

@media (max-width: 480px) {
  /* Extra small screens */
  [id$="-panel"] [style*="grid-template-columns:repeat(5"] { grid-template-columns: repeat(2, 1fr) !important; }
  [id$="-panel"] [style*="grid-template-columns:repeat(4"] { grid-template-columns: repeat(2, 1fr) !important; }
  .flora-tool-card-name { font-size: var(--text-xxs); }
  .ndvi-bar-label { min-width: 50px; }
  .riparian-corridor-name { font-size: var(--text-xxs); }
  .riparian-grade-badge { width: 24px; height: 24px; font-size: var(--text-sm); }

  /* Stack corridor stats */
  .riparian-corridor-stats { flex-direction: column; gap: 2px; }
}
