/* ==========================================================
   DELHI ELECTION 2025 DASHBOARD - MODERN DESIGN SYSTEM
   ========================================================== */

:root {
  --bg-dark: #090d16;
  --bg-card: rgba(17, 24, 39, 0.75);
  --bg-card-hover: rgba(26, 36, 56, 0.85);
  --bg-surface: #111827;
  --border-card: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(255, 153, 51, 0.4);

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  /* Party Theming */
  --bjp-orange: #ff9933;
  --bjp-gradient: linear-gradient(135deg, #ff9933 0%, #ea580c 100%);
  --bjp-glow: rgba(255, 153, 51, 0.25);

  --aap-blue: #00a3e0;
  --aap-gradient: linear-gradient(135deg, #00a3e0 0%, #0284c7 100%);
  --aap-glow: rgba(0, 163, 224, 0.25);

  --inc-green: #22c55e;
  --inc-gradient: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  --inc-glow: rgba(34, 197, 94, 0.2);

  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reset & Global */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-dark);
  color: var(--text-main);
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(255, 153, 51, 0.06) 0%, transparent 40%),
    radial-gradient(circle at 85% 20%, rgba(0, 163, 224, 0.06) 0%, transparent 40%),
    radial-gradient(circle at 50% 80%, rgba(30, 41, 59, 0.4) 0%, transparent 50%);
  background-attachment: fixed;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* Typography Helpers */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  letter-spacing: -0.02em;
}

/* Navbar */
.navbar {
  background: rgba(9, 13, 22, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-card);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 0.85rem 1.5rem;
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.eci-logo {
  height: 48px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
}

.brand-badge {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--bjp-orange);
}

.brand h1 {
  font-size: 1.45rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.15;
}

.brand h1 span {
  color: var(--aap-blue);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: #4ade80;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.live-dot {
  width: 8px;
  height: 8px;
  background-color: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 10px #22c55e;
  animation: pulseDot 1.8s infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.api-link-badge {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 0.38rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition-fast);
}

.api-link-badge:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.3);
}

/* Sub-Navigation Tabs */
.sub-nav {
  background: rgba(13, 19, 33, 0.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-card);
  position: sticky;
  top: 70px;
  z-index: 900;
}

.tabs-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0.35rem 1.5rem;
  gap: 0.5rem;
}

.tabs-container::-webkit-scrollbar {
  display: none;
}

.nav-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.65rem 1.15rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.nav-tab:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.nav-tab.active {
  color: #fff;
  background: rgba(255, 153, 51, 0.15);
  border: 1px solid rgba(255, 153, 51, 0.35);
  box-shadow: 0 4px 12px rgba(255, 153, 51, 0.15);
}

/* Main Content */
.main-content {
  max-width: 1400px;
  margin: 1.5rem auto 4rem auto;
  padding: 0 1.5rem;
}

/* Tab panes */
.tab-pane {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-pane.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Common Card */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.36);
  position: relative;
  overflow: hidden;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.25rem;
}

.card-header h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
}

.card-header p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.card-badge {
  font-size: 0.75rem;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  font-weight: 600;
}

.badge-warning {
  background: rgba(234, 179, 8, 0.15);
  color: #facc15;
  border: 1px solid rgba(234, 179, 8, 0.3);
}

