/* ============================================================
   PROJECT MANHATTAN — country.css
   Font: DM Sans | Primary: #1a6fdb
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Poppins', 'DM Sans', sans-serif;
  background: #f4f6fb;
  color: #1a1a2e;
  min-height: 100vh;
}

/* ── NAV ─────────────────────────────────────────────────── */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  height: 56px;
  background: #fff;
  border-bottom: 1px solid #e8eaf0;
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-brand { display: flex; flex-direction: column; line-height: 1.1; }
.nav-project { font-size: 9px; font-weight: 700; letter-spacing: 2px; color: #9aa0b4; }
.nav-manhattan { font-size: 15px; font-weight: 800; color: #1a1a2e; }
.nav-links {
  display: flex; list-style: none; gap: 4px; align-items: center;
  position: absolute; left: 50%; transform: translateX(-50%);
}
.nav-links a {
  text-decoration: none; font-size: 13px; font-weight: 500;
  color: #6b7280; padding: 6px 12px; border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}
.nav-links a:hover, .nav-links a.active { color: #1a6fdb; background: #eef4fd; }
.nav-dropdown { position: relative; }
.nav-dropdown-menu {
  display: none; position: absolute; top: calc(100% + 8px); left: 0;
  background: #fff; border: 1px solid #e8eaf0; border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.10); min-width: 160px;
  overflow: hidden; list-style: none; z-index: 200;
}
.nav-dropdown:hover .nav-dropdown-menu { display: block; }
.nav-dropdown-menu li a { display: block; padding: 9px 16px; font-size: 13px; color: #4a4e69; }
.nav-dropdown-menu li a:hover { background: #f4f6fb; color: #1a6fdb; }
.nav-right { display: flex; align-items: center; }
.nav-profile { position: relative; display: flex; align-items: center; gap: 8px; cursor: pointer; }
.nav-avatar { width: 32px; height: 32px; border-radius: 50%; background: #1a6fdb; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; }
.nav-email { font-size: 12px; color: #6b7280; font-weight: 500; }
.nav-profile-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0; background: #fff;
  border: 1px solid #e8eaf0; border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.10); min-width: 160px; overflow: hidden; z-index: 200;
}
.nav-profile-name { padding: 10px 16px 6px; font-size: 12px; font-weight: 700; color: #1a1a2e; border-bottom: 1px solid #f0f2f8; }
.nav-dropdown-link { display: flex; align-items: center; gap: 8px; padding: 9px 16px; font-size: 13px; color: #4a4e69; text-decoration: none; font-weight: 500; }
.nav-dropdown-link:hover { background: #f4f6fb; color: #1a6fdb; }
.nav-profile-dropdown button { width: 100%; padding: 9px 16px; background: none; border: none; border-top: 1px solid #f0f2f8; text-align: left; font-family: 'Poppins', 'DM Sans', sans-serif; font-size: 13px; color: #e63946; cursor: pointer; font-weight: 500; }
.nav-profile-dropdown button:hover { background: #fff5f5; }

/* ── PAGE ────────────────────────────────────────────────── */
.page-wrapper { padding: 24px 32px; }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.page-header-left { display: flex; align-items: baseline; gap: 12px; }
.page-header h1 { font-size: 22px; font-weight: 800; color: #1a1a2e; }
.page-subtitle { font-size: 12px; color: #9aa0b4; font-weight: 500; background: #f0f2f8; padding: 3px 10px; border-radius: 20px; }

/* ── SEARCH ──────────────────────────────────────────────── */
.search-wrapper {
  display: flex; align-items: center; gap: 8px; background: #fff;
  border: 1.5px solid #e0e3ed; border-radius: 8px; padding: 7px 12px; width: 280px;
}
.search-wrapper:focus-within { border-color: #1a6fdb; }
.search-wrapper svg { color: #9aa0b4; flex-shrink: 0; }
.search-wrapper input { border: none; outline: none; font-family: 'Poppins', 'DM Sans', sans-serif; font-size: 13px; color: #1a1a2e; width: 100%; background: transparent; }
.search-wrapper input::placeholder { color: #9aa0b4; }

/* ── COUNTRY GRID ────────────────────────────────────────── */
.country-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

/* ── COUNTRY CARD ────────────────────────────────────────── */
.country-card {
  background: #fff;
  border: 1px solid #e8eaf0;
  border-radius: 12px;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.2s;
  text-decoration: none;
}
.country-card:hover {
  box-shadow: 0 8px 24px rgba(26,111,219,0.10);
  transform: translateY(-2px);
}

.country-flag {
  width: 64px;
  height: 42px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #e8eaf0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.country-card-name {
  font-size: 13px;
  font-weight: 700;
  color: #1a1a2e;
  text-align: center;
  line-height: 1.3;
}

.country-card-codes {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: center;
}

.code-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  background: #eef4fd;
  color: #1a6fdb;
  border: 1px solid #c7dcf8;
}

.code-tag.numeric {
  background: #f4f6fb;
  color: #6b7280;
  border-color: #e0e3ed;
}

/* ── LOADING & EMPTY ─────────────────────────────────────── */
.loading-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 80px 32px; color: #9aa0b4; font-size: 13px; }
.spinner { width: 32px; height: 32px; border: 3px solid #e8eaf0; border-top-color: #1a6fdb; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state { text-align: center; padding: 60px; color: #9aa0b4; font-size: 13px; }

/* ── DETAIL PAGE ─────────────────────────────────────────── */
.detail-topbar { margin-bottom: 20px; }

.btn-back {
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
  font-size: 13px; font-weight: 500; color: #6b7280; padding: 6px 12px;
  border-radius: 7px; border: 1.5px solid #e0e3ed; background: #fff;
  transition: border-color 0.2s, color 0.2s;
}
.btn-back:hover { border-color: #1a6fdb; color: #1a6fdb; }

.country-detail { display: flex; flex-direction: column; gap: 24px; }

.country-hero {
  background: #fff;
  border: 1px solid #e8eaf0;
  border-radius: 14px;
  padding: 32px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.country-flag-large {
  width: 120px;
  height: 80px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid #e8eaf0;
  box-shadow: 0 4px 16px rgba(0,0,0,0.10);
  flex-shrink: 0;
}

.country-hero-info { display: flex; flex-direction: column; gap: 12px; }

.country-hero-info h1 {
  font-size: 28px;
  font-weight: 800;
  color: #1a1a2e;
}

.country-codes { display: flex; gap: 8px; flex-wrap: wrap; }

.code-chip {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  background: #eef4fd;
  color: #1a6fdb;
  border: 1px solid #c7dcf8;
}

.code-chip.numeric {
  background: #f4f6fb;
  color: #6b7280;
  border-color: #e0e3ed;
}

/* ── DETAIL GRID ─────────────────────────────────────────── */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 20px;
  align-items: start;
}

@media (max-width: 900px) {
  .detail-grid { grid-template-columns: 1fr; }
}

.detail-card {
  background: #fff;
  border: 1px solid #e8eaf0;
  border-radius: 14px;
  overflow: hidden;
}

.detail-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 20px;
  border-bottom: 1px solid #f0f2f8;
  background: #fafbff;
}
.detail-card-header h2 { font-size: 13px; font-weight: 700; color: #1a1a2e; }

.detail-fields { display: flex; flex-direction: column; padding: 8px 20px; }

.detail-field {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #f4f6fb;
  gap: 12px;
}
.detail-field:last-child { border-bottom: none; }

.detail-label { font-size: 12px; color: #9aa0b4; font-weight: 500; }
.detail-value { font-size: 13px; font-weight: 700; color: #1a1a2e; }

/* ── COMING SOON ─────────────────────────────────────────── */
.coming-soon-card { border-style: dashed; }

.coming-soon-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  gap: 12px;
}

.coming-soon-icon { font-size: 36px; }

.coming-soon-body h3 {
  font-size: 16px;
  font-weight: 700;
  color: #1a1a2e;
}

.coming-soon-body p {
  font-size: 13px;
  color: #9aa0b4;
  line-height: 1.6;
  max-width: 400px;
}

/* ══ NEW PILL NAV ══════════════════════════════════════════ */
.topbar {
  display: flex;
  align-items: center;
  padding: 14px 28px;
  gap: 20px;
  background: #f0f2f7;
  flex-shrink: 0;
}

.topbar-brand {
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 999px;
  padding: 8px 16px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.07);
  text-decoration: none;
  line-height: 1.1;
  flex-shrink: 0;
}

.topbar-brand-project {
  display: block;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #9aa0b4;
}

.topbar-brand-name {
  display: block;
  font-size: 16px;
  font-weight: 800;
  color: #1a1a2e;
}

.topbar-nav {
  flex: 1;
  display: flex;
  justify-content: center;
}

.nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: #fff;
  border-radius: 999px;
  padding: 5px 7px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.07);
}

.nav-pill-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 400;
  color: #6b7280;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
  position: relative;
}

.nav-pill-item:hover { background: #f0f2f7; color: #1a1a2e; }
.nav-pill-item.active { background: #f0f2f7; color: #1a1a2e; font-weight: 600; }

.nav-item-wrap {
  position: relative;
}

.nav-item-wrap::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: 12px;
  background: transparent;
}

.nav-item-wrap:hover .nav-dropdown { display: block; }

.nav-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: #fff;
  border: 1px solid #e8eaf0;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.10);
  min-width: 160px;
  padding: 6px;
  z-index: 500;
}

.nav-dropdown a {
  display: block;
  padding: 8px 12px;
  font-size: 13px;
  color: #4a4e69;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
}

.nav-dropdown a:hover { background: #f0f2f7; color: #1a6fdb; }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border-radius: 999px;
  padding: 5px 8px 5px 5px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.07);
  flex-shrink: 0;
}

.topbar-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #1a6fdb;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.topbar-email {
  font-size: 12px;
  font-weight: 500;
  color: #4a4e69;
}

.topbar-settings {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #1a6fdb;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
}

.topbar-profile-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #fff;
  border: 1px solid #e8eaf0;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.10);
  min-width: 176px;
  overflow: hidden;
  z-index: 999;
}

.topbar-profile-dropdown.open { display: block; }

.topbar-profile-name {
  padding: 11px 15px 7px;
  font-size: 12px;
  font-weight: 700;
  color: #1a1a2e;
  border-bottom: 1px solid #e8eaf0;
}

.topbar-profile-dropdown a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 15px;
  font-size: 13px;
  color: #4a4e69;
  text-decoration: none;
  font-weight: 500;
}

.topbar-profile-dropdown a:hover { background: #f0f2f7; color: #1a6fdb; }

.topbar-profile-dropdown button {
  width: 100%;
  padding: 9px 15px;
  background: none;
  border: none;
  border-top: 1px solid #e8eaf0;
  text-align: left;
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  color: #e63946;
  cursor: pointer;
}

.topbar-profile-dropdown button:hover { background: #fff0f1; }

/* ── UTILITIES ───────────────────────────────────────────── */
.hidden { display: none !important; }