/* ===================================================================
   Full modified AQI CSS — Modern, smooth, premium UI
   - Uses your brand colors: --primary: #154360, --accent: #D90000
   - Smooth transitions, glassy cards, subtle motion and accessible focus
   - Drop this file over your existing css/aqi-uttarakhand.css
   =================================================================== */

/* =========================
   Theme variables
   ========================= */
:root{
  --primary: #154360; /* brand */
  --accent: #D90000;  /* brand accent */
  --aqi-good: #16a34a;
  --aqi-moderate: #f59e0b;
  --aqi-unhealthy-sensitive: #f97316;
  --aqi-unhealthy: #ef4444;
  --aqi-very-unhealthy: #7c1d6f;

  --bg: #ffffff;
  --muted: #697787;
  --border: #e6e9ee;
  --shadow: 0 8px 26px rgba(20,35,50,0.06);
  --shadow-hover: 0 28px 60px rgba(20,35,50,0.10);
  --glass: rgba(255,255,255,0.6);
  --radius: 18px;
  --focus-ring: 0 0 0 5px rgba(21,67,96,0.12);
  --transition-fast: 260ms cubic-bezier(.2,.9,.2,1);
  --transition-smooth: 420ms cubic-bezier(.22,.8,.25,1);
}

/* =========================
   Layout helpers
   ========================= */
.main-container { max-width:1200px; margin:0 auto; padding:0 1rem; }
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  align-items: stretch;
}

/* =========================
   MODERN AQI CARD — CLEAN & SMOOTH
   ========================= */
.aqi-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;

  /* glass + soft background */
  background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(250,251,253,0.88));
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);

  border-radius: var(--radius);
  padding: 1.05rem 1.1rem;
  min-height: 150px;

  /* soft elevation */
  border: 1px solid rgba(255,255,255,0.6);
  box-shadow: var(--shadow);
  will-change: transform, box-shadow;
  transition: transform var(--transition-smooth), box-shadow var(--transition-smooth), background var(--transition-fast);
  cursor: pointer;
  overflow: hidden;
  outline: none;
}

/* accent glow (brand red) - subtle */
.aqi-card::before{
  content: "";
  position: absolute;
  right: -30%;
  top: -10%;
  width: 220px;
  height: 120px;
  background: radial-gradient(closest-side, rgba(217,9,0,0.12), transparent 45%);
  filter: blur(12px);
  opacity: 0;
  transition: opacity 420ms ease;
  pointer-events: none;
  transform: translateZ(0);
}

/* hover/focus interactions */
.aqi-card:hover,
.aqi-card:focus-within {
  transform: translateY(-10px) scale(1.01);
  box-shadow: var(--shadow-hover);
}
.aqi-card:hover::before { opacity: 1; }

/* pressed feedback */
.aqi-card:active {
  transform: translateY(-4px) scale(0.995);
  transition-duration: 160ms;
}

/* keyboard focus */
.aqi-card:focus {
  box-shadow: var(--focus-ring);
}

/* header: district + meta */
.aqi-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.6rem;
}

/* district title */
.aqi-district {
  font-size: 1.06rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.2px;
  line-height: 1.12;
}

/* meta small text (source + updated) */
.aqi-meta {
  display:flex;
  gap:0.6rem;
  align-items:center;
  color:var(--muted);
  font-size:0.9rem;
  margin-top:2px;
}

/* central content row */
.aqi-main {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:1rem;
  width:100%;
}

/* AQI badge (hero number) */
.aqi-badge-large {
  font-size: 1.55rem;
  font-weight: 800;
  padding: 0.42rem 0.9rem;
  border-radius: 14px;
  color: #fff;
  min-width:84px;
  text-align:center;
  letter-spacing: -0.6px;

  box-shadow:
    0 10px 30px rgba(21,67,96,0.10),
    inset 0 1px 0 rgba(255,255,255,0.25);

  transition: transform 360ms cubic-bezier(.22,.8,.25,1), box-shadow 360ms;
  transform-origin: center;
}

