/* ============================================================
   ACBF Impact Dashboard — impact-dashboard.css
   Brand tokens: green #0eab4b, gold #e8c16a, dark #1a1a1a, bg #f4f2ed
   ============================================================ */

.acbf-impact-dashboard {
  font-family: "Raleway", sans-serif;
  background: #f4f2ed;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
  margin: 15px auto;
  /* max-width: 1200px; */
}

/* ── Hero ───────────────────────────────────────────────────────────────────── */
.aid-hero {
  background: #0eab4b;
  padding: 1.5rem 2rem 1.25rem;
}

.aid-hero__inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.aid-hero__title {
  font-size: 1.6rem;
  font-weight: 600;
  color: #fff;
  margin: 0 0 0.25rem;
  line-height: 1.2;
}

.aid-hero__sub {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
}

.aid-hero__badge {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 0.75rem;
  padding: 0.4rem 0.9rem;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── Clickable stat links ───────────────────────────────────────────────────── */
.aid-stat__link {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: opacity 0.15s;
}

.aid-stat__link:hover .aid-stat__num {
  text-decoration: underline;
  text-decoration-color: rgba(232, 193, 106, 0.6);
  opacity: 0.85;
}

.aid-panel-stat-link {
  color: #0eab4b;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.15s, text-decoration-color 0.15s;
}

.aid-panel-stat-link:hover {
  color: #076b2e;
  text-decoration: underline;
}

/* ── Stats strip ────────────────────────────────────────────────────────────── */
.aid-stats {
  background: #1a1a1a;
  display: flex;
  flex-wrap: wrap;
}

.aid-stat {
  flex: 1 1 120px;
  padding: 1rem 1.25rem;
  text-align: center;
  border-right: 0.5px solid rgba(255, 255, 255, 0.1);
}

.aid-stat:last-child {
  border-right: none;
}

.aid-stat__num {
  display: block;
  font-size: 2rem;
  font-weight: 600;
  color: #e8c16a;
  line-height: 1.1;
  letter-spacing: -0.5px;
}

.aid-stat__label {
  display: block;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── Filter bar ─────────────────────────────────────────────────────────────── */
.aid-filters {
  background: #fff;
  border-bottom: 1px solid #e4e0d8;
  padding: 0.65rem 1.25rem;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.aid-filters__label {
  font-size: 0.75rem;
  color: #666;
  font-weight: 600;
  white-space: nowrap;
}

.aid-filter-select {
  appearance: none;
  border: 1px solid #d0ccc4;
  border-radius: 20px;
  padding: 5px 26px 5px 12px;
  font-size: 0.75rem;
  font-family: inherit;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23888'/%3E%3C/svg%3E") no-repeat right 9px center;
  color: #333;
  cursor: pointer;
  transition: border-color 0.15s;
}

.aid-filter-select:hover,
.aid-filter-select:focus {
  border-color: #0eab4b;
  outline: none;
}

.aid-filter-reset {
  margin-left: auto;
  background: none;
  border: 1px solid #d0ccc4;
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 0.75rem;
  font-family: inherit;
  color: #666;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color 0.15s, border-color 0.15s;
}

.aid-filter-reset:hover {
  color: #dc3545;
  border-color: #dc3545;
}

/* ── Map + panel ────────────────────────────────────────────────────────────── */
.aid-main {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 1fr);
  border-top: 1px solid #e4e0d8;
  background: #fff;
}

.aid-map-wrap {
  position: relative;
  background: #e6f4ed;
  border-right: 1px solid #e4e0d8;
  overflow: hidden;
  min-height: 420px;
}

.aid-map-wrap svg {
  display: block;
  width: 100%;
}

/* Tooltip */
.aid-map-tooltip {
  position: absolute;
  pointer-events: none;
  background: #1a1a1a;
  color: #fff;
  font-size: 0.7rem;
  font-family: "Raleway", sans-serif;
  padding: 6px 10px;
  border-radius: 6px;
  white-space: nowrap;
  display: none;
  z-index: 20;
  line-height: 1.5;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.aid-map-tooltip strong {
  display: block;
  font-size: 0.75rem;
  color: #e8c16a;
  margin-bottom: 1px;
}

/* Legend */
.aid-map-legend {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: rgba(255, 255, 255, 0.94);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.68rem;
  color: #333;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.12);
}

.aid-map-legend__title {
  font-weight: 600;
  margin: 0 0 5px;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.aid-legend-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
  line-height: 1.4;
}

.aid-legend-swatch {
  display: inline-block;
  width: 14px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* Country detail panel */
.aid-country-panel {
  padding: 1.25rem 1rem;
  background: #fff;
}

.aid-panel-placeholder {
  text-align: center;
  color: #aaa;
  padding-top: 3rem;
}

.aid-panel-placeholder i {
  font-size: 2rem;
  display: block;
  margin-bottom: 0.75rem;
  color: #ccc;
}

.aid-panel-placeholder p {
  font-size: 0.8rem;
  margin: 0;
  line-height: 1.5;
}

.aid-panel-name {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.9rem;
  color: #1a1a1a;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid #0eab4b;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

/* Small "pinned" badge shown when a country is clicked/locked */
.aid-panel-name::after {
  content: '';
  display: none;
}

.aid-panel-detail[data-pinned="true"] .aid-panel-name::after {
  content: '📌';
  font-size: 0.75rem;
  display: inline;
  opacity: 0.6;
}

.aid-panel-stats {
  margin: 0 0 1rem;
}

.aid-panel-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  padding: 6px 0;
  border-bottom: 0.5px solid #f0ece4;
}

.aid-panel-row:last-child {
  border-bottom: none;
}

.aid-panel-row dt {
  color: #666;
  font-weight: 400;
  display: flex;
  align-items: center;
  gap: 6px;
}

.aid-panel-row dt i {
  color: #0eab4b;
  width: 14px;
  text-align: center;
}

.aid-panel-row dd {
  font-weight: 600;
  color: #0eab4b;
  margin: 0;
}

.aid-panel-section {
  margin-top: 0.8rem;
}

.aid-panel-section-title {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #999;
  margin: 0 0 6px;
}

.aid-theme-tag {
  display: inline-block;
  background: #e8f5ec;
  color: #076b2e;
  border-radius: 10px;
  padding: 2px 8px;
  font-size: 0.68rem;
  margin: 2px;
  font-weight: 500;
}

.aid-rec-tag {
  display: inline-block;
  background: #fff8e6;
  color: #8a6000;
  border-radius: 10px;
  padding: 2px 8px;
  font-size: 0.68rem;
  margin: 2px;
  font-weight: 500;
}

/* ── Charts row ─────────────────────────────────────────────────────────────── */
.aid-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid #e4e0d8;
  background: #fff;
}

.aid-chart-block {
  padding: 1rem 1.25rem 1.25rem;
}

.aid-chart-block:first-child {
  border-right: 1px solid #e4e0d8;
}

.aid-chart-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: #333;
  margin: 0 0 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.aid-chart-wrap {
  position: relative;
  height: 200px;
}

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .aid-main {
    grid-template-columns: 1fr;
  }

  .aid-country-panel {
    border-top: 1px solid #e4e0d8;
    min-height: auto;
    padding: 1rem;
  }

  .aid-charts {
    grid-template-columns: 1fr;
  }

  .aid-chart-block:first-child {
    border-right: none;
    border-bottom: 1px solid #e4e0d8;
  }

  .aid-stat__num {
    font-size: 1.5rem;
  }

  .aid-hero__title {
    font-size: 1.25rem;
  }
}

@media (max-width: 480px) {
  .aid-stat {
    flex: 1 1 80px;
    padding: 0.75rem 0.5rem;
  }

  .aid-filters {
    gap: 6px;
  }

  .aid-filter-select {
    font-size: 0.7rem;
    padding: 4px 22px 4px 8px;
  }
}
