/* ============================================================
   AIN Geographic Overview — region/city/site rollup styling
   Prefix: .geo-
   Theme: green/teal (geographic, mapping connotations) with
   warm warnings for unhealthy regions.
   ============================================================ */

.geo-root {
  /* No `position` — let .scr position us. */
  padding: 18px 22px 32px;
  color: #d4d4d4;
}
.geo-root > * + * { margin-top: 16px; }

/* ── Background ─────────────────────────────────────────── */
.geo-bg-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(16, 185, 129, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 185, 129, 0.04) 1px, transparent 1px);
  background-size: 50px 50px;
  pointer-events: none; z-index: 0;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 0%, transparent 80%);
}
.geo-bg-glow {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 40% at 25% 20%, rgba(16, 185, 129, 0.10), transparent 60%),
    radial-gradient(ellipse 60% 40% at 75% 80%, rgba(6, 182, 212, 0.08), transparent 60%);
  pointer-events: none; z-index: 0;
  animation: geo-glow-shift 18s ease-in-out infinite alternate;
}
@keyframes geo-glow-shift {
  0%   { opacity: 0.7; transform: translate(0, 0); }
  100% { opacity: 1;   transform: translate(2%, -2%); }
}
.geo-root > * { position: relative; z-index: 1; }

/* ── Header ─────────────────────────────────────────────── */
.geo-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 22px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.7), rgba(20, 30, 50, 0.5));
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 8px;
  backdrop-filter: blur(14px);
  position: relative; overflow: hidden;
}
.geo-header::before {
  content: '';
  position: absolute; top: 0; left: -100%; width: 100%; height: 1px;
  background: linear-gradient(90deg, transparent, #10B981, #06B6D4, transparent);
  animation: geo-sweep 4s ease-in-out infinite;
}
@keyframes geo-sweep {
  0%, 100% { left: -100%; }
  50%      { left: 100%; }
}
.geo-title {
  font-size: 18px; font-weight: 800; letter-spacing: 4px;
  background: linear-gradient(135deg, #fff, #6EE7B7, #67e8f9);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 26px rgba(16, 185, 129, 0.4);
}
.geo-subtitle {
  font-size: 10px; color: #6b7280;
  letter-spacing: 1.5px; margin-top: 4px;
}
.geo-pill {
  padding: 6px 12px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 4px;
  font-size: 11px; color: #6EE7B7;
  letter-spacing: 1px; font-weight: 600;
}

/* ── KPI Cards ──────────────────────────────────────────── */
.geo-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.geo-kpi-card {
  position: relative;
  display: flex; align-items: center; gap: 14px;
  padding: 18px 20px;
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.85), rgba(20, 30, 50, 0.7));
  border: 1px solid rgba(16, 185, 129, 0.18);
  border-radius: 8px;
  overflow: hidden;
  backdrop-filter: blur(10px);
  animation: geo-slide-up 0.5s cubic-bezier(0.4, 0, 0.2, 1) backwards;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.geo-kpi-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.7;
}
.geo-kpi-card::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at top right, var(--accent), transparent 60%);
  opacity: 0.06; pointer-events: none;
}
.geo-kpi-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 8px 28px var(--accent)33;
}
.geo-kpi-icon {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--accent);
  border-radius: 6px;
  font-size: 22px;
  flex-shrink: 0;
}
.geo-kpi-body { flex: 1; min-width: 0; position: relative; z-index: 2; }
.geo-kpi-value {
  font-size: 36px; font-weight: 800;
  color: #fff; line-height: 1;
  text-shadow: 0 0 20px var(--accent);
  margin-bottom: 4px;
  font-feature-settings: 'tnum';
}
.geo-kpi-label {
  font-size: 9px; color: #6b7280;
  letter-spacing: 1.5px; font-weight: 600;
}
.geo-kpi-row .geo-kpi-card:nth-child(1) { animation-delay: 0.05s; }
.geo-kpi-row .geo-kpi-card:nth-child(2) { animation-delay: 0.10s; }
.geo-kpi-row .geo-kpi-card:nth-child(3) { animation-delay: 0.15s; }
.geo-kpi-row .geo-kpi-card:nth-child(4) { animation-delay: 0.20s; }

