/* ============================================================
   WorldPop Counter — Main Stylesheet
   Design: Bold data-industrial with red/green dominance
   Font: Oswald (headings) + Source Sans 3 (body) + Share Tech Mono (numbers)
   ============================================================ */

:root {
  --red:        #C0392B;
  --red-dark:   #96281B;
  --red-light:  #E74C3C;
  --red-glow:   rgba(192, 57, 43, 0.25);
  --green:      #1A7A4A;
  --green-dark: #145C38;
  --green-light:#27AE60;
  --green-glow: rgba(26, 122, 74, 0.25);
  --black:      #0A0A0A;
  --dark:       #111111;
  --dark-2:     #1A1A1A;
  --dark-3:     #222222;
  --dark-4:     #2D2D2D;
  --gray:       #888888;
  --gray-light: #BBBBBB;
  --white:      #F5F5F5;
  --accent:     #F39C12;
  --font-head:  'Oswald', 'Impact', sans-serif;
  --font-body:  'Source Sans 3', 'Segoe UI', sans-serif;
  --font-mono:  'Share Tech Mono', 'Courier New', monospace;
  --radius:     4px;
  --radius-lg:  8px;
  --shadow:     0 4px 24px rgba(0,0,0,0.4);
  --transition: 0.2s ease;
}

/* -------- RESET -------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-body);
  background: var(--black);
  color: var(--white);
  line-height: 1.6;
  overflow-x: hidden;
}
a { color: var(--green-light); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--red-light); }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }
button { cursor: pointer; font-family: var(--font-body); }

/* -------- SKIP NAV (a11y) -------- */
.skip-nav {
  position: absolute; top: -100px; left: 0; z-index: 9999;
  background: var(--red); color: #fff; padding: 8px 16px;
  font-weight: 700; border-radius: 0 0 4px 0;
  transition: top .2s;
}
.skip-nav:focus { top: 0; }

/* -------- CONTAINER -------- */
.container { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 20px; }

/* -------- HEADER TOP BAR -------- */
.header-top {
  background: var(--red-dark);
  padding: 5px 0;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}
