/*
 * Task #1474927 — Homepage 10/10 Visual Polish + Full Nav Audit
 *
 * This file owns: Final visual polish for homepage — search dedup, contrast,
 * borders, pills, premium feel. Loads AFTER all other homepage CSS.
 * Does NOT own: Navigation structure (header-new.ejs), route logic.
 *
 * Fixes:
 *  1. Duplicate search bar — belt-and-suspenders single-search enforcement
 *  2. White text on white/light backgrounds — comprehensive contrast fix
 *  3. Thin hairline borders — substantial or removed
 *  4. Category/filter pill readability — dark text on light bg
 *  5. Premium feel — Stripe/Fidelity grade polish
 *  6. Reveal animation safety — content visible even if JS fails
 */

/* ═══════════════════════════════════════════════════════════
   0. REVEAL SAFETY — Content must never be permanently invisible
   If IntersectionObserver fails or JS doesn't load, reveal sections
   must still show content after a brief delay.
   ═══════════════════════════════════════════════════════════ */

/* Safety net: after 3s, force all reveals visible via animation */
@keyframes reveal-safety {
  to { opacity: 1; transform: none; }
}
.reveal:not(.is-visible) {
  animation: reveal-safety 0.6s ease forwards;
  animation-delay: 3s;
}
.reveal-stagger:not(.is-visible) > * {
  animation: reveal-safety 0.5s ease forwards;
  animation-delay: 3.2s;
}

/* ═══════════════════════════════════════════════════════════
   1. SEARCH BAR DEDUPLICATION — One search bar per viewport
   Desktop (≥1024px): show header search (.hn-search), hide mobile search
   Mobile (<1024px): mobile search in hamburger menu, hide header search
   ═══════════════════════════════════════════════════════════ */

/* Desktop: hide mobile search, show desktop search */
@media (min-width: 1024px) {
  .hn-mobile-search,
  .hn-mobile-search-wrap,
  .hn-mobile-search-input,
  .nav-mobile-search-bar {
    display: none !important;
    visibility: hidden !important;
  }
  /* Ensure desktop search is visible */
  .hn-search {
    display: flex !important;
    visibility: visible !important;
  }
}

/* Mobile/tablet: hide desktop search, mobile search only in menu */
@media (max-width: 1023px) {
  .hn-search,
  .nav-inline-search {
    display: none !important;
    visibility: hidden !important;
  }
  /* Mobile search only shows inside open menu */
  .hn-mobile-search {
    display: block;
  }
}

/* Kill legacy search CSS body padding override */
body {
  padding-top: 0 !important;
}
/* Re-apply proper body padding only on mobile where header is fixed */
@media (max-width: 1023px) {
  body {
    padding-top: 60px !important;
  }
}

/* ═══════════════════════════════════════════════════════════
   2. HERO — Premium polish, strong contrast
   ═══════════════════════════════════════════════════════════ */

/* Hero headline: crisp near-black */
.hp-hero__headline {
  color: #0A0A0A !important;
  -webkit-text-fill-color: #0A0A0A !important;
}
.hp-hero__headline em {
  color: #00643E !important;
  -webkit-text-fill-color: #00643E !important;
}

/* Hero sub: readable dark gray */
.hp-hero__sub {
  color: #374151 !important;
  -webkit-text-fill-color: #374151 !important;
}

/* Hero eyebrow: deep emerald */
.hp-hero__eyebrow {
  color: #047857 !important;
  -webkit-text-fill-color: #047857 !important;
}

/* Social proof text */
.hp-hero__proof-text {
  color: #4B5563 !important;
  -webkit-text-fill-color: #4B5563 !important;
}

/* Stars: warm amber */
.hp-hero__stars svg {
  color: #D97706 !important;
  fill: #D97706 !important;
}

/* ═══════════════════════════════════════════════════════════
   3. THIN BORDERS — Remove or make substantial
   Hairline 1px borders look cheap. Either 0 or 2px.
   ═══════════════════════════════════════════════════════════ */

/* Header search: remove border, use subtle fill instead */
.hn-search {
  border: none !important;
  background: #F3F4F6 !important;
  border-radius: 10px !important;
}
.hn-search:focus-within {
  background: #FFFFFF !important;
  box-shadow: 0 0 0 2px #00875A !important;
  border: none !important;
}

/* Mobile search in menu: clean, no hairline */
.hn-mobile-search-wrap {
  border: none !important;
  background: #F3F4F6 !important;
  border-radius: 10px !important;
}
.hn-mobile-search-wrap:focus-within {
  background: #FFFFFF !important;
  box-shadow: 0 0 0 2px #00875A !important;
}

