/* ============================================
   ZIPLOOKUP PRO — Main Stylesheet
   ============================================ */

:root {
  --primary: #2563eb;
  --primary-dark: #1e40af;
  --primary-light: #dbeafe;
  --accent: #0ea5e9;
  --text: #111827;
  --text-muted: #6b7280;
  --text-light: #9ca3af;
  --bg: #f9fafb;
  --surface: #ffffff;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -1px rgba(0,0,0,0.04);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  font-size: 15px;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- NAVBAR ---- */
.navbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.navbar-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; height: 60px;
}
.navbar-logo {
  font-size: 20px; font-weight: 700; color: var(--primary);
  display: flex; align-items: center; gap: 8px;
}
.navbar-logo svg { width: 24px; height: 24px; }
.navbar-nav { display: flex; gap: 4px; list-style: none; }
.navbar-nav a {
  padding: 6px 12px; border-radius: var(--radius);
  font-size: 14px; color: var(--text-muted); font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.navbar-nav a:hover, .navbar-nav a.active {
  background: var(--primary-light); color: var(--primary);
  text-decoration: none;
}
.navbar-menu-btn { display: none; background: none; border: none; cursor: pointer; padding: 4px; }
@media (max-width: 768px) {
  .navbar-nav { display: none; }
  .navbar-menu-btn { display: flex; align-items: center; justify-content: center; }
}

/* ---- HERO ---- */
.hero {
  background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 50%, #1d4ed8 100%);
  padding: 56px 20px 48px;
  text-align: center;
}
.hero h1 { color: #fff; font-size: clamp(22px, 4vw, 36px); font-weight: 700; margin-bottom: 10px; }
.hero p  { color: rgba(255,255,255,0.75); font-size: 16px; max-width: 540px; margin: 0 auto 28px; }

.search-box {
  display: flex; max-width: 580px; margin: 0 auto;
  background: #fff; border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  overflow: hidden;
}
.search-box input {
  flex: 1; width: 100%; min-width: 0; padding: 16px 20px; font-size: 16px;
  border: none; outline: none; color: var(--text);
  background: transparent;

}
.search-box button {
  padding: 16px 28px; background: var(--primary); color: #fff;
  border: none; font-size: 15px; font-weight: 600; cursor: pointer;
  transition: background 0.15s;
}
.search-box button:hover { background: var(--primary-dark); }

.hero-tabs {
  display: flex; justify-content: center; gap: 8px; margin: 18px 0 0;
}
.hero-tab {
  background: rgba(255,255,255,0.12); color: rgba(255,255,255,0.85);
  border: 1px solid rgba(255,255,255,0.2); border-radius: 20px;
  padding: 5px 14px; font-size: 13px; cursor: pointer;
  transition: background 0.15s;
}
.hero-tab:hover, .hero-tab.active { background: rgba(255,255,255,0.25); }

/* ---- STATS BAR ---- */
.stats-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.stats-bar-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; justify-content: center;
}
.stat-cell {
  padding: 16px 32px; text-align: center;
  border-right: 1px solid var(--border);
  flex: 0 1 220px;
}
.stat-cell:last-child { border-right: none; }
.stat-cell .num { font-size: 22px; font-weight: 700; color: var(--primary); }
.stat-cell .lbl { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ---- LAYOUT ---- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.layout-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 24px;
  padding: 28px 0;
}

/* ---- CARDS ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow);
}
.card-title {
  font-size: 14px; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.05em; margin-bottom: 14px;
}

/* ---- ZIP RESULT CARD ---- */
.result-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 24px; margin-bottom: 20px;
}
.result-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; }
.result-zip { font-size: 40px; font-weight: 800; color: var(--primary); }
.result-location { font-size: 18px; font-weight: 600; color: var(--text); }
.result-meta { font-size: 13px; color: var(--text-muted); margin-top: 3px; }
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600; text-transform: uppercase;
}
.badge-blue { background: var(--primary-light); color: var(--primary); }
.badge-green { background: #d1fae5; color: #065f46; }

.result-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.result-stat {
  background: var(--bg); border-radius: var(--radius);
  padding: 14px 16px;
}
.result-stat .label { font-size: 11px; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; }
.result-stat .value { font-size: 20px; font-weight: 700; color: var(--text); margin-top: 2px; }

/* ---- DATA TABLE ---- */
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th {
  text-align: left; padding: 9px 14px;
  background: var(--bg); color: var(--text-muted);
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 11px 14px; border-bottom: 1px solid var(--border);
  color: var(--text);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg); }