.logo-globe img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}
.header-top-inner {
  display: flex; align-items: center; gap: 16px;
  justify-content: space-between;
}
.live-badge {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--font-head); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: #fff;
}
.pulse-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #7fff7f;
  box-shadow: 0 0 0 0 rgba(127,255,127,0.7);
  animation: pulse 1.5s infinite;
  display: inline-block;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(127,255,127,0.7); }
  70%  { box-shadow: 0 0 0 8px rgba(127,255,127,0); }
  100% { box-shadow: 0 0 0 0 rgba(127,255,127,0); }
}
.header-clock { font-family: var(--font-mono); color: #ffd; letter-spacing: 0.05em; }
.header-tagline { color: rgba(255,255,255,0.7); }

/* -------- NAVBAR -------- */
.navbar {
  background: var(--dark);
  border-bottom: 3px solid var(--red);
  position: sticky; top: 0; z-index: 1000;
  box-shadow: 0 2px 20px rgba(0,0,0,0.6);
}
.nav-inner {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 0;
  min-height: 60px;
}
.site-logo {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-head); font-size: 1.5rem;
  font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--white);
}
.site-logo:hover { color: var(--red-light); }
.logo-globe { font-size: 1.8rem; line-height: 1; }
.logo-text { background: linear-gradient(90deg, var(--red-light), var(--green-light)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

.nav-menu { display: flex; gap: 0; }
.nav-menu > li { position: relative; }
.nav-menu > li > a {
  display: block; padding: 0 18px; height: 60px; line-height: 60px;
  font-family: var(--font-head); font-size: 0.95rem;
  font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--gray-light); transition: all var(--transition);
  border-bottom: 3px solid transparent; margin-bottom: -3px;
}
.nav-menu > li > a:hover,
.nav-menu > li > a.active {
  color: var(--white); border-bottom-color: var(--green-light);
  background: rgba(255,255,255,0.04);
}

/* Dropdown */
.has-dropdown .dropdown {
  display: none; position: absolute; top: 100%; left: 0;
  background: var(--dark-2); min-width: 200px;
  border: 1px solid var(--dark-4); border-top: 3px solid var(--red);
  box-shadow: var(--shadow); z-index: 200;
}
.has-dropdown:hover .dropdown { display: block; }
.dropdown li a {
  display: block; padding: 10px 18px;
  font-size: 0.9rem; color: var(--gray-light);
  border-bottom: 1px solid var(--dark-3);
  transition: all var(--transition);
}
.dropdown li a:hover { background: var(--dark-3); color: var(--white); padding-left: 24px; }

/* Mobile toggle */
.nav-toggle {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; padding: 8px;
}
.nav-toggle span {
  display: block; width: 25px; height: 2px;
  background: var(--white); transition: all var(--transition);
}

/* -------- BREADCRUMB -------- */
.breadcrumb-nav {
  background: var(--dark-2); border-bottom: 1px solid var(--dark-4);
  padding: 10px 0;
}
.breadcrumb {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 4px; font-size: 0.85rem;
}
.breadcrumb li { display: flex; align-items: center; gap: 4px; }
.breadcrumb a { color: var(--green-light); }
.breadcrumb a:hover { color: var(--red-light); }
.breadcrumb li:last-child { color: var(--gray); }
.bc-sep { color: var(--gray); }

/* -------- HERO / WORLD COUNTER -------- */
.hero {
  background: linear-gradient(180deg, var(--dark) 0%, var(--dark-2) 100%);
  padding: 60px 0 40px;
  text-align: center;
  position: relative; overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: 
    radial-gradient(ellipse at 20% 50%, var(--red-glow) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 50%, var(--green-glow) 0%, transparent 60%);
  pointer-events: none;
}
.hero-tag {
  display: inline-block;
  background: var(--red); color: #fff;
  font-family: var(--font-head); font-size: 0.75rem;
  font-weight: 600; letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 4px 16px; border-radius: 2px;
  margin-bottom: 16px;
}
.hero h1 {
  font-family: var(--font-head);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.04em; line-height: 1.1;
  margin-bottom: 8px;
}
.hero h1 span { color: var(--red-light); }
.hero-sub {
  color: var(--gray-light); font-size: 1.1rem;
  max-width: 600px; margin: 0 auto 40px;
}

/* World Population Counter */
.world-counter-wrap {
  max-width: 900px; margin: 0 auto;
  position: relative; z-index: 1;
}
.world-counter-box {
  background: var(--dark-2);
  border: 2px solid var(--red);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: 0 0 60px var(--red-glow), var(--shadow);
}
.counter-label {
  font-family: var(--font-head);
  font-size: 0.85rem; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--gray);
  margin-bottom: 12px;
}
.world-pop-number {
  font-family: var(--font-mono);
  font-size: clamp(2.5rem, 6vw, 5rem);
  color: var(--white); letter-spacing: 0.05em;
  line-height: 1; margin-bottom: 4px;
  text-shadow: 0 0 30px rgba(39,174,96,0.4);
}
.world-pop-number .digit-group { color: var(--green-light); }
.counter-sublabel {
  font-size: 0.85rem; color: var(--gray);
  margin-bottom: 30px;
}
.counter-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1px; background: var(--dark-4);
  border: 1px solid var(--dark-4);
  border-radius: var(--radius); overflow: hidden;
  margin-top: 24px;
}
.counter-stat {
  background: var(--dark-3); padding: 20px 16px; text-align: center;
}
.counter-stat .stat-num {
  font-family: var(--font-mono); font-size: 1.6rem;
  color: var(--accent); display: block; margin-bottom: 4px;
}
.counter-stat.births .stat-num { color: var(--green-light); }
.counter-stat.deaths .stat-num { color: var(--red-light); }
.counter-stat .stat-lbl { font-size: 0.8rem; color: var(--gray); text-transform: uppercase; letter-spacing: 0.08em; }