/* Email capture input: remove hairline, use fill */
.hp-email-capture__input {
  border: 2px solid #E5E7EB !important;
  border-radius: 10px !important;
  background: #FFFFFF !important;
  color: #0A0A0A !important;
  font-size: 1rem !important;
  padding: 0.875rem 1rem !important;
}
.hp-email-capture__input:focus {
  border-color: #00875A !important;
  box-shadow: 0 0 0 3px rgba(0, 135, 90, 0.1) !important;
  outline: none !important;
}
.hp-email-capture__input::placeholder {
  color: #9CA3AF !important;
}

/* Login button in header: remove thin border */
.hn-login {
  border: none !important;
  background: transparent !important;
  color: #374151 !important;
  font-weight: 600 !important;
}
.hn-login:hover {
  color: #00875A !important;
}

/* Card borders: remove hairline, use shadow elevation instead */
.hp-sotd__card,
.hp-testimonial-card,
.hp-pricing-card,
.hp-payout-card,
.hp-cat-card,
.hp-bounty-card {
  border: none !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04) !important;
  border-radius: 12px !important;
}
.hp-sotd__card:hover,
.hp-testimonial-card:hover,
.hp-payout-card:hover,
.hp-cat-card:hover,
.hp-bounty-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04) !important;
}

/* Pricing popular card: elevated more */
.hp-pricing-card--popular {
  box-shadow: 0 4px 16px rgba(0, 135, 90, 0.12), 0 2px 4px rgba(0, 0, 0, 0.04) !important;
  border: 2px solid #00875A !important;
}

/* Trust bar separators: remove thin lines, use dots instead */
.trust-item-sep {
  width: 4px !important;
  height: 4px !important;
  border-radius: 50% !important;
  background: #D1D5DB !important;
  border: none !important;
}

/* Feed table: clean borders */
.hp-feed-table {
  border: none !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
}
.hp-feed-table__head th {
  border-bottom: 2px solid #E5E7EB !important;
  color: #6B7280 !important;
  font-weight: 700 !important;
  font-size: 0.8rem !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
}
.hp-feed-row {
  border-bottom: 1px solid #F3F4F6 !important;
}
.hp-feed-row:hover {
  background: #F9FAFB !important;
}

/* ═══════════════════════════════════════════════════════════
   4. CATEGORY/FILTER PILLS — Strong readable contrast
   ═══════════════════════════════════════════════════════════ */