.aqi-card:hover .aqi-badge-large { transform: scale(1.08); }

/* color mapping for AQI badge */
.aqi-badge-large.good { background: var(--aqi-good); color: #fff; }
.aqi-badge-large.moderate { background: var(--aqi-moderate); color: #111; }
.aqi-badge-large.unhealthy-sensitive { background: var(--aqi-unhealthy-sensitive); color: #111; }
.aqi-badge-large.unhealthy { background: var(--aqi-unhealthy); color: #fff; }
.aqi-badge-large.very-unhealthy { background: var(--aqi-very-unhealthy); color: #fff; }

/* short description next to badge */
.aqi-desc {
  font-size: 0.94rem;
  color: var(--muted);
  line-height: 1.28;
  min-width: 0;
}

/* dominant pollutant / note */
.aqi-note {
  margin-top: 6px;
  font-size: 0.88rem;
  color: var(--muted);
}

/* sparkline area (SVG) */
.aqi-spark {
  height: 44px;
  width: 100%;
  margin-top: 0.6rem;
  display: block;
  border-radius: 9px;
  overflow: hidden;
}
.aqi-spark rect {
  rx: 3;
  transition: height var(--transition-smooth), fill var(--transition-fast), opacity 300ms ease;
  opacity: 0.9;
}

/* legend rows */
.aqi-legend-row { display:flex; align-items:center; gap:0.5rem; font-size:0.95rem; color:var(--muted); margin:0.45rem 0; }
.aqi-badge[data-aqi] { width:18px; height:18px; display:inline-block; border-radius:6px; margin-right:8px; box-shadow: 0 2px 8px rgba(10,10,10,0.04); }

/* legend colors */
.aqi-badge[data-aqi="good"] { background: var(--aqi-good); }
.aqi-badge[data-aqi="moderate"] { background: var(--aqi-moderate); }
.aqi-badge[data-aqi="unhealthy-sensitive"] { background: var(--aqi-unhealthy-sensitive); }
.aqi-badge[data-aqi="unhealthy"] { background: var(--aqi-unhealthy); }
.aqi-badge[data-aqi="very-unhealthy"] { background: var(--aqi-very-unhealthy); }

/* =========================
   District filter pills (match modern card)
   ========================= */
.district-filter {
  padding:0.45rem 0.9rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.9);
  border: 1px solid var(--border);
  cursor:pointer;
  font-weight:700;
  color:var(--primary);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
  box-shadow: 0 6px 18px rgba(21,67,96,0.04);
  font-size: 0.92rem;
}
.district-filter:hover { transform: translateY(-4px); }
.district-filter:focus { outline: none; box-shadow: var(--focus-ring); }

/* active pill uses brand color */
.district-filter.active {
  background: linear-gradient(180deg, var(--primary), rgba(21,67,96,0.9));
  color: #fff;
  border-color: rgba(255,255,255,0.06);
  box-shadow: 0 18px 50px rgba(21,67,96,0.14);
}

/* =========================
   Insight Modal (keeps polished look)
   ========================= */
.aqi-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8,10,14,0.44);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1.25rem;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.aqi-modal {
  width: min(920px, 96%);
  max-height: 92vh;
  overflow: auto;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(250,250,252,0.98));
  border-radius: 14px;
  box-shadow: 0 26px 80px rgba(10,20,30,0.6);
  padding: 1rem 1.25rem 1.25rem;
  position: relative;
  color: var(--primary);
  transform-origin: center;
  animation: modal-in 220ms cubic-bezier(.2,.9,.2,1);
  border: 1px solid rgba(255,255,255,0.45);
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close {
  position: absolute;
  right: 12px;
  top: 10px;
  border: none;
  background: transparent;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
  transition: color var(--transition-fast), transform var(--transition-fast);
}
.modal-close:hover { color: var(--primary); transform: rotate(10deg); }

.aqi-modal-head {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.6rem;
  margin-bottom: 0.6rem;
}
.aqi-modal-head h2 {
  font-size:1.14rem;
  margin:0;
  color:var(--primary);
  font-weight:700;
}

.modal-badges { text-align:right; min-width:140px; }
.modal-aqi-value {
  display:inline-block;
  font-weight:800;
  font-size:1.6rem;
  padding:0.45rem 0.75rem;
  border-radius:10px;
  color:#fff;
  box-shadow: 0 10px 32px rgba(10,20,30,0.16);
}

/* modal aqi colors */
.modal-aqi-value.good { background: var(--aqi-good); }
.modal-aqi-value.moderate { background: var(--aqi-moderate); color:#111; }
.modal-aqi-value.unhealthy-sensitive { background: var(--aqi-unhealthy-sensitive); color:#111; }
.modal-aqi-value.unhealthy { background: var(--aqi-unhealthy); }
.modal-aqi-value.very-unhealthy { background: var(--aqi-very-unhealthy); }

.modal-class { font-size:0.95rem; color:var(--muted); margin-top:6px; }
.aqi-modal-body { padding:0.6rem 0; color: #273444; }

.modal-row { display:flex; gap:0.9rem; flex-wrap:wrap; margin-bottom:0.6rem; }
.modal-block {
  flex:1;
  min-width:180px;
  background: linear-gradient(180deg, rgba(250,250,252,1), rgba(255,255,255,1));
  padding:0.75rem;
  border-radius:10px;
  border: 1px solid var(--border);
  box-shadow: 0 8px 26px rgba(20,35,50,0.04);
}
.modal-block h4 { margin:0 0 0.35rem 0; font-size:0.95rem; color:var(--primary); }

.modal-section { margin-top:0.7rem; }
.components-grid { display:grid; grid-template-columns: repeat(auto-fit,minmax(140px,1fr)); gap:0.5rem; margin-top:0.35rem; }
.comp-row {
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:0.5rem;
  border-radius:8px;
  background: linear-gradient(180deg, #fff, #fbfbfd);
  border: 1px solid var(--border);
  font-size:0.95rem;
  color: #233244;
}
.comp-name { font-size:0.93rem; color:var(--muted); }
.comp-val { font-weight:700; color:var(--primary); }

.advice-list { margin:0.35rem 0 0 1.1rem; color:var(--primary); }

.aqi-modal-foot { display:flex; justify-content:flex-end; margin-top:0.9rem; gap:0.6rem; }
.btn { padding:0.56rem 0.95rem; border-radius:10px; border:none; cursor:pointer; font-weight:700; }
.btn-close { background:var(--primary); color:#fff; box-shadow: 0 10px 36px rgba(21,67,96,0.14); }

/* =========================
   Accessibility & small tweaks
   ========================= */
.hindi-text { font-family: "Noto Sans Devanagari", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial; }

/* focus helpers */
.district-filter:focus, .btn:focus, .modal-close:focus, .btn-close:focus, .aqi-card:focus { outline: none; box-shadow: var(--focus-ring); }

/* ensure readable text for yellow badge */
.aqi-badge-large.moderate, .modal-aqi-value.moderate { color: #111; }

/* mobile tweaks */
@media (max-width: 768px) {
  .news-grid { grid-template-columns: 1fr; }
  .aqi-card { padding: 0.9rem; border-radius: 14px; min-height: 130px; }
  .aqi-badge-large { font-size: 1.35rem; padding: 0.36rem 0.72rem; border-radius: 12px; }
  .aqi-spark { height: 36px; }
  .modal-row { flex-direction: column; }
  .aqi-modal { padding: 0.85rem; }
}

/* optional: gentle entrance for cards (plays once on load) */
.aqi-card {
  opacity: 0;
  transform: translateY(8px) scale(0.998);
  animation: card-pop 420ms cubic-bezier(.2,.9,.2,1) forwards;
}
@keyframes card-pop {
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* end of stylesheet */
