/* ================================================================
   AIDiveForge 2026 Visual Refresh
   Additive layer on top of hivepress-dark.css + ai-background.css.
   Adds: gradient accent system, Inter typography, pricing pill
   badges, hero polish.
   ================================================================ */

:root {
  --adf-bg:          #0a0a0a;
  --adf-surface:     #111827;
  --adf-card:        #1f2937;
  --adf-text:        #f3f4f6;
  --adf-text-muted:  rgba(243, 244, 246, 0.72);
  --adf-cyan:        #22d3ee;
  --adf-purple:      #a855f7;
  --adf-gradient:    linear-gradient(135deg, #a855f7 0%, #22d3ee 100%);
  --adf-gradient-soft: linear-gradient(135deg, rgba(168,85,247,0.15) 0%, rgba(34,211,238,0.15) 100%);
}

/* ----------------------------------------------------------------
   1. TYPOGRAPHY — Inter for body, Poppins for headings
   ---------------------------------------------------------------- */
body,
.wp-site-blocks,
.hp-listing,
.hp-form,
input, textarea, select, button {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI',
               Roboto, Oxygen, Ubuntu, sans-serif !important;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6,
.wp-block-heading,
.hp-listing__title {
  font-family: 'Poppins', 'Inter', sans-serif !important;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* ----------------------------------------------------------------
   2. GRADIENT ACCENTS (purple → cyan)
   ---------------------------------------------------------------- */
.adf-gradient-text,
.wp-block-post-title a:hover,
.hp-listing__title a:hover {
  background: var(--adf-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Gradient buttons */
.wp-block-button.is-style-gradient .wp-block-button__link,
.adf-btn-gradient,
.hp-form__button--submit,
button.hp-button[data-type="submit"] {
  background: var(--adf-gradient) !important;
  border: none !important;
  color: #fff !important;
  font-weight: 600 !important;
  padding: 0.85rem 1.6rem !important;
  border-radius: 8px !important;
  box-shadow: 0 4px 24px rgba(168, 85, 247, 0.25);
  transition: transform .2s ease, box-shadow .2s ease;
}
.wp-block-button.is-style-gradient .wp-block-button__link:hover,
.adf-btn-gradient:hover,
.hp-form__button--submit:hover,
button.hp-button[data-type="submit"]:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 32px rgba(34, 211, 238, 0.35);
}

/* ----------------------------------------------------------------
   3. PRICING TIER PILL BADGES
   Hook into the hp_pricing_tier attribute output. HivePress wraps
   attribute values in .hp-listing__attribute--pricing-tier.
   ---------------------------------------------------------------- */
.hp-listing__attribute--pricing-tier {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  border: 1px solid currentColor;
}
/* Color variants — driven by text content via :has() (modern browsers).
   Fallback: all pills get cyan styling above. */
.hp-listing__attribute--pricing-tier:has(*:is(:contains("Free"))),
.hp-listing__attribute--pricing-tier[data-value="Free"] {
  color: #4ade80;
  background: rgba(74, 222, 128, 0.10);
}
.hp-listing__attribute--pricing-tier[data-value="Freemium"] {
  color: #22d3ee;
  background: rgba(34, 211, 238, 0.10);
}
.hp-listing__attribute--pricing-tier[data-value="Paid"] {
  color: #a855f7;
  background: rgba(168, 85, 247, 0.10);
}
.hp-listing__attribute--pricing-tier[data-value="Enterprise"] {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.10);
}

/* ----------------------------------------------------------------
   4. CARD POLISH — slightly lighter card surface + border glow
   Layered on top of hivepress-dark.css existing rules.
   ---------------------------------------------------------------- */
.hp-listing--view-block {
  background: var(--adf-card) !important;
  border-color: rgba(255,255,255,0.06) !important;
}
.hp-listing--view-block:hover {
  border-image: var(--adf-gradient) 1;
  box-shadow:
    0 0 32px rgba(168, 85, 247, 0.18),
    0 0 32px rgba(34, 211, 238, 0.12),
    0 8px 32px rgba(0,0,0,0.5) !important;
}

/* ----------------------------------------------------------------
   5. HERO POLISH — bigger headline, gradient on key words,
   bigger search input. Targets the front page hero block.
   ---------------------------------------------------------------- */
.home .wp-block-cover__inner-container h1,
.home .wp-block-group.is-hero h1,
.adf-hero h1 {
  font-size: clamp(2.25rem, 5vw, 4.25rem);
  line-height: 1.05;
  font-weight: 800;
  margin-bottom: 0.75rem;
}
.home .wp-block-cover__inner-container h1 .adf-accent,
.adf-hero h1 .adf-accent {
  background: var(--adf-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Big centered search */
.adf-hero .hp-form,
.home .hp-form--listing-search {
  max-width: 720px;
  margin: 1.5rem auto 0;
}
.adf-hero .hp-form input[type="text"],
.home .hp-form--listing-search input[type="text"] {
  font-size: 1.1rem !important;
  padding: 1.1rem 1.4rem !important;
  background: rgba(17, 24, 39, 0.85) !important;
  border: 1px solid rgba(255,255,255,0.10) !important;
  border-radius: 12px !important;
  color: #fff !important;
  backdrop-filter: blur(8px);
}
.adf-hero .hp-form input[type="text"]:focus,
.home .hp-form--listing-search input[type="text"]:focus {
  border-color: var(--adf-cyan) !important;
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.15) !important;
  outline: none !important;
}

/* Trust signals row under hero */
.adf-hero-trust {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1.5rem;
  color: var(--adf-text-muted);
  font-size: 0.9rem;
}
.adf-hero-trust span { display: inline-flex; align-items: center; gap: 0.4rem; }
.adf-hero-trust strong { color: #fff; font-weight: 700; }

/* ================================================================
   PHASE 1 — QUICK WINS LAYER
   ================================================================ */

/* ----------------------------------------------------------------
   P1.1  Pricing tier — Open Source variant + price-display sibling
   ---------------------------------------------------------------- */
.hp-listing__attribute--pricing-tier[data-value="Open Source"],
.hp-listing__attribute--pricing-tier[data-value="open_source"] {
  color: #34d399;
  background: rgba(52, 211, 153, 0.10);
  border-color: #34d399;
}

/* Actual price display ("from $15/mo") shown beside the pill */
.adf-price-display,
.hp-listing__attribute--price-display {
  display: inline-block;
  margin-left: 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--adf-text-muted);
  letter-spacing: 0.01em;
}
.adf-price-display::before { content: "·  "; opacity: 0.6; }

/* ----------------------------------------------------------------
   P1.2  Hashtag-style category chips
   Restyle existing .hp-listing__category a chips to read as #tags.
   ---------------------------------------------------------------- */
.hp-listing__category a::before,
.hp-listing__categories a::before {
  content: "#";
  opacity: 0.6;
  margin-right: 1px;
}
.hp-listing__category a,
.hp-listing__categories a {
  text-transform: lowercase;
  font-feature-settings: "tnum";
}

/* Public favorite count on cards (shown next to the heart) */
.hp-listing .hp-favorite__count,
.hp-listing__favorite-count {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--adf-text-muted);
  margin-left: 0.25rem;
}

/* Verified editorial badge */
.adf-verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #34d399;
  background: rgba(52, 211, 153, 0.10);
  border: 1px solid rgba(52, 211, 153, 0.35);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  vertical-align: middle;
}
.adf-verified-badge::before {
  content: "✓";
  font-weight: 900;
}

/* ----------------------------------------------------------------
   P1.3  Navigation + conversion
   ---------------------------------------------------------------- */
/* "Join Free" pill in the primary nav */
.wp-block-navigation .wp-block-navigation-item.adf-nav-cta a,
.menu-item.adf-nav-cta > a {
  background: var(--adf-gradient) !important;
  color: #fff !important;
  padding: 0.55rem 1.1rem !important;
  border-radius: 999px !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 18px rgba(168, 85, 247, 0.30);
  transition: transform .15s ease, box-shadow .15s ease;
}
.wp-block-navigation .wp-block-navigation-item.adf-nav-cta a:hover,
.menu-item.adf-nav-cta > a:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(34, 211, 238, 0.35);
}

/* Sticky "Visit Tool" CTA on listing detail pages */
.single-hp_listing .hp-listing__action--render,
.single-hp_listing .hp-listing-actions,
.single-hp_listing aside.hp-listing__sidebar {
  position: sticky;
  top: 96px;
  align-self: flex-start;
}

/* Breadcrumbs (works with RankMath/Yoast/HivePress output) */
.rank-math-breadcrumb,
.yoast-breadcrumbs,
.hp-breadcrumbs {
  font-size: 0.85rem;
  color: var(--adf-text-muted);
  padding: 0.75rem 0;
}
.rank-math-breadcrumb a,
.yoast-breadcrumbs a,
.hp-breadcrumbs a { color: var(--adf-cyan); text-decoration: none; }

/* ----------------------------------------------------------------
   P1.4  Browse polish
   ---------------------------------------------------------------- */
/* "Show Tags" progressive-disclosure toggle beside the search */
.adf-show-tags-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  color: var(--adf-text);
  padding: 0.7rem 1.1rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease;
}
.adf-show-tags-toggle:hover {
  border-color: var(--adf-cyan);
  background: rgba(34, 211, 238, 0.06);
}
.adf-show-tags-toggle[aria-expanded="true"] { border-color: var(--adf-cyan); }
.adf-tag-cloud {
  display: none;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(17, 24, 39, 0.6);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
}
.adf-tag-cloud.is-open { display: flex; }
.adf-tag-cloud a {
  font-size: 0.8rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.08);
  color: var(--adf-cyan);
  border: 1px solid rgba(34, 211, 238, 0.25);
  text-decoration: none;
}
.adf-tag-cloud a:hover { background: rgba(34, 211, 238, 0.18); }