/* Category cards: dark text, solid bg */
.hp-cat-card {
  background: #FFFFFF !important;
  text-decoration: none !important;
}
.hp-cat-card__icon {
  color: #00875A !important;
  background: #ECFDF5 !important;
  border: none !important;
  width: 48px !important;
  height: 48px !important;
  border-radius: 12px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
.hp-cat-card__name {
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
  font-weight: 700 !important;
  font-size: 0.95rem !important;
}
.hp-cat-card__count {
  color: #6B7280 !important;
  -webkit-text-fill-color: #6B7280 !important;
  font-weight: 500 !important;
  font-size: 0.85rem !important;
}

/* Unclaimed section pills: white text on dark bg (correct) */
.hp-unclaimed__pill {
  color: rgba(255, 255, 255, 0.95) !important;
  -webkit-text-fill-color: rgba(255, 255, 255, 0.95) !important;
  background: rgba(255, 255, 255, 0.12) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  border-radius: 100px !important;
  padding: 0.375rem 0.875rem !important;
  font-weight: 600 !important;
  font-size: 0.85rem !important;
}

/* Badge pills: enforce readable contrast */
.badge,
[class*="badge-"] {
  font-weight: 700 !important;
  border: none !important;
  border-radius: 100px !important;
  padding: 0.25rem 0.625rem !important;
  font-size: 0.75rem !important;
  letter-spacing: 0.02em !important;
  line-height: 1.4 !important;
}
.badge-success, .badge-accent, .badge-deadline-green {
  background: #DCFCE7 !important;
  color: #166534 !important;
  -webkit-text-fill-color: #166534 !important;
}
.badge-warning, .badge-deadline-yellow {
  background: #FEF3C7 !important;
  color: #92400E !important;
  -webkit-text-fill-color: #92400E !important;
}
.badge-error, .badge-danger, .badge-deadline-red {
  background: #FEE2E2 !important;
  color: #991B1B !important;
  -webkit-text-fill-color: #991B1B !important;
}

/* SOTD category and badges */
.hp-sotd__category {
  background: #ECFDF5 !important;
  color: #065F46 !important;
  -webkit-text-fill-color: #065F46 !important;
  border: none !important;
  border-radius: 100px !important;
  padding: 0.25rem 0.75rem !important;
  font-weight: 700 !important;
  font-size: 0.75rem !important;
}
.hp-sotd__badge {
  background: #ECFDF5 !important;
  color: #065F46 !important;
  -webkit-text-fill-color: #065F46 !important;
  border: none !important;
}

/* Feed row category pill */
.hp-feed-row__cat {
  background: #F3F4F6 !important;
  color: #374151 !important;
  -webkit-text-fill-color: #374151 !important;
  border: none !important;
  border-radius: 100px !important;
  padding: 0.2rem 0.625rem !important;
  font-weight: 600 !important;
  font-size: 0.78rem !important;
}

/* Feed "New" pill */
.hp-feed-row__new {
  background: #ECFDF5 !important;
  color: #065F46 !important;
  border: none !important;
  font-weight: 700 !important;
  border-radius: 100px !important;
  padding: 0.15rem 0.5rem !important;
  font-size: 0.7rem !important;
}

/* Bounty rank badges */
.hp-bounty-card__rank {
  color: #FFFFFF !important;
  -webkit-text-fill-color: #FFFFFF !important;
  font-weight: 800 !important;
  border: none !important;
}

/* ═══════════════════════════════════════════════════════════
   5. SECTION TEXT CONTRAST — Comprehensive
   Every text element on a light bg must be ≥4.5:1 contrast ratio.
   ═══════════════════════════════════════════════════════════ */

/* Section labels (small uppercase) */
.section-label {
  color: #047857 !important;
  -webkit-text-fill-color: #047857 !important;
  font-weight: 700 !important;
  letter-spacing: 0.08em !important;
}

/* Section headings */
.section-heading {
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
}

/* Section subheadings */
.section-subheading {
  color: #4B5563 !important;
  -webkit-text-fill-color: #4B5563 !important;
}

/* Steps section */
.hp-step__title {
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
}
.hp-step__desc {
  color: #4B5563 !important;
  -webkit-text-fill-color: #4B5563 !important;
}
.hp-step__num {
  color: #00875A !important;
  -webkit-text-fill-color: #00875A !important;
  font-weight: 800 !important;
}

/* Step icons: emerald */
.hp-step__icon {
  color: #00875A !important;
}

/* Stats section */
.hp-stat__value {
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
}
.hp-stat__label {
  color: #4B5563 !important;
  -webkit-text-fill-color: #4B5563 !important;
}

/* Feed section */
.hp-feed__live {
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
}
.hp-feed-row__company span {
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
}
.hp-feed-row__payout {
  color: #00643E !important;
  -webkit-text-fill-color: #00643E !important;
  font-weight: 700 !important;
}

/* Testimonials */
.hp-testimonial-card__quote {
  color: #1F2A37 !important;
  -webkit-text-fill-color: #1F2A37 !important;
}
.hp-testimonial-card__name {
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
}
.hp-testimonial-card__location {
  color: #6B7280 !important;
  -webkit-text-fill-color: #6B7280 !important;
}

/* Pricing */
.hp-pricing-card__name {
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
}
.hp-pricing-card__amount {
  color: #00875A !important;
  -webkit-text-fill-color: #00875A !important;
}
.hp-pricing-card__period {
  color: #6B7280 !important;
  -webkit-text-fill-color: #6B7280 !important;
}
.hp-pricing-card__features li {
  color: #374151 !important;
  -webkit-text-fill-color: #374151 !important;
}
.hp-pricing__note {
  color: #6B7280 !important;
  -webkit-text-fill-color: #6B7280 !important;
}

/* Payout cards */
.hp-payout-card__name {
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
}
.hp-payout-card__settlement {
  color: #6B7280 !important;
  -webkit-text-fill-color: #6B7280 !important;
}
.hp-payout-card__amount {
  color: #00643E !important;
  -webkit-text-fill-color: #00643E !important;
  font-weight: 800 !important;
}
.hp-payout-card__label {
  color: #6B7280 !important;
  -webkit-text-fill-color: #6B7280 !important;
}
.hp-payout-card__avatar {
  background: #ECFDF5 !important;
  color: #065F46 !important;
  -webkit-text-fill-color: #065F46 !important;
  border: none !important;
}

/* Email capture */
.hp-email-capture__headline {
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
}
.hp-email-capture__sub {
  color: #4B5563 !important;
  -webkit-text-fill-color: #4B5563 !important;
}
.hp-email-capture__note {
  color: #6B7280 !important;
  -webkit-text-fill-color: #6B7280 !important;
}

/* For Business */
.hp-for-business__title {
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
}
.hp-for-business__eyebrow {
  color: #047857 !important;
  -webkit-text-fill-color: #047857 !important;
}
.hp-for-business__card-name {
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
}
.hp-for-business__card-desc {
  color: #4B5563 !important;
  -webkit-text-fill-color: #4B5563 !important;
}
.hp-for-business__card-link {
  color: #00875A !important;
  -webkit-text-fill-color: #00875A !important;
}
.hp-for-business__card {
  border: none !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06) !important;
  border-radius: 12px !important;
}
.hp-for-business__card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
}