/* -------- SECTION BASICS -------- */
.section { padding: 60px 0; }
.section-alt { background: var(--dark-2); }
.section-header { margin-bottom: 40px; }
.section-tag {
  display: inline-block;
  background: var(--green-dark); color: var(--green-light);
  font-size: 0.72rem; font-family: var(--font-head);
  font-weight: 600; letter-spacing: 0.15em; text-transform: uppercase;
  padding: 3px 12px; border-radius: 2px; margin-bottom: 10px;
}
.section-header h2 {
  font-family: var(--font-head); font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  line-height: 1.1;
}
.section-header h2 span { color: var(--red-light); }
.section-header p { color: var(--gray-light); margin-top: 8px; max-width: 600px; }
.section-header .view-all {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 12px; color: var(--green-light);
  font-weight: 600; font-size: 0.9rem;
}
.section-header .view-all:hover { color: var(--red-light); }

/* -------- COUNTRY CARDS -------- */
.countries-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.country-card {
  background: var(--dark-2);
  border: 1px solid var(--dark-4);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  transition: all var(--transition);
  position: relative; overflow: hidden;
  cursor: pointer;
}
.country-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--red), var(--green));
  transform: scaleX(0); transform-origin: left;
  transition: transform var(--transition);
}
.country-card:hover { border-color: var(--red); transform: translateY(-3px); box-shadow: 0 8px 32px var(--red-glow); }
.country-card:hover::before { transform: scaleX(1); }
.card-flag { font-size: 2.5rem; margin-bottom: 10px; }
.card-name {
  font-family: var(--font-head); font-size: 1.2rem;
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.card-continent { font-size: 0.75rem; color: var(--gray); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 12px; }
.card-pop {
  font-family: var(--font-mono); font-size: 1.1rem;
  color: var(--green-light); margin-bottom: 2px;
}
.card-pop-label { font-size: 0.78rem; color: var(--gray); }
.card-bar-wrap { margin-top: 14px; }
.card-bar-label { display: flex; justify-content: space-between; font-size: 0.72rem; color: var(--gray); margin-bottom: 4px; }
.card-bar { height: 4px; background: var(--dark-4); border-radius: 2px; overflow: hidden; }
.card-bar-fill { height: 100%; background: linear-gradient(90deg, var(--red), var(--green-light)); border-radius: 2px; transition: width 1s ease; }
.country-card a.card-link {
  display: block; margin-top: 14px;
  text-align: center; font-size: 0.82rem;
  color: var(--gray); border-top: 1px solid var(--dark-4);
  padding-top: 10px; transition: color var(--transition);
}
.country-card:hover a.card-link { color: var(--green-light); }

/* -------- MAP SECTION -------- */
.map-section { padding: 60px 0; }
.map-wrapper {
  position: relative;
  background: var(--dark-2);
  border: 2px solid var(--dark-4);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}
#worldMap { height: 500px; width: 100%; }
.map-overlay-info {
  position: absolute; top: 16px; right: 16px; z-index: 400;
  background: rgba(17,17,17,0.92);
  border: 1px solid var(--red);
  border-radius: var(--radius); padding: 16px;
  min-width: 220px; max-width: 280px;
  display: none;
}
.map-overlay-info.active { display: block; }
.map-overlay-close {
  position: absolute; top: 8px; right: 10px;
  background: none; border: none; color: var(--gray);
  font-size: 1.2rem; cursor: pointer;
}
.map-overlay-close:hover { color: var(--red-light); }
.map-info-flag { font-size: 2rem; margin-bottom: 6px; }
.map-info-country { font-family: var(--font-head); font-size: 1.1rem; font-weight: 700; text-transform: uppercase; }
.map-info-pop { font-family: var(--font-mono); font-size: 1.3rem; color: var(--green-light); margin: 6px 0; }
.map-info-row { display: flex; justify-content: space-between; font-size: 0.8rem; padding: 4px 0; border-top: 1px solid var(--dark-4); color: var(--gray-light); }
.map-info-row span:first-child { color: var(--gray); }
.map-info-btn {
  display: block; width: 100%; margin-top: 12px;
  background: var(--red); color: #fff;
  border: none; border-radius: var(--radius);
  padding: 8px; font-family: var(--font-head);
  font-size: 0.85rem; letter-spacing: 0.05em;
  text-transform: uppercase; font-weight: 600;
  text-align: center; transition: background var(--transition);
}
.map-info-btn:hover { background: var(--red-light); color: #fff; }

/* -------- STATS SECTION -------- */
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.stat-card {
  background: var(--dark-2); border: 1px solid var(--dark-4);
  border-radius: var(--radius-lg); padding: 24px 20px;
  text-align: center; position: relative; overflow: hidden;
}
.stat-card::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 3px;
}
.stat-card.red-accent::after { background: var(--red); }
.stat-card.green-accent::after { background: var(--green-light); }
.stat-card.yellow-accent::after { background: var(--accent); }
.stat-icon { font-size: 2rem; margin-bottom: 10px; }
.stat-card .stat-num {
  font-family: var(--font-mono); font-size: 1.8rem;
  color: var(--white); display: block; margin-bottom: 6px;
}
.stat-card .stat-lbl { font-size: 0.82rem; color: var(--gray); text-transform: uppercase; letter-spacing: 0.08em; }

/* -------- COUNTRY DETAIL PAGE -------- */
.country-hero {
  background: linear-gradient(180deg, var(--dark) 0%, var(--dark-2) 100%);
  padding: 50px 0 40px;
  border-bottom: 3px solid var(--red);
}
.country-hero-inner { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.country-flag-big { font-size: 5rem; }
.country-hero-text h1 {
  font-family: var(--font-head); font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.country-hero-text .pop-live {
  font-family: var(--font-mono); font-size: 1.8rem;
  color: var(--green-light); display: block; margin-bottom: 6px;
}
.country-hero-text p { color: var(--gray-light); max-width: 600px; }

.info-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px; margin: 30px 0;
}
.info-card {
  background: var(--dark-3); border: 1px solid var(--dark-4);
  border-radius: var(--radius); padding: 18px 16px;
}
.info-card .ic-label { font-size: 0.75rem; color: var(--gray); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 6px; }
.info-card .ic-value { font-family: var(--font-mono); font-size: 1.3rem; color: var(--white); }
.info-card .ic-value.green { color: var(--green-light); }
.info-card .ic-value.red { color: var(--red-light); }

/* Provinces Table */
.data-table-wrap { overflow-x: auto; border-radius: var(--radius-lg); }
.data-table {
  width: 100%; border-collapse: collapse;
  background: var(--dark-2); font-size: 0.9rem;
}
.data-table thead th {
  background: var(--dark-3); padding: 14px 16px;
  text-align: left; font-family: var(--font-head);
  font-size: 0.78rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--gray);
  border-bottom: 2px solid var(--red);
}
.data-table tbody td { padding: 12px 16px; border-bottom: 1px solid var(--dark-4); color: var(--gray-light); }
.data-table tbody tr:hover { background: var(--dark-3); }
.data-table tbody td:first-child { color: var(--white); font-weight: 600; }
.data-table tbody td .mono { font-family: var(--font-mono); color: var(--green-light); }
.data-table tbody td .tz-badge {
  background: var(--dark-4); border: 1px solid var(--dark-3);
  padding: 2px 8px; border-radius: 2px; font-size: 0.75rem;
  font-family: var(--font-mono); color: var(--accent);
}

/* City detail popup */
.city-detail-modal {
  display: none; position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,0.8); align-items: center; justify-content: center;
}
.city-detail-modal.active { display: flex; }
.city-modal-inner {
  background: var(--dark-2); border: 2px solid var(--red);
  border-radius: var(--radius-lg); padding: 40px;
  max-width: 540px; width: 90%; position: relative;
  box-shadow: 0 0 60px var(--red-glow);
  animation: modalIn 0.3s ease;
}
@keyframes modalIn {
  from { transform: translateY(-20px) scale(0.97); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}
.modal-close {
  position: absolute; top: 16px; right: 16px;
  background: none; border: none; color: var(--gray);
  font-size: 1.5rem; cursor: pointer;
}
.modal-close:hover { color: var(--red-light); }
.modal-city-name {
  font-family: var(--font-head); font-size: 1.8rem;
  text-transform: uppercase; margin-bottom: 4px;
}
.modal-country-name { color: var(--gray); font-size: 0.9rem; margin-bottom: 20px; }
.modal-detail-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.modal-detail-item { background: var(--dark-3); border-radius: var(--radius); padding: 14px; }
.modal-detail-item .mdi-label { font-size: 0.72rem; color: var(--gray); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 4px; }
.modal-detail-item .mdi-value { font-family: var(--font-mono); font-size: 1rem; color: var(--white); }
.modal-detail-item .mdi-value.green { color: var(--green-light); }
.modal-detail-item .mdi-value.yellow { color: var(--accent); }

/* -------- FOOTER -------- */
.site-footer {
  background: var(--dark); border-top: 3px solid var(--red);
  padding: 60px 0 0; margin-top: 60px; position: relative;
}
.footer-globe-bg {
  position: absolute; top: -40px; right: -80px;
  width: 400px; height: 400px; border-radius: 50%;
  background: radial-gradient(circle, var(--green-glow) 0%, transparent 70%);
  pointer-events: none;
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 40px;
}
.footer-logo {
  font-family: var(--font-head); font-size: 1.4rem;
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--white); display: flex; align-items: center; gap: 8px;
  margin-bottom: 16px;
}
.footer-brand p { color: var(--gray); font-size: 0.9rem; line-height: 1.7; margin-bottom: 20px; }
.footer-live {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.85rem; color: var(--gray-light);
}
.footer-col h3 {
  font-family: var(--font-head); font-size: 0.85rem;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--red-light); margin-bottom: 16px;
  padding-bottom: 8px; border-bottom: 1px solid var(--dark-4);
}
.footer-col ul li { margin-bottom: 8px; }
.footer-col ul li a { color: var(--gray); font-size: 0.88rem; transition: color var(--transition); }
.footer-col ul li a:hover { color: var(--green-light); padding-left: 4px; }
.footer-bottom {
  border-top: 1px solid var(--dark-4); padding: 20px 0;
}
.footer-bottom-inner { text-align: center; }
.footer-bottom p { color: var(--gray); font-size: 0.82rem; margin-bottom: 4px; }
.footer-links a { color: var(--gray); margin: 0 4px; }
.footer-links a:hover { color: var(--green-light); }