/* Grouped category page subcategory headings */
.tax-hp_listing_category .adf-subcategory-group { margin-bottom: 3rem; }
.tax-hp_listing_category .adf-subcategory-group > h2 {
  font-size: 1.5rem;
  margin: 0 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.tax-hp_listing_category .adf-subcategory-group > h2 small {
  font-size: 0.8rem;
  color: var(--adf-text-muted);
  font-weight: 500;
}

/* ================================================================
   PHASE 2 — EDITORIAL RATING METHODOLOGY
   ================================================================ */

.adf-rating-block {
  background: var(--adf-card);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  padding: 1.75rem;
  margin: 2rem 0;
}
.adf-rating-block__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.adf-rating-block__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
}
.adf-rating-block__average {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  background: var(--adf-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 2.25rem;
  font-weight: 800;
  font-family: 'Poppins', sans-serif;
}
.adf-rating-block__average small {
  font-size: 1rem;
  color: var(--adf-text-muted);
  -webkit-text-fill-color: var(--adf-text-muted);
}
.adf-rating-block__methodology-link {
  display: inline-block;
  font-size: 0.78rem;
  color: var(--adf-cyan);
  text-decoration: none;
  margin-top: 0.25rem;
}
.adf-rating-block__methodology-link:hover { text-decoration: underline; }

.adf-rating-block__body {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 1fr;
  gap: 2rem;
  align-items: center;
}
@media (max-width: 720px) {
  .adf-rating-block__body { grid-template-columns: 1fr; }
}

/* Radar chart canvas wrapper */
.adf-rating-radar {
  position: relative;
  aspect-ratio: 1 / 1;
  max-width: 360px;
  margin: 0 auto;
}

/* Score grid (right side of radar) */
.adf-rating-scores {
  display: grid;
  gap: 0.65rem;
}
.adf-rating-scores__row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.75rem;
}
.adf-rating-scores__label {
  font-size: 0.85rem;
  color: var(--adf-text);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.adf-rating-scores__bar {
  position: relative;
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
  overflow: hidden;
}
.adf-rating-scores__bar::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--score, 0%);
  background: var(--adf-gradient);
  border-radius: 999px;
}
.adf-rating-scores__value {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--adf-text);
  font-size: 0.9rem;
  min-width: 2.5rem;
  text-align: right;
}
.adf-rating-scores__value small {
  color: var(--adf-text-muted);
  font-weight: 500;
}