/* Bounty text */
.hp-bounty__title {
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
}
.hp-bounty__sub {
  color: #4B5563 !important;
  -webkit-text-fill-color: #4B5563 !important;
}
.hp-bounty-card__company {
  color: #6B7280 !important;
  -webkit-text-fill-color: #6B7280 !important;
}
.hp-bounty-card__title {
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
}
.hp-bounty-card__payout {
  color: #00643E !important;
  -webkit-text-fill-color: #00643E !important;
  font-weight: 800 !important;
}

/* SOTD section */
.hp-sotd__title {
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
}
.hp-sotd__card-title {
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
}
.hp-sotd__company {
  color: #6B7280 !important;
  -webkit-text-fill-color: #6B7280 !important;
}
.hp-sotd__payout {
  color: #00643E !important;
  -webkit-text-fill-color: #00643E !important;
  font-weight: 700 !important;
}
.hp-sotd__views {
  color: #6B7280 !important;
  -webkit-text-fill-color: #6B7280 !important;
}

/* Final CTA */
.hp-final-cta__headline {
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
}
.hp-final-cta__note,
.hp-final-cta__note span {
  color: #4B5563 !important;
  -webkit-text-fill-color: #4B5563 !important;
}

/* Trust bar */
.trust-bar,
.trust-item {
  color: #1F2A37 !important;
  -webkit-text-fill-color: #1F2A37 !important;
}
.trust-item-icon {
  color: #00875A !important;
}

/* Counter */
.hp-counter__label {
  color: #065F46 !important;
  -webkit-text-fill-color: #065F46 !important;
}
.hp-counter__value {
  color: #00643E !important;
  -webkit-text-fill-color: #00643E !important;
}

/* COTD section */
.hp-cotd__title {
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
}
.hp-cotd__company {
  color: #6B7280 !important;
  -webkit-text-fill-color: #6B7280 !important;
}
.hp-cotd__blurb {
  color: #4B5563 !important;
  -webkit-text-fill-color: #4B5563 !important;
}
.hp-cotd__stat {
  color: #374151 !important;
  -webkit-text-fill-color: #374151 !important;
}
.hp-cotd__proof {
  color: #065F46 !important;
  -webkit-text-fill-color: #065F46 !important;
  background: #ECFDF5 !important;
  border: none !important;
}

/* Urgency red */
.hp-urgency--red {
  color: #991B1B !important;
  -webkit-text-fill-color: #991B1B !important;
  background: #FEE2E2 !important;
}

/* ═══════════════════════════════════════════════════════════
   6. PREMIUM FEEL — Stripe/Fidelity grade polish
   ═══════════════════════════════════════════════════════════ */

