/*
 * RoofEstimate V2 — Component Stylesheet
 * Custom CSS for effects that Tailwind utilities alone cannot produce.
 * Import this AFTER app.min.css (compiled Tailwind output).
 */

/* ─────────────────────────────────────────────
   FONTS
───────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ─────────────────────────────────────────────
   SCROLLBAR
───────────────────────────────────────────── */
:root {
  --amber: #f59e0b;
  --amber-dark: #d97706;
  --gray-900: #111827;
  --gray-50: #f9fafb;
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ─────────────────────────────────────────────
   NAVBAR
───────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  transition: background-color 0.3s ease, box-shadow 0.3s ease, backdrop-filter 0.3s ease;
}

.navbar.transparent {
  background-color: transparent;
}

.navbar.scrolled {
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.08), 0 1px 2px -1px rgb(0 0 0 / 0.06);
}

.navbar.scrolled .nav-logo-text { color: #111827; }
.navbar.scrolled .nav-link-hero { color: #4b5563; }
.navbar.scrolled .nav-link-hero:hover { color: #111827; }

.navbar.transparent .nav-logo-text { color: #ffffff; }
.navbar.transparent .nav-link-hero { color: rgba(255,255,255,0.85); }
.navbar.transparent .nav-link-hero:hover { color: #ffffff; }

/* Services mega-dropdown */
.services-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: 760px;
  background: #ffffff;
  border: 1px solid #f3f4f6;
  border-radius: 20px;
  box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.15), 0 0 0 1px rgb(0 0 0 / 0.02);
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(-8px);
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.services-dropdown.open,
.services-trigger:hover + .services-dropdown,
.services-trigger:focus-within + .services-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  pointer-events: all;
}

/* Mobile menu */
.mobile-menu {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 320px;
  max-width: 100vw;
  background: #ffffff;
  z-index: 200;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.mobile-menu.open { transform: translateX(0); }

.mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  z-index: 190;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* ─────────────────────────────────────────────
   HERO
───────────────────────────────────────────── */
.hero-section {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.hero-bg {
  background-image: linear-gradient(135deg, #0f172a 0%, #1e293b 55%, #0c1a2e 100%);
}

.hero-dot-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.07) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

.hero-glow {
  position: absolute;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(245,158,11,0.12) 0%, transparent 70%);
  pointer-events: none;
}

/* ZIP search card */
.zip-search-card {
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  padding: 32px;
}

.zip-input-wrapper {
  display: flex;
  align-items: center;
  gap: 0;
  background: #ffffff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 24px 0 rgb(0 0 0 / 0.15);
}

.zip-input {
  flex: 1;
  padding: 18px 20px;
  font-size: 1.125rem;
  font-weight: 500;
  color: #111827;
  background: transparent;
  border: none;
  outline: none;
  font-family: 'Inter', sans-serif;
}

.zip-input::placeholder { color: #9ca3af; font-weight: 400; }

.zip-submit-btn {
  padding: 14px 24px;
  background: #f59e0b;
  color: #111827;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px;
  border-radius: 10px;
}

.zip-submit-btn:hover { background: #fbbf24; }
.zip-submit-btn:active { transform: scale(0.98); }

/* ─────────────────────────────────────────────
   SERVICE CARDS
───────────────────────────────────────────── */
.service-card {
  background: #ffffff;
  border: 1px solid #f3f4f6;
  border-radius: 16px;
  padding: 24px;
  transition: all 0.2s ease;
  text-decoration: none;
  display: block;
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #f59e0b, #d97706);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.service-card:hover {
  border-color: #fde68a;
  box-shadow: 0 8px 24px -4px rgb(0 0 0 / 0.1), 0 0 0 1px rgb(245 158 11 / 0.1);
  transform: translateY(-2px);
}

.service-card:hover::before { transform: scaleX(1); }

.service-card .icon-wrap {
  width: 48px;
  height: 48px;
  background: #fffbeb;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  transition: background 0.2s;
}

.service-card:hover .icon-wrap { background: #fef3c7; }

.service-card .card-name {
  font-size: 1rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 6px;
  line-height: 1.3;
}

.service-card .card-desc {
  font-size: 0.875rem;
  color: #6b7280;
  line-height: 1.5;
  margin-bottom: 14px;
}

.service-card .card-cta {
  font-size: 0.875rem;
  font-weight: 600;
  color: #d97706;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: gap 0.2s;
}

.service-card:hover .card-cta { gap: 8px; }

/* ─────────────────────────────────────────────
   INTELLIGENCE TICKER
───────────────────────────────────────────── */
.alert-ticker {
  background: linear-gradient(90deg, #92400e, #b45309, #d97706, #b45309, #92400e);
  background-size: 200% 100%;
  animation: shimmer 6s linear infinite;
}

@keyframes shimmer {
  from { background-position: 0% 0%; }
  to { background-position: 200% 0%; }
}

.ticker-track {
  display: flex;
  animation: ticker 40s linear infinite;
  white-space: nowrap;
}

.ticker-track:hover { animation-play-state: paused; }

@keyframes ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ─────────────────────────────────────────────
   TESTIMONIALS
───────────────────────────────────────────── */
.testimonial-card {
  background: #ffffff;
  border: 1px solid #f3f4f6;
  border-radius: 20px;
  padding: 28px;
  transition: box-shadow 0.2s;
}

.testimonial-card:hover {
  box-shadow: 0 8px 24px -4px rgb(0 0 0 / 0.08);
}

.testimonial-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 700;
  color: #111827;
  background: linear-gradient(135deg, #fde68a, #fbbf24);
  flex-shrink: 0;
}

/* ─────────────────────────────────────────────
   LEAD FORM
───────────────────────────────────────────── */
.lead-form-section {
  background: linear-gradient(135deg, #fffbeb 0%, #ffffff 100%);
  border: 1px solid #fde68a;
  border-radius: 24px;
  padding: 40px;
  position: relative;
  overflow: hidden;
}

.lead-form-section::before {
  content: '';
  position: absolute;
  top: -80px;
  right: -80px;
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(245,158,11,0.08), transparent 70%);
  pointer-events: none;
}

.form-group { margin-bottom: 20px; }

/* Phone input with flag */
.phone-input-wrap {
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.phone-input-wrap:focus-within {
  border-color: transparent;
  box-shadow: 0 0 0 2px #f59e0b;
}

.phone-flag {
  padding: 0 12px;
  font-size: 1.25rem;
  border-right: 1px solid #e5e7eb;
  background: #f9fafb;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
}

.phone-field {
  flex: 1;
  padding: 12px 16px;
  border: none;
  outline: none;
  font-size: 1rem;
  font-family: 'Inter', sans-serif;
  color: #111827;
  background: transparent;
}

/* TCPA consent */
.tcpa-text {
  font-size: 0.75rem;
  line-height: 1.5;
  color: #9ca3af;
}

.tcpa-text a { color: #6b7280; text-decoration: underline; }
.tcpa-text a:hover { color: #111827; }

/* ─────────────────────────────────────────────
   FAQ ACCORDION
───────────────────────────────────────────── */
.faq-toggle-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #f9fafb;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s, transform 0.3s;
}

.faq-item.open .faq-toggle-icon {
  background: #fef3c7;
  transform: rotate(45deg);
}

.faq-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-item.open .faq-body { max-height: 1000px; }

/* ─────────────────────────────────────────────
   TRUST BADGES
───────────────────────────────────────────── */
.trust-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 16px;
  text-align: center;
  border: 1px solid #f3f4f6;
  border-radius: 16px;
  background: #ffffff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.trust-badge:hover {
  border-color: #fde68a;
  box-shadow: 0 4px 12px -2px rgb(0 0 0 / 0.06);
}

.trust-badge-icon {
  width: 48px;
  height: 48px;
  background: #fffbeb;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ─────────────────────────────────────────────
   STICKY CTA BAR
───────────────────────────────────────────── */
.sticky-cta-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 80;
  background: #ffffff;
  border-top: 1px solid #e5e7eb;
  box-shadow: 0 -4px 16px -4px rgb(0 0 0 / 0.08);
  padding: 12px 16px;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sticky-cta-bar.visible { transform: translateY(0); }

@media (min-width: 768px) {
  .sticky-cta-bar { padding: 12px 24px; }
}

/* ─────────────────────────────────────────────
   GRID LINKS (city, state, zip)
───────────────────────────────────────────── */
.location-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 4px 16px;
}

.location-grid a {
  font-size: 0.875rem;
  color: #2563eb;
  padding: 2px 0;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.15s;
}

.location-grid a:hover { color: #1d4ed8; text-decoration: underline; }

/* ─────────────────────────────────────────────
   PAGE TRANSITION + NAVBAR OFFSET
───────────────────────────────────────────── */

/*
 * The navbar is position:fixed (height 4rem mobile / 4.5rem md+).
 * Every page needs padding-top so content clears the navbar.
 * Homepage hero gets it too — the dark bg still fills the space behind the
 * transparent navbar because the hero background-image applies to the full
 * section, and align-items:center naturally places content in visible area.
 */
.page-content {
  padding-top: 4rem;   /* 64px = h-16 (mobile navbar height) */
  animation: pageFadeIn 0.3s ease-out;
}

@media (min-width: 768px) {
  .page-content {
    padding-top: 4.5rem; /* 72px = h-18 (desktop navbar height) */
  }
}

/*
 * Homepage hero: pull the hero section up by the same amount so the dark
 * background fills flush behind the transparent navbar (full-bleed effect).
 */
.page-homepage .page-content .hero-section {
  margin-top: -4rem;
  padding-top: 4rem;
}

@media (min-width: 768px) {
  .page-homepage .page-content .hero-section {
    margin-top: -4.5rem;
    padding-top: 4.5rem;
  }
}

@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─────────────────────────────────────────────
   PRINT
───────────────────────────────────────────── */
@media print {
  .navbar, .sticky-cta-bar, .mobile-menu, .mobile-overlay { display: none !important; }
  body { background: white; color: black; }
  a { color: inherit; text-decoration: underline; }
}
