/* Air Quality Dashboard - Bootstrap 4 compatible */
:root {
  --aq-primary: #2bb673;
  --aq-primary-dark: #178856;
  --aq-soft: #f4fbf8;
  --aq-border: #e6ece9;
  --aq-text: #1f2933;
  --aq-muted: #6b7280;
  --aq-shadow: 0 14px 35px rgba(16, 24, 40, .08);
  --aq-radius: 18px;
}

.aq-section {
  background: linear-gradient(180deg, #f7fbf9 0%, #ffffff 42%, #ffffff 100%);
  color: var(--aq-text);
}

.aq-hero {
  background:
    radial-gradient(circle at top left, rgba(43,182,115,.16), transparent 35%),
    linear-gradient(135deg, #ffffff 0%, #f5fbf8 100%);
  border: 1px solid var(--aq-border);
  border-radius: 26px;
  padding: 26px;
  box-shadow: var(--aq-shadow);
}

.aq-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--aq-primary-dark);
  background: rgba(43,182,115,.10);
  border: 1px solid rgba(43,182,115,.22);
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 700;
  font-size: .9rem;
  margin-bottom: 10px;
}

.aq-title {
  font-weight: 800;
  color: #123025;
  letter-spacing: -.3px;
}

.aq-subtitle,
.aq-source-note {
  color: var(--aq-muted);
  line-height: 1.65;
}

.aq-dot-sep { color: #a0aec0; margin: 0 6px; }

.aq-btn-primary {
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, var(--aq-primary), var(--aq-primary-dark));
  box-shadow: 0 10px 22px rgba(43,182,115,.24);
  border-radius: 12px;
  font-weight: 700;
  padding: 10px 16px;
}

.aq-btn-primary:hover { color:#fff; filter: brightness(.98); transform: translateY(-1px); }

.aq-btn-soft {
  border: 1px solid #d5e4dd;
  color: #245545;
  background: #fff;
  border-radius: 12px;
  font-weight: 700;
  padding: 10px 16px;
}

.aq-btn-soft:hover { background: var(--aq-soft); color: var(--aq-primary-dark); }

.aq-alert {
  border-radius: 16px;
  padding: 14px 16px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  margin-bottom: 18px;
}

.aq-mode-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--aq-border);
  padding: 10px;
  border-radius: 18px;
  box-shadow: 0 10px 25px rgba(16,24,40,.05);
}

.aq-mode-btn {
  border: 0;
  background: transparent;
  color: #475569;
  border-radius: 13px;
  padding: 11px 16px;
  font-weight: 800;
  transition: .18s ease;
}

.aq-mode-btn:hover { background: #f7faf9; color: var(--aq-primary-dark); }
.aq-mode-btn.active {
  color: #fff;
  background: linear-gradient(135deg, var(--aq-primary), var(--aq-primary-dark));
  box-shadow: 0 8px 18px rgba(43,182,115,.22);
}

.aq-panel { display: none; }
.aq-panel.active { display: block; }

.aq-stat-card,
.aq-card,
.aq-legend-card,
.aq-info-note {
  background: #fff;
  border: 1px solid var(--aq-border);
  border-radius: var(--aq-radius);
  box-shadow: 0 10px 24px rgba(16,24,40,.055);
}

.aq-stat-card {
  padding: 20px;
  min-height: 142px;
  position: relative;
  overflow: hidden;
}

.aq-stat-card:after {
  content: "";
  position: absolute;
  width: 82px;
  height: 82px;
  right: -24px;
  top: -24px;
  border-radius: 999px;
  background: rgba(43,182,115,.10);
}

.aq-stat-label {
  color: var(--aq-muted);
  font-weight: 700;
  font-size: .95rem;
}

.aq-stat-value {
  font-size: 2.35rem;
  line-height: 1.05;
  font-weight: 900;
  color: #153b2d;
  margin-top: 9px;
}

.aq-stat-text {
  font-size: 1.45rem;
  line-height: 1.2;
}

.aq-stat-unit {
  color: var(--aq-muted);
  margin-top: 8px;
  font-size: .92rem;
}

.aq-status-pill,
.aq-level-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 7px 12px;
  color: #fff;
  font-weight: 800;
  min-width: 80px;
  box-shadow: inset 0 -1px 0 rgba(0,0,0,.10);
}

.aq-status-card .aq-status-pill {
  margin-top: 12px;
  font-size: 1rem;
}