/* Sections: consistent generous spacing */
.hp-hero {
  padding: 5rem 0 4rem !important;
  background: linear-gradient(180deg, #FAFFF9 0%, #FFFFFF 100%) !important;
}

/* Section spacing: 5rem between major sections */
.hp-steps,
.hp-feed,
.hp-categories,
.hp-testimonials,
.hp-pricing,
.hp-stats,
.hp-payouts,
.hp-email-capture,
.hp-for-business,
.hp-bounty,
.hp-sotd,
.hp-cotd,
.hp-final-cta {
  padding-top: 4rem !important;
  padding-bottom: 4rem !important;
}

/* Alternating section backgrounds for visual rhythm */
.hp-steps {
  background: #FFFFFF !important;
}
.hp-categories {
  background: #F9FAFB !important;
}
.hp-testimonials {
  background: #FFFFFF !important;
}
.hp-pricing {
  background: #F9FAFB !important;
}
.hp-stats {
  background: #FFFFFF !important;
}
.hp-email-capture {
  background: #F9FAFB !important;
}
.hp-final-cta {
  background: #FFFFFF !important;
  padding-top: 5rem !important;
  padding-bottom: 5rem !important;
}

/* Unclaimed section: deep dark bg with white text */
.hp-unclaimed {
  background: #0A1628 !important;
  color: #FFFFFF !important;
  -webkit-text-fill-color: #FFFFFF !important;
}
.hp-unclaimed__eyebrow {
  color: #6EE7B7 !important;
  -webkit-text-fill-color: #6EE7B7 !important;
}
.hp-unclaimed__number {
  color: #FFFFFF !important;
  -webkit-text-fill-color: #FFFFFF !important;
}
.hp-unclaimed__label,
.hp-unclaimed__label strong {
  color: rgba(255, 255, 255, 0.85) !important;
  -webkit-text-fill-color: rgba(255, 255, 255, 0.85) !important;
}

/* ═══════════════════════════════════════════════════════════
   7. MOBILE POLISH (≤768px)
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .hp-hero {
    padding: 2.5rem 0 2rem !important;
  }

  /* Section spacing tighter on mobile */
  .hp-steps,
  .hp-feed,
  .hp-categories,
  .hp-testimonials,
  .hp-pricing,
  .hp-stats,
  .hp-payouts,
  .hp-email-capture,
  .hp-for-business,
  .hp-bounty,
  .hp-sotd,
  .hp-cotd,
  .hp-final-cta {
    padding-top: 2.5rem !important;
    padding-bottom: 2.5rem !important;
  }

  /* Pricing grid: full width single column */
  .hp-pricing__grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  /* Category grid: 2-col on mobile */
  .hp-cat-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.75rem !important;
  }

  /* Step connector: hide on mobile (stack vertically) */
  .hp-steps__connector {
    display: none !important;
  }

  /* Payout cards: horizontal scroll on mobile for cleaner UX */
  .hp-payout-scroll {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding-bottom: 0.5rem !important;
    gap: 0.75rem !important;
  }
  .hp-payout-card {
    flex: 0 0 220px !important;
    min-width: 200px !important;
    max-width: none !important;
  }

  /* Email capture: stack on mobile */
  .hp-email-capture__row {
    flex-direction: column !important;
    gap: 0.75rem !important;
  }
  .hp-email-capture__input {
    width: 100% !important;
    font-size: 16px !important; /* prevent iOS zoom */
  }
  .hp-email-capture__btn {
    width: 100% !important;
  }
}

/* ═══════════════════════════════════════════════════════════
   8. BUTTONS — Premium solid fills, no cheap borders
   ═══════════════════════════════════════════════════════════ */

/* Primary: solid emerald */
.hp-hero__ctas .btn-primary,
.hp-pricing-card .btn-primary,
.hp-email-capture__btn,
.hp-final-cta .btn-primary,
.btn-primary {
  background: #00875A !important;
  color: #FFFFFF !important;
  -webkit-text-fill-color: #FFFFFF !important;
  border: none !important;
  border-radius: 10px !important;
  font-weight: 700 !important;
  box-shadow: 0 2px 8px rgba(0, 135, 90, 0.2) !important;
  transition: all 0.15s ease !important;
}
.btn-primary:hover {
  background: #006B4D !important;
  color: #FFFFFF !important;
  -webkit-text-fill-color: #FFFFFF !important;
  box-shadow: 0 4px 16px rgba(0, 135, 90, 0.3) !important;
  transform: translateY(-1px) !important;
}
.btn-primary:focus-visible {
  outline: 2px solid #00875A !important;
  outline-offset: 2px !important;
}

/* Secondary: soft emerald fill */
.btn-secondary {
  background: #F0FDF4 !important;
  color: #065F46 !important;
  -webkit-text-fill-color: #065F46 !important;
  border: none !important;
  border-radius: 10px !important;
  font-weight: 700 !important;
}
.btn-secondary:hover {
  background: #DCFCE7 !important;
  color: #065F46 !important;
}

/* Ghost: transparent, no border */
.btn-ghost {
  background: transparent !important;
  color: #00875A !important;
  -webkit-text-fill-color: #00875A !important;
  border: none !important;
  font-weight: 700 !important;
}
.btn-ghost:hover {
  background: #F0FDF4 !important;
}
