/*
 * Geek Weather - Browse Pages
 * Standalone CSS for PHP-rendered browse pages.
 * Mirrors the React app's visual identity without importing the full bundle.
 */

/* ── Reset & base ─────────────────────────────────────────────────────── */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  -webkit-font-smoothing: antialiased;
  background: #f5f5f5;
  color: #4a5568;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: #667eea;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* ── Header (matches App.css) ─────────────────────────────────────────── */

.browse-header {
  background: #222;
  border-bottom: 4px solid #7062c3;
  color: white;
  padding: 4px 0 0 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.header-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  column-gap: 25px;
  align-items: center;
  padding: 0 20px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  white-space: nowrap;
  margin-bottom: 9px;
  text-decoration: none;
  color: white;
}
.header-brand:hover {
  text-decoration: none;
}

.header-logo {
  height: 38px;
  width: 59px;
  flex-shrink: 0;
}

.site-title {
  font-size: 32px;
  font-weight: 700;
  padding-top: 2px;
  white-space: nowrap;
}

.main-nav {
  display: flex;
  gap: 20px;
}

.nav-link {
  color: white;
  text-decoration: none;
  font-size: 18px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 4px;
  transition: background 0.3s;
  height: 40px;
  margin-top: 2px;
}
.nav-link:hover {
  background: rgba(255, 255, 255, 0.1);
  text-decoration: none;
  color: white;
}

/* ── Main content ─────────────────────────────────────────────────────── */

.browse-main {
  flex: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 20px 60px;
  width: 100%;
}

/* ── Breadcrumbs ──────────────────────────────────────────────────────── */

.breadcrumbs {
  font-size: 14px;
  color: #718096;
  margin-bottom: 20px;
}
.breadcrumbs a {
  color: #667eea;
}
.breadcrumbs .sep {
  margin: 0 6px;
  color: #a0aec0;
}

/* ── Page heading ─────────────────────────────────────────────────────── */

.browse-main h1 {
  font-size: 28px;
  font-weight: 700;
  color: #1a365d;
  margin-bottom: 8px;
}

.browse-intro {
  color: #718096;
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 28px;
  max-width: 700px;
}

/* ── Card grid (country list, region list) ────────────────────────────── */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 40px;
}

.card-grid a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 14px 18px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  color: #1a365d;
  font-weight: 500;
  font-size: 15px;
  transition: border-color 0.15s, box-shadow 0.15s;
  text-decoration: none;
}
.card-grid a:hover {
  border-color: #667eea;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.12);
  text-decoration: none;
}

.card-count {
  font-size: 13px;
  color: #a0aec0;
  font-weight: 400;
  margin-left: 8px;
  white-space: nowrap;
}

/* ── City table (region city list) ────────────────────────────────────── */

.city-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 40px;
}

.city-table th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #718096;
  padding: 8px 12px;
  border-bottom: 2px solid #e2e8f0;
}

.city-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #edf2f7;
  font-size: 14px;
  color: #4a5568;
}

.city-table tr:hover td {
  background: #f7fafc;
}

.city-table .city-name {
  font-weight: 500;
  color: #1a365d;
}

.city-table .city-links {
  white-space: nowrap;
}

.city-table .city-links a {
  display: inline-block;
  padding: 3px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  font-size: 12px;
  color: #667eea;
  margin-right: 6px;
  transition: background 0.15s, border-color 0.15s;
}
.city-table .city-links a:hover {
  background: #667eea;
  border-color: #667eea;
  color: white;
  text-decoration: none;
}

.pop-col {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: #a0aec0;
  font-size: 13px;
}

/* ── Pagination ───────────────────────────────────────────────────────── */

.pagination {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.pagination a,
.pagination span {
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 14px;
  color: #667eea;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}
.pagination a:hover {
  border-color: #667eea;
  background: #f7fafc;
  text-decoration: none;
}
.pagination .current {
  background: #667eea;
  color: white;
  border-color: #667eea;
}

/* ── Footer (matches App.css) ─────────────────────────────────────────── */

.browse-footer {
  background: #333;
  color: #ffffff;
  text-align: center;
  padding: 20px 0;
  margin-top: auto;
}
.browse-footer p {
  font-size: 14px;
}
.browse-footer a {
  color: #ffffff;
}
.browse-footer a:hover {
  text-decoration: underline;
}

/* ── Responsive ───────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .header-logo {
    height: 30px;
    width: 47px;
  }
  .site-title {
    font-size: 24px;
  }
  .main-nav {
    flex-wrap: wrap;
    gap: 10px;
  }
  .nav-link {
    font-size: 16px;
    padding: 3px 12px;
    height: 25px;
    margin-bottom: 6px;
  }
  .browse-main h1 {
    font-size: 22px;
  }
  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
  /* Stack city table for small screens */
  .city-table .pop-col {
    display: none;
  }
}