/* -------- STATISTICS PAGE -------- */
.stats-page-hero { padding: 50px 0 30px; text-align: center; }
.chart-section { padding: 40px 0; }
.bar-chart-wrap { background: var(--dark-2); border: 1px solid var(--dark-4); border-radius: var(--radius-lg); padding: 30px; }
.bar-chart-title { font-family: var(--font-head); font-size: 1.1rem; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 20px; color: var(--gray-light); }
.bar-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.bar-row-label { width: 160px; font-size: 0.85rem; color: var(--gray-light); text-align: right; flex-shrink: 0; }
.bar-row-bar { flex: 1; height: 28px; background: var(--dark-4); border-radius: 2px; overflow: hidden; position: relative; }
.bar-row-fill { height: 100%; border-radius: 2px; transition: width 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94); display: flex; align-items: center; padding-left: 10px; }
.bar-row-fill .brf-label { font-family: var(--font-mono); font-size: 0.8rem; color: #fff; white-space: nowrap; }
.bar-gradient-red { background: linear-gradient(90deg, var(--red-dark), var(--red-light)); }
.bar-gradient-green { background: linear-gradient(90deg, var(--green-dark), var(--green-light)); }
.bar-gradient-mixed { background: linear-gradient(90deg, var(--red-dark), var(--accent), var(--green-light)); }

/* -------- SEARCH BOX -------- */
.search-section { padding: 30px 0; }
.search-wrap { max-width: 600px; margin: 0 auto; position: relative; }
.search-wrap input {
  width: 100%; background: var(--dark-2); border: 2px solid var(--dark-4);
  border-radius: var(--radius); padding: 14px 50px 14px 20px;
  color: var(--white); font-size: 1rem; font-family: var(--font-body);
  transition: border-color var(--transition);
}
.search-wrap input:focus { outline: none; border-color: var(--red); }
.search-wrap input::placeholder { color: var(--gray); }
.search-btn {
  position: absolute; right: 0; top: 0; bottom: 0;
  background: var(--red); border: none; color: #fff;
  padding: 0 20px; border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 1.1rem; transition: background var(--transition);
}
.search-btn:hover { background: var(--red-light); }

/* -------- ALERTS / BADGES -------- */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 2px;
  font-size: 0.72rem; font-family: var(--font-head);
  font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
}
.badge-red { background: var(--red); color: #fff; }
.badge-green { background: var(--green); color: #fff; }
.badge-gray { background: var(--dark-4); color: var(--gray-light); }

/* -------- RESPONSIVE -------- */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .nav-menu {
    display: none; flex-direction: column;
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--dark-2); border-top: 2px solid var(--red);
    padding: 8px 0; z-index: 100;
  }
  .nav-menu.open { display: flex; }
  .nav-menu > li > a { height: auto; line-height: 1.4; padding: 12px 20px; }
  .has-dropdown .dropdown { position: static; display: none; border: none; box-shadow: none; background: var(--dark-3); }
  .has-dropdown.open .dropdown { display: block; }
  .navbar { position: relative; }
  .nav-inner { flex-wrap: wrap; }
  .counter-stats { grid-template-columns: 1fr; }
  .countries-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .modal-detail-grid { grid-template-columns: 1fr; }
  .header-top-inner { justify-content: center; gap: 10px; }
  .header-tagline { display: none; }
  .world-counter-box { padding: 24px 16px; }
}
@media (max-width: 480px) {
  .countries-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  #worldMap { height: 320px; }
  .hero { padding: 40px 0 30px; }
}

/* -------- UTILITIES -------- */
.text-center { text-align: center; }
.text-red { color: var(--red-light); }
.text-green { color: var(--green-light); }
.text-mono { font-family: var(--font-mono); }
.text-head { font-family: var(--font-head); }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-40 { margin-top: 40px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 28px; border-radius: var(--radius);
  font-family: var(--font-head); font-size: 0.9rem;
  font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  transition: all var(--transition); cursor: pointer; border: none;
}
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { background: var(--red-light); color: #fff; transform: translateY(-1px); }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { background: var(--green-light); color: #fff; transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--gray-light); border: 1px solid var(--dark-4); }
.btn-outline:hover { border-color: var(--red); color: var(--red-light); }

/* Leaflet dark theme overrides */
.leaflet-container { background: #111; }
.leaflet-tile { filter: brightness(0.85) saturate(0.7); }
.leaflet-popup-content-wrapper {
  background: var(--dark-2) !important;
  color: var(--white) !important;
  border: 1px solid var(--red) !important;
  border-radius: var(--radius) !important;
  box-shadow: 0 4px 20px var(--red-glow) !important;
}
.leaflet-popup-tip { background: var(--dark-2) !important; }
.leaflet-popup-content { margin: 12px 16px !important; }