.badge-success {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

/* Hero Section */
.hero-section {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

/* Majority Benchmark Card */
.majority-card {
  background: linear-gradient(135deg, rgba(20, 27, 45, 0.95), rgba(11, 16, 28, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.majority-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.majority-title h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
}

.majority-title p {
  color: var(--text-muted);
  font-size: 0.88rem;
}

.highlight-text {
  color: #e2e8f0;
}

.majority-verdict {
  padding: 0.4rem 1rem;
  border-radius: 9999px;
  font-size: 0.88rem;
  font-weight: 600;
}

.verdict-bjp {
  background: rgba(255, 153, 51, 0.15);
  border: 1px solid rgba(255, 153, 51, 0.4);
  color: #ff9933;
}

.majority-bar-wrapper {
  position: relative;
  padding-bottom: 1.5rem;
}

.majority-bar {
  height: 38px;
  background: #1e293b;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.bar-segment {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
  transition: width 0.8s ease;
}

.bjp-bar {
  background: var(--bjp-gradient);
}

.aap-bar {
  background: var(--aap-gradient);
}

.majority-marker {
  position: absolute;
  top: -6px;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}

.marker-line {
  width: 2px;
  height: 50px;
  background: #fff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

.marker-text {
  margin-top: 2px;
  font-size: 0.75rem;
  font-weight: 700;
  background: #fff;
  color: #0f172a;
  padding: 2px 6px;
  border-radius: 4px;
}

/* Showdown Grid */
.showdown-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
}

.leader-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.leader-card:hover {
  transform: translateY(-4px);
}

.bjp-glow:hover {
  box-shadow: 0 12px 36px var(--bjp-glow);
  border-color: rgba(255, 153, 51, 0.4);
}

.aap-glow:hover {
  box-shadow: 0 12px 36px var(--aap-glow);
  border-color: rgba(0, 163, 224, 0.4);
}

.inc-glow:hover {
  box-shadow: 0 12px 36px var(--inc-glow);
  border-color: rgba(34, 197, 94, 0.4);
}

.party-stripe {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}

.bjp-stripe { background: var(--bjp-gradient); }
.aap-stripe { background: var(--aap-gradient); }
.inc-stripe { background: var(--inc-gradient); }

.leader-content {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.leader-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.leader-avatar {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.25rem;
  color: #fff;
}

.inc-bg {
  background: #166534;
}

.party-tag {
  position: absolute;
  bottom: -4px;
  right: -4px;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 9999px;
  color: #fff;
  border: 2px solid var(--bg-dark);
}

.bjp-tag { background: #ea580c; }
.aap-tag { background: #0284c7; }
.inc-tag { background: #16a34a; }

.leader-details {
  flex: 1;
}

.party-name {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

.seat-tally {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin: 0.2rem 0 0.6rem 0;
}

.seat-number {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1;
}

.bjp-color { color: var(--bjp-orange); }
.aap-color { color: var(--aap-blue); }
.inc-color { color: var(--inc-green); }

.seat-sub {
  font-size: 0.85rem;
  color: #cbd5e1;
  font-weight: 500;
}

.stats-row {
  display: flex;
  gap: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 0.6rem;
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 600;
}

.stat-val {
  font-size: 0.95rem;
  font-weight: 700;
  color: #f1f5f9;
}

/* KPI Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.kpi-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: transform var(--transition-fast);
}

.kpi-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.16);
}

.kpi-icon {
  font-size: 1.8rem;
  background: rgba(255, 255, 255, 0.05);
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.kpi-title {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

.kpi-number {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.55rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
}

.kpi-sub {
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* Analytics Charts Row */
.analytics-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.chart-card {
  min-height: 380px;
  display: flex;
  flex-direction: column;
}

.chart-wrapper {
  position: relative;
  flex: 1;
  width: 100%;
  min-height: 250px;
}

.chart-summary-pills {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.pill {
  padding: 0.4rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 500;
}

.bjp-pill { background: rgba(255, 153, 51, 0.15); color: #ff9933; border: 1px solid rgba(255, 153, 51, 0.3); }
.aap-pill { background: rgba(0, 163, 224, 0.15); color: #00a3e0; border: 1px solid rgba(0, 163, 224, 0.3); }
.inc-pill { background: rgba(34, 197, 94, 0.15); color: #22c55e; border: 1px solid rgba(34, 197, 94, 0.3); }

.vote-diff-note {
  margin-top: 1rem;
  padding: 0.65rem 1rem;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.vote-diff-note strong {
  color: #fff;
}

/* Margin Extremes */
.margins-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(460px, 1fr));
  gap: 1.5rem;
}

/* Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.styled-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  text-align: left;
}

.styled-table th {
  padding: 0.75rem 1rem;
  color: var(--text-dim);
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 700;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.styled-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
}

.styled-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.margin-val {
  font-weight: 700;
}

.margin-val.landslide { color: #4ade80; }
.margin-val.razor { color: #f87171; }

/* Constituencies Explorer */
.explorer-controls-card {
  margin-bottom: 1.5rem;
}

.controls-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}

.search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 280px;
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
}

.search-input-wrap input {
  width: 100%;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem 0.75rem 2.75rem;
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
  transition: border-color var(--transition-fast);
}

.search-input-wrap input:focus {
  border-color: var(--bjp-orange);
  box-shadow: 0 0 0 3px rgba(255, 153, 51, 0.2);
}

.filters-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.filter-group label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
}

.filter-group select {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
}

.filter-group select:focus {
  border-color: var(--aap-blue);
}

.pill-filters {
  display: flex;
  gap: 0.35rem;
}

.pill-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  padding: 0.45rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.pill-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.pill-btn.active {
  background: #fff;
  color: #0f172a;
  border-color: #fff;
}

.pill-btn.bjp-btn.active {
  background: var(--bjp-gradient);
  color: #fff;
  border-color: #ff9933;
}

.pill-btn.aap-btn.active {
  background: var(--aap-gradient);
  color: #fff;
  border-color: #00a3e0;
}

.filter-status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.85rem;
  color: var(--text-dim);
}

.reset-btn {
  background: transparent;
  border: none;
  color: var(--bjp-orange);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: underline;
}

/* Constituencies Grid */
.constituencies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.ac-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  cursor: pointer;
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.ac-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  border-color: rgba(255, 255, 255, 0.18);
}

.ac-card.bjp-won {
  border-left: 4px solid var(--bjp-orange);
}

.ac-card.aap-won {
  border-left: 4px solid var(--aap-blue);
}

.ac-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.ac-meta {
  display: flex;
  flex-direction: column;
}

.ac-number {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-dim);
}

.ac-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
}

.pc-badge {
  font-size: 0.68rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 2px;
  display: inline-block;
  max-width: fit-content;
}

.winner-badge {
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.bjp-badge { background: rgba(255, 153, 51, 0.18); color: #ff9933; border: 1px solid rgba(255, 153, 51, 0.35); }
.aap-badge { background: rgba(0, 163, 224, 0.18); color: #00a3e0; border: 1px solid rgba(0, 163, 224, 0.35); }

.ac-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin: 0.5rem 0;
}

.candidate-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
}

.candidate-name {
  font-weight: 600;
  color: #f1f5f9;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.candidate-role {
  font-size: 0.68rem;
  padding: 1px 4px;
  border-radius: 3px;
  font-weight: 700;
}

.winner-role { background: rgba(34, 197, 94, 0.2); color: #4ade80; }
.runner-role { background: rgba(255, 255, 255, 0.08); color: var(--text-dim); }

.candidate-votes {
  font-weight: 700;
  color: #e2e8f0;
}

.margin-bar-container {
  margin-top: 0.25rem;
}

.margin-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 0.2rem;
}

.margin-bar-bg {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  overflow: hidden;
}

.margin-bar-fill {
  height: 100%;
  border-radius: 9999px;
}

.ac-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.view-details-link {
  color: var(--aap-blue);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

/* Key VIP Battles Grid */
.section-intro {
  margin-bottom: 1.5rem;
}

.section-intro h2 {
  font-size: 1.6rem;
  color: #fff;
  font-weight: 800;
}

.section-intro p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.vip-battles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 1.5rem;
}

.vip-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  position: relative;
  overflow: hidden;
}

.vip-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.25rem;
}

.vip-constituency {
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
}

.vip-badge {
  background: rgba(234, 179, 8, 0.15);
  color: #facc15;
  border: 1px solid rgba(234, 179, 8, 0.35);
  font-size: 0.75rem;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-weight: 700;
}

.duel-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 1rem 0;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.6);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.combatant {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.combatant.winner {
  text-align: left;
}

.combatant.runner {
  text-align: right;
}

.c-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.c-party {
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 2px;
}

.c-votes {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: #f8fafc;
  margin-top: 4px;
}

.vs-badge {
  width: 34px;
  height: 34px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-dim);
  flex-shrink: 0;
}

.vip-verdict-box {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

.vip-bjp-win {
  background: rgba(255, 153, 51, 0.12);
  border: 1px solid rgba(255, 153, 51, 0.3);
  color: #ff9933;
}

.vip-aap-win {
  background: rgba(0, 163, 224, 0.12);
  border: 1px solid rgba(0, 163, 224, 0.3);
  color: #00a3e0;
}

/* Map Card */
.map-card {
  padding: 1.5rem;
}

.delhi-map-container {
  height: 600px;
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
  background: #0f172a;
}

.map-legend {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 4px;
}

.bjp-bg { background: var(--bjp-orange); }
.aap-bg { background: var(--aap-blue); }

/* Demographics PC Cards */
.pc-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1.25rem;
}

.pc-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.pc-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.pc-title h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
}

.pc-title span {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.pc-seats-split {
  display: flex;
  gap: 0.5rem;
}

.split-pill {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
}

.pc-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin: 0.75rem 0;
  background: rgba(15, 23, 42, 0.5);
  padding: 0.75rem;
  border-radius: var(--radius-sm);
}

.pc-mini-stat {
  display: flex;
  flex-direction: column;
}

.pc-mini-label {
  font-size: 0.68rem;
  color: var(--text-dim);
  text-transform: uppercase;
}

.pc-mini-val {
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
}

/* API Docs Section */
.api-docs-card {
  padding: 2rem;
}

.api-endpoints-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.endpoint-item {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
}

.endpoint-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.http-method {
  background: #16a34a;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
}

.endpoint-header code {
  font-family: monospace;
  font-size: 0.95rem;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.08);
  padding: 3px 8px;
  border-radius: 4px;
}

.test-api-btn {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.test-api-btn:hover {
  background: var(--aap-blue);
  border-color: var(--aap-blue);
}

.endpoint-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.api-console {
  background: #020617;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.api-console-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 1rem;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.8rem;
  color: var(--text-dim);
}

.copy-json-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
}

.api-console pre {
  padding: 1rem;
  max-height: 280px;
  overflow-y: auto;
  font-family: monospace;
  font-size: 0.82rem;
  color: #4ade80;
  margin: 0;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-backdrop.open {
  display: flex;
}

.modal-card {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 800px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.modal-subtitle {
  font-size: 0.78rem;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 700;
}

.modal-header h2 {
  font-size: 1.45rem;
  color: #fff;
  margin-top: 0.2rem;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.modal-close-btn:hover {
  color: #fff;
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
}

.modal-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.modal-stat {
  display: flex;
  flex-direction: column;
}

.m-label {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-transform: uppercase;
}

.m-val {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}

.winner-text {
  color: #facc15;
}

.candidates-heading {
  font-size: 1rem;
  color: #fff;
  margin-bottom: 0.75rem;
  font-weight: 700;
}

.modal-table th {
  background: rgba(0, 0, 0, 0.2);
}

/* Footer */
.footer {
  border-top: 1px solid var(--border-card);
  padding: 2.5rem 1.5rem;
  text-align: center;
  background: rgba(9, 13, 22, 0.95);
  color: var(--text-muted);
}

.footer-container {
  max-width: 1400px;
  margin: 0 auto;
}

.footer-sub {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 0.35rem;
}

.mt-4 { margin-top: 1.5rem; }

/* Responsive adjustments */
@media (max-width: 768px) {
  .navbar { padding: 0.75rem 1rem; }
  .brand h1 { font-size: 1.15rem; }
  .eci-logo { height: 38px; }
  .main-content { padding: 0 1rem; margin-top: 1rem; }
  .analytics-row, .margins-grid { grid-template-columns: 1fr; }
  .showdown-grid { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .controls-row { flex-direction: column; align-items: stretch; }
  .delhi-map-container { height: 420px; }
}

@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .leader-content { flex-direction: column; text-align: center; }
  .leader-avatar-wrap { margin-bottom: 0.5rem; }
  .stats-row { justify-content: center; }
}
