/* Baby Map – Live Global Births Visualization Styling */
:root {
  --bg-ocean: #e4f1fe;
  --country-fill: #2c3e50;
  --country-stroke: #34495e;
  --country-hover: #4b6584;
  --flash-gold: #f1c40f;
  --card-bg: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --accent-gold: #d97706;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Outfit", "Segoe UI", sans-serif;
  background-color: #f8fafc;
  color: var(--text-main);
}

/* App Wrapper */
.app-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  position: relative;
  padding-bottom: 20px;
}

/* Top Navigation Bar */
.top-nav {
  width: 100%;
  max-width: 1200px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px 8px 20px;
  z-index: 50;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 50px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
}

.back-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  background: #ffffff;
  border: 1px solid var(--border-color);
  padding: 8px 14px;
  border-radius: 50px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
}

.icon-btn:hover {
  transform: translateY(-2px);
}

/* Hero Counter Banner */
.hero-banner {
  text-align: center;
  padding: 6px 20px 16px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.banner-subtitle {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0284c7;
  background: #e0f2fe;
  padding: 4px 12px;
  border-radius: 20px;
}

.total-counter-heading {
  font-size: 2.4rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.counter-value {
  font-family: "Space Mono", monospace;
  color: var(--accent-gold);
  background: #fef3c7;
  padding: 2px 14px;
  border-radius: 14px;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.15);
}

.live-rate-tag {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-muted);
}

/* 1. Vector SVG Map Container */
.map-section {
  width: 95%;
  max-width: 1140px;
  background: var(--bg-ocean);
  border: 1px solid #bfdbfe;
  border-radius: 24px;
  padding: 12px;
  box-shadow: 0 10px 30px rgba(191, 219, 254, 0.35);
  position: relative;
  overflow: hidden;
}

#world-svg-map {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.06));
}

.country-path {
  fill: var(--country-fill);
  stroke: var(--country-stroke);
  stroke-width: 0.5px;
  stroke-linejoin: round;
  cursor: pointer;
  transition: fill 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.country-path:hover {
  fill: var(--country-hover);
}

.country-path.flashing {
  fill: var(--flash-gold) !important;
  transition: fill 0.05s ease !important;
  filter: drop-shadow(0 0 6px rgba(241, 196, 15, 0.8));
}

/* Floating Map Tooltip */
.map-tooltip {
  position: absolute;
  pointer-events: none;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(8px);
  color: #ffffff;
  padding: 8px 14px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  z-index: 100;
  opacity: 0;
  transform: translate(-50%, -120%);
  transition: opacity 0.15s ease, transform 0.15s ease;
  white-space: nowrap;
}

.map-tooltip.visible {
  opacity: 1;
}

/* 2. Real-Time Country Leaderboard Table */
.leaderboard-section {
  width: 95%;
  max-width: 1140px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 20px 24px;
  margin: 20px 0 10px 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
}

.leaderboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
}

.leaderboard-title {
  font-size: 1.25rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-country-input {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: 50px;
  font-family: inherit;
  font-size: 0.85rem;
  outline: none;
  width: 220px;
  transition: all 0.2s ease;
}

.search-country-input:focus {
  border-color: #0284c7;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

/* Table Grid */
.countries-grid-table {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}

.country-card-row {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.2s ease;
}

.country-card-row:hover {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.country-card-row.flash-row {
  background: #fef9c3;
  border-color: #facc15;
  transform: scale(1.02);
}

.country-left-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.country-flag-icon {
  font-size: 1.35rem;
  line-height: 1;
}

.country-name-text {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
}

.country-rate-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.country-tally-num {
  font-family: "Space Mono", monospace;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  background: #ffffff;
  border: 1px solid var(--border-color);
  padding: 2px 8px;
  border-radius: 6px;
}

/* Semantic SEO Article Section */
.seo-article {
  width: 95%;
  max-width: 1140px;
  margin: 15px auto 25px auto;
  padding: 20px 24px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

.seo-article h2 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 8px;
}

.seo-article h3 {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 12px 0 6px 0;
}

/* Responsive Mobile Layout */
@media (max-width: 768px) {
  .total-counter-heading {
    font-size: 1.9rem;
  }
  .leaderboard-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .search-country-input {
    width: 100%;
  }
}
