/* ZipScore - Professional Design System */
/* Tailwind CSS loaded via CDN in head.ejs */

/* =========================================
   BASE RESETS & TYPOGRAPHY
   ========================================= */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: #f8fafc;
  color: #0f172a;
}

/* =========================================
   DARK MODE
   ========================================= */
html.dark body {
  background-color: #09090b;
  color: #f1f5f9;
}

/* =========================================
   HERO PATTERN OVERLAY
   ========================================= */
.hero-pattern {
  background-image:
    radial-gradient(circle at 1px 1px, rgba(255,255,255,0.15) 1px, transparent 0);
  background-size: 32px 32px;
}

/* =========================================
   NAVIGATION - DROPDOWN
   ========================================= */
.dropdown-menu {
  animation: dropdownIn 0.15s ease forwards;
  transform-origin: top center;
}
@keyframes dropdownIn {
  from { opacity: 0; transform: translateY(-6px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* =========================================
   CARD DESIGN SYSTEM
   ========================================= */
.data-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}
.data-card:hover {
  box-shadow: 0 8px 30px -8px rgba(0,0,0,0.15);
  border-color: #bfdbfe;
  transform: translateY(-1px);
}
html.dark .data-card {
  background: #1e1e2e;
  border-color: #27272a;
}
html.dark .data-card:hover {
  border-color: #3730a3;
}

/* =========================================
   SCORE BADGE
   ========================================= */
.score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  border-radius: 10px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px;
  font-family: 'Inter', sans-serif;
}

.score-badge.score-excellent { background: linear-gradient(135deg, #059669, #10b981); color: #fff; }
.score-badge.score-good      { background: linear-gradient(135deg, #65a30d, #84cc16); color: #fff; }
.score-badge.score-average   { background: linear-gradient(135deg, #d97706, #f59e0b); color: #fff; }
.score-badge.score-poor      { background: linear-gradient(135deg, #ea580c, #f97316); color: #fff; }
.score-badge.score-bad       { background: linear-gradient(135deg, #dc2626, #ef4444); color: #fff; }
.score-badge.score-none      { background: #94a3b8; color: #fff; }

/* =========================================
   GRADE BADGES
   ========================================= */
.grade-a  { background: #dcfce7; color: #166534; font-weight: 700; }
.grade-b  { background: #dbeafe; color: #1e40af; font-weight: 700; }
.grade-c  { background: #fef9c3; color: #854d0e; font-weight: 700; }
.grade-d  { background: #ffedd5; color: #9a3412; font-weight: 700; }
.grade-f  { background: #fee2e2; color: #991b1b; font-weight: 700; }
html.dark .grade-a { background: #14532d; color: #86efac; }
html.dark .grade-b { background: #1e3a8a; color: #93c5fd; }
html.dark .grade-c { background: #713f12; color: #fde047; }
html.dark .grade-d { background: #7c2d12; color: #fdba74; }
html.dark .grade-f { background: #7f1d1d; color: #fca5a5; }

/* =========================================
   SECTION HEADERS
   ========================================= */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
}
.section-accent {
  width: 4px;
  height: 28px;
  border-radius: 9999px;
  flex-shrink: 0;
}

/* =========================================
   PROSE / BLOG CONTENT
   ========================================= */
.prose { line-height: 1.8; color: #374151; font-size: 1.0625rem; }
.prose h2 { font-size: 1.5rem; font-weight: 700; margin-top: 2.25rem; margin-bottom: 1rem; color: #111827; font-family: 'Plus Jakarta Sans', sans-serif; }
.prose h3 { font-size: 1.2rem; font-weight: 600; margin-top: 1.75rem; margin-bottom: 0.75rem; color: #1f2937; }
.prose p  { margin-bottom: 1.25rem; }
.prose ul { list-style: disc; padding-left: 1.5rem; margin-bottom: 1.25rem; }
.prose ol { list-style: decimal; padding-left: 1.5rem; margin-bottom: 1.25rem; }
.prose li { margin-bottom: 0.5rem; }
.prose a  { color: #2563eb; text-decoration: underline; text-underline-offset: 2px; }
.prose a:hover { color: #1d4ed8; }
.prose blockquote { border-left: 4px solid #3b82f6; padding: 0.75rem 1rem; font-style: italic; color: #6b7280; margin: 1.75rem 0; background: #f8fafc; border-radius: 0 8px 8px 0; }
.prose code { background: #f1f5f9; padding: 0.15em 0.45em; border-radius: 5px; font-size: 0.875em; font-family: 'Fira Code', 'Cascadia Code', monospace; color: #0f172a; }
.prose pre { background: #0f172a; color: #e2e8f0; padding: 1.25rem; border-radius: 10px; overflow-x: auto; font-size: 0.875rem; margin-bottom: 1.5rem; line-height: 1.7; }
.prose img { max-width: 100%; border-radius: 10px; box-shadow: 0 4px 20px rgba(0,0,0,.1); }
.prose table { width: 100%; border-collapse: collapse; margin-bottom: 1.5rem; font-size: 0.9rem; border-radius: 10px; overflow: hidden; }
.prose th, .prose td { border: 1px solid #e2e8f0; padding: 0.625rem 1rem; text-align: left; }
.prose th { background: #f8fafc; font-weight: 600; color: #0f172a; font-size: 0.825rem; text-transform: uppercase; letter-spacing: 0.04em; }

html.dark .prose { color: #cbd5e1; }
html.dark .prose h2, html.dark .prose h3 { color: #f8fafc; }
html.dark .prose a { color: #60a5fa; }
html.dark .prose blockquote { color: #94a3b8; background: #1e293b; }
html.dark .prose code { background: #1e293b; color: #e2e8f0; }
html.dark .prose th { background: #1e293b; color: #f1f5f9; }
html.dark .prose th, html.dark .prose td { border-color: #334155; }

/* =========================================
   PROGRESS BARS
   ========================================= */
.progress-bar {
  height: 7px;
  border-radius: 9999px;
  background: #e2e8f0;
  overflow: hidden;
}
.progress-bar .fill {
  height: 100%;
  border-radius: 9999px;
  background: linear-gradient(90deg, #2563eb, #3b82f6);
  transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
html.dark .progress-bar { background: #27272a; }

/* =========================================
   AUTOCOMPLETE DROPDOWNS
   ========================================= */
#hero-autocomplete .ac-item,
#nav-autocomplete .ac-item,
#mobile-autocomplete .ac-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.1s;
}
#hero-autocomplete .ac-item:last-child,
#nav-autocomplete .ac-item:last-child,
#mobile-autocomplete .ac-item:last-child { border-bottom: 0; }
#hero-autocomplete .ac-item:hover,
#nav-autocomplete .ac-item:hover,
#mobile-autocomplete .ac-item:hover { background: #eff6ff; }
html.dark #hero-autocomplete .ac-item:hover,
html.dark #nav-autocomplete .ac-item:hover,
html.dark #mobile-autocomplete .ac-item:hover { background: #1e3a8a; }
.ac-zip { font-family: 'Fira Code', monospace; font-weight: 700; color: #1d4ed8; font-size: 0.875rem; min-width: 55px; }
.ac-city { font-size: 0.85rem; color: #1e293b; flex: 1; }
.ac-state { font-size: 0.8rem; color: #94a3b8; }
html.dark .ac-zip { color: #93c5fd; }
html.dark .ac-city { color: #f1f5f9; }

/* =========================================
   CHARTS
   ========================================= */
.chart-container { position: relative; width: 100%; }

/* =========================================
   COOKIE BANNER
   ========================================= */
#cookie-banner {
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(12px);
}
#cookie-banner.visible { transform: translateY(0); }

/* =========================================
   SCROLL TO TOP BUTTON
   ========================================= */
#scroll-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #1d4ed8, #3b82f6);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(59,130,246,0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
#scroll-top:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(59,130,246,0.5); }
#scroll-top.visible { display: flex; }

/* =========================================
   "HOW IT WORKS" STEP CARDS
   ========================================= */
.step-card {
  position: relative;
  text-align: center;
  padding: 2rem 1.5rem;
}
.step-icon-wrap {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border: 2px solid #bfdbfe;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: 1rem;
}
html.dark .step-icon-wrap {
  background: linear-gradient(135deg, #1e3a8a, #1e40af);
  border-color: #3730a3;
}

/* =========================================
   ANIMATION HELPERS
   ========================================= */
.fade-in {
  animation: fadeIn 0.35s ease forwards;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.slide-in-right {
  animation: slideInRight 0.35s ease forwards;
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(12px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* =========================================
   SKIP LINK (accessibility)
   ========================================= */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  background: #1d4ed8;
  color: white;
  padding: 10px 18px;
  z-index: 9999;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { top: 0; }

/* =========================================
   AD CONTAINERS
   ========================================= */
.ad-container {
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  overflow: hidden;
}

/* =========================================
   QUIZ / HAS-CHECKED
   ========================================= */
.has-\[\:checked\]\:border-blue-600:has(:checked) { border-color: #2563eb; }
.has-\[\:checked\]\:bg-blue-50:has(:checked) { background-color: #eff6ff; }
html.dark .has-\[\:checked\]\:bg-blue-50:has(:checked) { background: transparent; }

/* =========================================
   LINE CLAMP
   ========================================= */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* =========================================
   TABLE STRIPED
   ========================================= */
.table-striped tbody tr:nth-child(even) { background: #f8fafc; }
html.dark .table-striped tbody tr:nth-child(even) { background: #18181b; }
.table-striped tbody tr:hover { background: #eff6ff; }
html.dark .table-striped tbody tr:hover { background: #1e3a8a; }

/* =========================================
   FOOTER LINKS
   ========================================= */
.footer-link {
  color: #94a3b8;
  transition: color 0.15s;
  font-size: 0.875rem;
  line-height: 1.75;
}
.footer-link:hover { color: #f8fafc; }

/* =========================================
   NEWSLETTER FORM
   ========================================= */
.newsletter-input {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  border-radius: 10px 0 0 10px;
  padding: 0.75rem 1rem;
  width: 100%;
  outline: none;
  font-size: 0.9rem;
  transition: border-color 0.2s;
}
.newsletter-input::placeholder { color: rgba(255,255,255,0.45); }
.newsletter-input:focus { border-color: rgba(255,255,255,0.4); }

/* =========================================
   PRINT STYLES
   ========================================= */
@media print {
  header, footer, #cookie-banner, .ad-container, .share-buttons, button { display: none !important; }
  body { background: white; color: black; font-size: 12pt; }
  a { color: black; text-decoration: none; }
  .prose { font-size: 11pt; }
}

/* =========================================
   MOBILE MENU
   ========================================= */
@media (max-width: 767px) {
  .mobile-menu-open { overflow: hidden; }
}

/* =========================================
   STAT COUNTER
   ========================================= */
.stat-number {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-weight: 800;
  font-size: 1.75rem;
  letter-spacing: -0.03em;
  color: #0f172a;
}
html.dark .stat-number { color: #f8fafc; }

/* =========================================
   FOCUS RING - ACCESSIBILITY
   ========================================= */
:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
  border-radius: 4px;
}