.aq-legend-card {
  padding: 14px 16px;
}

.aq-legend-title {
  font-weight: 900;
  color: #173b2e;
  margin-bottom: 10px;
}

.aq-legend-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  color: #475569;
  font-size: .92rem;
}

.aq-legend-list span { display:inline-flex; align-items:center; gap:7px; }
.aq-legend-list i {
  width: 12px;
  height: 12px;
  border-radius: 99px;
  display: inline-block;
  box-shadow: 0 0 0 3px rgba(0,0,0,.04);
}

.aq-card {
  padding: 18px;
}

.aq-card-header {
  margin-bottom: 14px;
}

.aq-card-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.aq-card-header h3 {
  font-size: 1.12rem;
  margin: 0 0 4px;
  color: #173b2e;
  font-weight: 900;
}

.aq-card-header p {
  color: var(--aq-muted);
  margin: 0;
  font-size: .92rem;
}

.aq-map {
  width: 100%;
  height: 520px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #dce7e2;
  background: #eef5f2;
}

.aq-chart-wrap {
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.aq-filter-row {
  margin-bottom: 12px;
}

.aq-filter-row .form-control {
  border-radius: 12px;
  border-color: #d6e4de;
  min-height: 42px;
}

.aq-table {
  border-collapse: separate;
  border-spacing: 0;
}

.aq-table thead th {
  background: #f8faf9;
  color: #334155;
  font-weight: 900;
  border-top: 0;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}

.aq-table tbody td {
  vertical-align: middle;
  color: #263238;
  border-top: 1px solid #eef2f7;
}

.aq-station-name,
.aq-district-name {
  font-weight: 900;
  color: #173b2e;
}

.aq-small-muted {
  display: block;
  color: #718096;
  font-size: .82rem;
  margin-top: 2px;
}

.aq-info-note {
  padding: 14px 16px;
  background: #f7fbff;
  border-color: #dbeafe;
  color: #1e3a8a;
  line-height: 1.65;
}

.aq-ranking-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.aq-rank-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid #edf2f7;
  background: #fbfdfc;
}

.aq-rank-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.aq-rank-no {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e8f7ef;
  color: var(--aq-primary-dark);
  font-weight: 900;
  flex: 0 0 auto;
}
.aq-rank-name { font-weight: 900; color: #173b2e; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aq-rank-station { color: var(--aq-muted); font-size:.82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 190px; }
.aq-rank-value { font-weight: 900; color:#111827; text-align:right; white-space:nowrap; }

.aq-marker-wrapper,
.aq-district-marker-wrapper { background: transparent; border:0; }
.aq-marker-dot {
  display:block;
  width:18px;
  height:18px;
  border-radius:999px;
  border:3px solid #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,.26);
}
.aq-district-marker {
  display:flex;
  align-items:center;
  justify-content:center;
  min-width:34px;
  height:34px;
  padding:0 8px;
  border-radius:999px;
  border:3px solid #fff;
  color:#fff;
  font-weight:900;
  font-size:.78rem;
  box-shadow: 0 5px 14px rgba(0,0,0,.25);
}

.aq-popup-title { font-weight:900; color:#153b2d; margin-bottom:4px; }
.aq-popup-row { margin: 2px 0; color:#334155; }
.aq-popup-row strong { color:#111827; }

@media (max-width: 991px) {
  .aq-map { height: 420px; }
  .aq-card-header-flex { flex-direction: column; }
  .aq-btn-primary, .aq-btn-soft { width: 100%; margin-bottom: 8px; }
}

@media (max-width: 575px) {
  .aq-hero { padding: 20px; border-radius: 20px; }
  .aq-title { font-size: 1.35rem; }
  .aq-mode-tabs { display:grid; grid-template-columns: 1fr; }
  .aq-mode-btn { width:100%; }
  .aq-stat-value { font-size: 2rem; }
  .aq-map { height: 360px; }
  .aq-legend-list { flex-direction: column; gap: 8px; }
}

@media print {
  .breadcumb-wrapper,
  .aq-mode-tabs,
  .aq-btn-primary,
  .aq-btn-soft,
  .aq-filter-row { display:none !important; }
  .aq-section { background:#fff; }
  .aq-card,
  .aq-stat-card,
  .aq-hero { box-shadow:none; border-color:#ddd; }
  .aq-map { height: 360px; }
}