.data-table .zip-link { font-weight: 600; color: var(--primary); }

/* ---- ZIP CARDS GRID ---- */
.zip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.zip-mini-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
  cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s;
}
.zip-mini-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); }
.zip-mini-card .zip { font-size: 18px; font-weight: 700; color: var(--primary); }
.zip-mini-card .city { font-size: 13px; color: var(--text); margin: 2px 0; }
.zip-mini-card .state { font-size: 11px; color: var(--text-muted); }

/* ---- SIDEBAR ---- */
.sidebar { display: flex; flex-direction: column; gap: 16px; }
.sidebar-links a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 0; border-bottom: 1px solid var(--border);
  font-size: 13px; color: var(--text);
  transition: color 0.12s;
}
.sidebar-links a:last-child { border-bottom: none; }
.sidebar-links a:hover { color: var(--primary); text-decoration: none; }
.sidebar-links a .arrow { color: var(--text-muted); font-size: 12px; }
.sidebar-links a .meta { color: var(--text-muted); font-size: 11px; }

/* ---- MAP PLACEHOLDER ---- */
.map-box {
  width: 100%; height: 200px; border-radius: var(--radius);
  background: #e0f2fe; border: 1px solid #bae6fd;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 8px; margin-bottom: 16px;
  color: var(--text-muted); font-size: 13px;
}
.map-box svg { width: 32px; height: 32px; color: var(--primary); opacity: 0.5; }

/* ---- SEARCH SUGGESTIONS ---- */
#suggestions {
  position: absolute; top: 100%; left: 0; right: 0;
  background: #fff; border: 1px solid var(--border);
  border-top: none; border-radius: 0 0 12px 12px;
  box-shadow: var(--shadow-md); z-index: 200;
  max-height: 280px; overflow-y: auto;
}
.suggestion-item {
  padding: 11px 20px; cursor: pointer;
  display: flex; align-items: center; gap: 12px;
  font-size: 14px; transition: background 0.1s;
}
.suggestion-item:hover { background: var(--bg); }
.suggestion-item .sug-zip { font-weight: 700; color: var(--primary); min-width: 60px; }
.suggestion-item .sug-city { color: var(--text); }
.suggestion-item .sug-state { color: var(--text-muted); font-size: 12px; }
.search-wrap-rel { position: relative; flex: 1; display: flex; min-width: 0; }

/* ---- CONTENT / BLOG ---- */
.content-body h1 { font-size: 24px; font-weight: 700; margin-bottom: 12px; }
.content-body h2 { font-size: 19px; font-weight: 600; margin: 24px 0 10px; }
.content-body p  { margin-bottom: 14px; color: var(--text); line-height: 1.75; }
.content-body ul, .content-body ol { padding-left: 20px; margin-bottom: 14px; }
.content-body li { margin-bottom: 6px; }