/* ── Sections (shared) ──────────────────────────────────── */
.geo-section {
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.8), rgba(20, 30, 50, 0.6));
  border: 1px solid rgba(16, 185, 129, 0.15);
  border-radius: 8px;
  padding: 14px 16px;
  backdrop-filter: blur(10px);
  position: relative; overflow: hidden;
  animation: geo-slide-up 0.5s cubic-bezier(0.4, 0, 0.2, 1) backwards;
  animation-delay: 0.25s;
}
.geo-section::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(16, 185, 129, 0.4), transparent);
}
.geo-section-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px; padding-bottom: 10px;
  border-bottom: 1px solid rgba(16, 185, 129, 0.1);
  flex-wrap: wrap; gap: 10px;
}
.geo-section-title {
  font-size: 11px; font-weight: 700;
  color: #6EE7B7; letter-spacing: 2px;
}
.geo-section-meta {
  font-size: 10px; color: #9ca3af;
}
.geo-empty {
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: #6b7280;
  padding: 30px;
  text-align: center;
}

/* ── Region cards ───────────────────────────────────────── */
.geo-region-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.geo-region-card {
  position: relative;
  padding: 16px 18px;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.35), rgba(20, 30, 50, 0.5));
  border: 1px solid rgba(16, 185, 129, 0.15);
  border-left: 3px solid var(--accent, #6B7280);
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  animation: geo-slide-up 0.5s ease backwards;
  overflow: hidden;
}
.geo-region-card::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at top right, var(--accent), transparent 70%);
  opacity: 0.05; pointer-events: none;
}
.geo-region-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 6px 24px var(--accent)44;
}
.geo-region-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
}
.geo-region-name {
  color: #fff; font-weight: 800; font-size: 14px;
  letter-spacing: 0.5px;
}
.geo-region-sub {
  color: #6EE7B7; font-size: 9px;
  letter-spacing: 0.5px; margin-top: 3px;
  font-weight: 600;
}
.geo-region-badge {
  padding: 3px 10px;
  border: 1px solid;
  border-radius: 12px;
  font-size: 9px; font-weight: 800;
  letter-spacing: 1.5px;
}
.geo-region-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
  position: relative;
  z-index: 2;
}
.geo-region-stat {
  text-align: center;
  padding: 8px 4px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 4px;
}
.geo-region-stat-num {
  font-size: 22px; font-weight: 800;
  color: #fff; line-height: 1;
}
.geo-region-stat-lbl {
  font-size: 8px; color: #6b7280;
  letter-spacing: 1.5px; margin-top: 4px;
}
.geo-region-bar-wrap {
  margin-bottom: 12px;
}
.geo-region-bar {
  display: flex;
  height: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 6px;
}
.geo-region-seg-up   { background: linear-gradient(90deg, #22C55E, #16a34a); box-shadow: 0 0 6px rgba(34, 197, 94, 0.5); transition: width .8s ease; }
.geo-region-seg-down { background: linear-gradient(90deg, #EF4444, #b91c1c); box-shadow: 0 0 6px rgba(239, 68, 68, 0.5); transition: width .8s ease; }
.geo-region-seg-unk  { background: rgba(107, 114, 128, 0.6); transition: width .8s ease; }
.geo-region-bar-meta {
  display: flex; gap: 12px;
  font-size: 9px; font-weight: 700;
  letter-spacing: 0.5px;
}
.geo-region-avail {
  display: flex; justify-content: space-between; align-items: baseline;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.geo-region-avail-num {
  font-size: 24px; font-weight: 800;
  text-shadow: 0 0 12px currentColor;
  font-feature-settings: 'tnum';
}
.geo-region-avail-lbl {
  font-size: 8px; color: #6b7280;
  letter-spacing: 1.5px;
}

/* ── City + Critical row ────────────────────────────────── */
.geo-row-2 {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 14px;
}

/* City list */
.geo-city-list { display: flex; flex-direction: column; gap: 6px; }
.geo-city-row {
  display: grid;
  grid-template-columns: 24px 1fr 1.5fr 90px;
  gap: 12px; align-items: center;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
  animation: geo-slide-right 0.4s ease backwards;
}
.geo-city-row:hover { background: rgba(16, 185, 129, 0.06); }
.geo-city-rank {
  text-align: center;
  font-weight: 800; color: #6EE7B7;
  font-family: monospace; font-size: 12px;
}
.geo-city-name { min-width: 0; }
.geo-city-title {
  color: #fff; font-weight: 600; font-size: 12px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.geo-city-region {
  color: #6b7280; font-size: 9px;
  letter-spacing: 0.5px; margin-top: 1px;
}
.geo-city-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px; overflow: hidden;
}
.geo-city-fill {
  height: 100%; border-radius: 4px;
  transition: width 0.6s ease;
}
.geo-city-counts {
  display: flex; flex-direction: column; align-items: flex-end;
  font-family: monospace;
}
.geo-city-total {
  color: #fff; font-weight: 800; font-size: 14px;
  line-height: 1;
}
.geo-city-avail {
  font-size: 10px; font-weight: 700;
  margin-top: 2px;
}

/* Critical sites */
.geo-critical-list { display: flex; flex-direction: column; gap: 6px; }
.geo-crit-row {
  display: grid;
  grid-template-columns: 32px 1fr 60px;
  gap: 10px; align-items: center;
  padding: 10px 12px;
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.10), rgba(255, 255, 255, 0.02));
  border-left: 2px solid #EF4444;
  border-radius: 0 4px 4px 0;
  cursor: pointer;
  transition: background 0.15s;
  animation: geo-slide-right 0.4s ease backwards;
}
.geo-crit-row:hover { background: linear-gradient(90deg, rgba(239, 68, 68, 0.18), rgba(255, 255, 255, 0.04)); }
.geo-crit-icon {
  font-size: 20px;
  text-align: center;
  filter: drop-shadow(0 0 4px #EF4444);
}
.geo-crit-name {
  color: #fff; font-weight: 700; font-size: 12px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 2px;
}
.geo-crit-meta {
  color: #9ca3af; font-size: 10px;
}
.geo-crit-down {
  text-align: center;
  padding: 6px 0;
  background: rgba(239, 68, 68, 0.15);
  border-radius: 4px;
}
.geo-crit-down-num {
  font-size: 18px; font-weight: 800;
  color: #fca5a5; line-height: 1;
  font-family: monospace;
}
.geo-crit-down-lbl {
  font-size: 8px; color: #fca5a5;
  letter-spacing: 1.5px; margin-top: 2px;
}

/* ── Site grid ──────────────────────────────────────────── */
.geo-site-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}
.geo-site-card {
  position: relative;
  padding: 12px 14px;
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.7), rgba(20, 30, 50, 0.5));
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-top: 2px solid var(--accent);
  border-radius: 4px;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
  animation: geo-fade-in 0.4s ease backwards;
}
.geo-site-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 4px 14px var(--accent)33;
}
.geo-site-card.geo-site-bad {
  background: linear-gradient(145deg, rgba(75, 25, 25, 0.5), rgba(20, 30, 50, 0.5));
  animation: geo-fade-in 0.4s ease backwards, geo-bad-pulse 2.5s ease-in-out infinite;
}
@keyframes geo-bad-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  50%      { box-shadow: 0 0 0 4px rgba(239, 68, 68, 0); }
}
.geo-site-status-dot {
  position: absolute;
  top: 12px; right: 12px;
  width: 8px; height: 8px;
  border-radius: 50%;
}
.geo-site-name {
  color: #fff; font-weight: 700; font-size: 12px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding-right: 14px;
  margin-bottom: 2px;
}
.geo-site-region {
  color: #6b7280; font-size: 9px;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.geo-site-counts {
  display: flex; align-items: center; gap: 4px;
  font-family: monospace; font-size: 12px;
  margin-bottom: 6px;
}
.geo-site-up    { color: #22C55E; font-weight: 800; }
.geo-site-sep   { color: #4b5563; }
.geo-site-total { color: #d4d4d4; font-weight: 600; }
.geo-site-down-pill {
  margin-left: auto;
  padding: 1px 6px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: 8px;
  color: #fca5a5;
  font-size: 9px; font-weight: 700;
}
.geo-site-avail {
  font-size: 14px; font-weight: 800;
  text-align: right;
  font-feature-settings: 'tnum';
  text-shadow: 0 0 8px currentColor;
}

/* ── Animations ─────────────────────────────────────────── */
@keyframes geo-slide-up {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes geo-slide-right {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes geo-fade-in {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 1280px) {
  .geo-kpi-row { grid-template-columns: repeat(2, 1fr); }
  .geo-row-2 { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .geo-kpi-row { grid-template-columns: 1fr; }
  .geo-region-grid { grid-template-columns: 1fr; }
  .geo-site-grid { grid-template-columns: repeat(2, 1fr); }
  .geo-header { flex-direction: column; gap: 8px; text-align: center; }
}