/* Methodology page */
.adf-methodology .adf-criterion {
  background: var(--adf-card);
  border: 1px solid rgba(255,255,255,0.06);
  border-left: 3px solid var(--adf-cyan);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
}
.adf-methodology .adf-criterion h3 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
}
.adf-methodology .adf-criterion p {
  margin: 0;
  color: var(--adf-text-muted);
  font-size: 0.92rem;
}

/* ================================================================
   NEWSLETTER — capture form ([adf_subscribe] shortcode)
   ================================================================ */
.adf-subscribe {
  max-width: 520px;
  margin: 1.5rem auto 0;
}
.adf-subscribe__row {
  display: flex;
  gap: 0.5rem;
  background: rgba(17, 24, 39, 0.85);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 12px;
  padding: 0.4rem;
  backdrop-filter: blur(8px);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.adf-subscribe__row:focus-within {
  border-color: var(--adf-cyan);
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.15);
}
.adf-subscribe__row input[type="email"] {
  flex: 1;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  color: #fff !important;
  font-size: 1rem !important;
  padding: 0.6rem 0.85rem !important;
}
.adf-subscribe__row input[type="email"]::placeholder { color: rgba(255,255,255,0.4); }
.adf-subscribe__row button {
  background: var(--adf-gradient);
  color: #fff;
  border: none;
  font-weight: 700;
  padding: 0.6rem 1.2rem;
  border-radius: 9px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 18px rgba(168, 85, 247, 0.30);
  transition: transform .15s ease, box-shadow .15s ease;
}
.adf-subscribe__row button:hover { transform: translateY(-1px); }
.adf-subscribe__row button:disabled { opacity: 0.6; cursor: wait; }
.adf-subscribe__note {
  text-align: center;
  font-size: 0.78rem;
  color: var(--adf-text-muted);
  margin: 0.65rem 0 0;
}
.adf-subscribe__msg {
  text-align: center;
  font-size: 0.88rem;
  margin: 0.65rem 0 0;
  min-height: 1.2em;
}
.adf-subscribe__msg.is-ok  { color: #34d399; }
.adf-subscribe__msg.is-err { color: #f87171; }