/* ---- ALERTS ---- */
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 14px; }
.alert-info    { background: #dbeafe; color: #1e40af; }
.alert-success { background: #d1fae5; color: #065f46; }
.alert-warning { background: #fef3c7; color: #92400e; }
.alert-error   { background: #fee2e2; color: #991b1b; }

/* ---- FOOTER ---- */
.footer {
  background: var(--surface); border-top: 1px solid var(--border);
  margin-top: 40px;
}
.footer-grid {
  max-width: 1200px; margin: 0 auto; padding: 36px 20px 24px;
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px;
}
.footer-brand .brand-name { font-size: 18px; font-weight: 700; color: var(--primary); margin-bottom: 8px; }
.footer-brand p { font-size: 13px; color: var(--text-muted); max-width: 240px; }
.footer-col h4 { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 12px; }
.footer-col a { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 7px; }
.footer-col a:hover { color: var(--primary); text-decoration: none; }
.footer-bottom {
  max-width: 1200px; margin: 0 auto;
  padding: 14px 20px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; color: var(--text-muted);
}
.footer-bottom-links { display: flex; gap: 16px; }

/* ---- RESPONSIVE ---- */
/* ============================================
   MOBILE RESPONSIVE — EXTENDED
   ============================================ */

/* Tablet (768px and below) */
@media (max-width: 768px) {
  /* Navbar */
  .navbar-inner { padding: 0 14px; }
  .navbar-logo { font-size: 17px; }

  /* Hero search */
  .search-box { border-radius: 10px; }
  .search-box input { padding: 13px 14px; font-size: 15px; }
  .search-box button { padding: 13px 16px; font-size: 14px; }
  .hero-tabs { flex-wrap: wrap; gap: 6px; }

  /* Layout */
  .layout-grid { grid-template-columns: 1fr; gap: 16px; }
  .sidebar { gap: 12px; }

  /* ZIP grid — 2 columns on tablet */
  .zip-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }

  /* Result card */
  .result-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .result-zip { font-size: 30px; }
  .result-location { font-size: 16px; }

  /* Footer */
  .footer-grid { grid-template-columns: 1fr 1fr !important; gap: 20px; padding: 24px 16px; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
  .footer-bottom-links { flex-wrap: wrap; justify-content: center; gap: 10px; }

  /* States/Provinces grid pages */
  #states-grid, #provs-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 10px !important;
  }

  /* ZIP detail data table */
  .data-table td, .data-table th { padding: 9px 10px; font-size: 13px; }

  /* Card padding */
  .card { padding: 16px; }
}

/* Mobile (480px and below) */
@media (max-width: 480px) {
  /* Navbar */
  .navbar-inner { height: 52px; padding: 0 12px; }
  .navbar-logo { font-size: 16px; gap: 6px; }

  /* Hero */
  .hero { padding: 28px 14px 24px; }
  .hero h1 { font-size: 20px; }
  .hero p { font-size: 14px; margin-bottom: 18px; }
  .search-box { border-radius: 8px; }
  .search-box input { padding: 12px 12px; font-size: 14px; }
  .search-box button { padding: 12px 14px; font-size: 13px; }
  .hero-tabs { gap: 5px; }
  .hero-tab { font-size: 12px; padding: 4px 10px; }

  /* Stats bar */
  .stats-bar-inner { flex-direction: column; }
  .stat-cell { border-right: none; border-bottom: 1px solid var(--border); padding: 12px 16px; width: 100%; flex: none; height: auto; }
  .stat-cell:last-child { border-bottom: none; }
  .stat-cell .num { font-size: 20px; }

  /* ZIP grid — 1 column on mobile */
  .zip-grid { grid-template-columns: 1fr 1fr; gap: 8px; }

  /* States/Provinces grid — 2 columns on mobile */
  #states-grid, #provs-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }
  .state-card, .prov-card {
    padding: 14px 12px !important;
  }

  /* Result card */
  .result-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .result-zip { font-size: 28px; }
  .result-header { flex-direction: column; gap: 8px; }

  /* ZIP detail banner stats */
  .result-stat { padding: 10px 12px; }
  .result-stat .value { font-size: 16px; }

  /* Data table — make it scroll on tiny screens */
  .data-table { font-size: 13px; }
  .data-table td, .data-table th { padding: 8px 10px; }

  /* Cards */
  .card { padding: 14px; border-radius: 10px; }
  .card-title { font-size: 12px; }

  /* Footer */
  .footer-grid { grid-template-columns: 1fr !important; gap: 16px; padding: 20px 14px; }
  .footer-col a { font-size: 13px; }

  /* Layout */
  .container { padding: 0 14px; }
  .layout-grid { padding: 16px 0; gap: 14px; }

  /* Breadcrumb */
  .breadcrumb { font-size: 12px; }

  /* Search filter inputs on state/province pages */
  #state-search, #prov-search {
    font-size: 13px !important;
    padding: 9px 14px !important;
  }

  /* Top ZIPs in state/province page */
  .zip-mini-card { padding: 10px 12px; }
  .zip-mini-card .zip { font-size: 15px; }
}

/* Extra small (360px and below) */
@media (max-width: 360px) {
  .zip-grid { grid-template-columns: 1fr; }
  #states-grid, #provs-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .search-box button span { display: none; }
  .result-grid { grid-template-columns: 1fr; }
}