/* =========================================================
   GLOBAL
========================================================= */
body {
  background-color: #f8f9fa;
  font-family: system-ui, Arial, sans-serif;
}

/* =========================================================
   ERROR PAGE
========================================================= */
.error404 {
  text-align: center;
  font-size: clamp(22px, 4vw, 40px);
  font-weight: bold;
  color: brown;
  margin-top: 60px;
}

/* =========================================================
   NAVBAR (Compact & Responsive)
========================================================= */
.navbar-compact {
  min-height: 48px;
  padding: 4px 0;
}

.navbar-compact .navbar-brand {
  font-size: 18px;
  padding: 0;
}

/* Search bar width control */
.navbar-search {
  width: 180px;
  max-width: 100%;
}

.navbar-search-btn {
  white-space: nowrap;
}

/* Mobile search bar sizing */
@media (max-width: 768px) {
  .navbar-compact {
    padding: 2px 0;
  }

  .navbar-search {
    width: 130px;
    font-size: 14px;
  }

  .navbar-search-btn {
    font-size: 14px;
    padding: 4px 10px;
  }
}

/* =========================================================
   ✅ QUICK STATS CARDS — EXACT SAME AS NAVBAR & FOOTER
========================================================= */
.stat-population,
.stat-region,
.stat-capital,
.stat-area {
  background-color: #6c757d;   /* ✅ EXACT Bootstrap bg-secondary */
  color: #ffffff;
  border: none;
}

/* Typography consistency */
.stat-population strong,
.stat-region strong,
.stat-capital strong,
.stat-area strong {
  font-size: 18px;
  font-weight: 600;
}

/* Subtle professional hover */
.stat-population:hover,
.stat-region:hover,
.stat-capital:hover,
.stat-area:hover {
  filter: brightness(1.08);
  transition: 0.2s ease-in-out;
}

/* =========================================================
   TABLE STYLING
========================================================= */
.table-fixed {
  table-layout: fixed;
  width: 100%;
  background: white;
  word-wrap: break-word;
}

.table-fixed th {
  background-color: #e6e6e6;
  font-weight: 600;
  font-size: 14px;
}

.table-fixed td {
  font-size: 14px;
}

/* Column width ratio */
.table-fixed th:first-child,
.table-fixed td:first-child {
  width: 40%;
}

.table-fixed th:last-child,
.table-fixed td:last-child {
  width: 60%;
}

/* =========================================================
   FLAG SECTION
========================================================= */
.flag {
  width: 100%;
  max-width: 320px;
  background: #fff;
  padding: 10px;
  border-radius: 12px;
  overflow: hidden;
}

.flag img {
  width: 100%;
  height: auto;
}

/* =========================================================
   FOOTER
========================================================= */
.footer {
  text-align: center;
  padding: 12px 0;
  font-size: 14px;
}

/* =========================================================
   MOBILE OPTIMIZATION
========================================================= */
@media (max-width: 768px) {
  .table-fixed th,
  .table-fixed td {
    font-size: 13px;
  }

  .flag {
    max-width: 240px;
  }
}
