/* ── Navbar ─────────────────────────────────────────────────────────────────── */

.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--line);
  transition: background var(--transition), border-color var(--transition);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
}

.navbar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
}

.navbar-logo svg {
  width: 28px;
  height: 28px;
}

.nav-links {
  display: none;
  list-style: none;
  gap: 32px;
  align-items: center;
}

.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-sub);
  text-decoration: none;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--ink);
  border-bottom-color: var(--green);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hamburger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  border-radius: 1px;
  transition: transform var(--transition), opacity var(--transition);
}

.hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* Mobile menu */
.mobile-menu {
  display: none;
  flex-direction: column;
  gap: 0;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--line);
  padding: 8px 20px 16px;
}

.mobile-menu.open { display: flex; }

.mobile-menu a {
  display: block;
  padding: 12px 0;
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink-sub);
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}

.mobile-menu a:last-child { border-bottom: none; }

.mobile-menu a:hover,
.mobile-menu a.active { color: var(--green); }

@media (min-width: 768px) {
  .nav-links { display: flex; }
  .hamburger { display: none; }
  .mobile-menu { display: none !important; }
}

/* ── Theme Toggle ──────────────────────────────────────────────────────────── */

.theme-toggle {
  background: none;
  border: 1px solid var(--line);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ink-sub);
  font-size: 1.1rem;
  transition: border-color var(--transition), color var(--transition);
}

.theme-toggle:hover {
  border-color: var(--green);
  color: var(--green);
}

/* ── Buttons ───────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  border: none;
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--green);
  color: #fff;
}
.btn-primary:hover {
  background: var(--green-mid);
  color: #fff;
  box-shadow: var(--shadow-md);
}

.btn-outline {
  background: transparent;
  color: var(--green);
  border: 1.5px solid var(--green);
}
.btn-outline:hover {
  background: var(--green-tint);
  color: var(--green);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
}

.btn-lg {
  padding: 14px 32px;
  font-size: 1.05rem;
}

/* ── Cards ──────────────────────────────────────────────────────────────────── */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-alt {
  background: var(--card-alt);
}

.card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--green-tint);
  color: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 16px;
}

.card h3 {
  margin-bottom: 8px;
}

.card p {
  font-size: 0.9rem;
  color: var(--ink-sub);
}

/* ── Score Ring ─────────────────────────────────────────────────────────────── */

.score-ring {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  flex-shrink: 0;
}

.score-ring.excellent { background: var(--green-tint); color: var(--green); border: 3px solid var(--green); }
.score-ring.good { background: var(--green-tint); color: var(--green-mid); border: 3px solid var(--green-mid); }
.score-ring.fair { background: var(--amber-tint); color: var(--amber); border: 3px solid var(--amber); }
.score-ring.poor { background: #f5dada; color: var(--red); border: 3px solid var(--red); }

[data-theme="dark"] .score-ring.poor { background: #2a1414; }

/* ── Badges / Chips ────────────────────────────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-green { background: var(--green-tint); color: var(--green); }
.badge-amber { background: var(--amber-tint); color: var(--amber); }

/* ── Search Input ──────────────────────────────────────────────────────────── */

.search-wrap {
  position: relative;
  max-width: 560px;
  width: 100%;
}

.search-input {
  width: 100%;
  padding: 14px 16px 14px 44px;
  border: 1.5px solid var(--line2);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--ink);
  font-size: 1rem;
  font-family: var(--font);
  outline: none;
  transition: border-color var(--transition), background var(--transition);
}

.search-input::placeholder { color: var(--placeholder); }
.search-input:focus { border-color: var(--green); }

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-faint);
  font-size: 1.1rem;
  pointer-events: none;
}

.search-clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--ink-faint);
  cursor: pointer;
  font-size: 1.1rem;
  display: none;
  padding: 4px;
}

.search-clear.visible { display: block; }

/* ── Dropdown / Suggestions ────────────────────────────────────────────────── */

.dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  z-index: 50;
  max-height: 280px;
  overflow-y: auto;
  display: none;
}

.dropdown.open { display: block; }

.dropdown-item {
  padding: 12px 16px;
  cursor: pointer;
  transition: background var(--transition);
  border-bottom: 1px solid var(--line);
}

.dropdown-item:last-child { border-bottom: none; }

.dropdown-item:hover,
.dropdown-item.focused {
  background: var(--green-tint);
}

.dropdown-item-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
}

.dropdown-item-sub {
  font-size: 0.8rem;
  color: var(--ink-sub);
  margin-top: 2px;
}

/* ── FAQ Accordion ─────────────────────────────────────────────────────────── */

.faq-item {
  border-bottom: 1px solid var(--line);
}

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
  background: none;
  border: none;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  font-family: var(--font);
}

.faq-question:hover { color: var(--green); }

.faq-chevron {
  font-size: 0.9rem;
  color: var(--ink-faint);
  transition: transform var(--transition);
  flex-shrink: 0;
  margin-left: 16px;
}

.faq-item.open .faq-chevron {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.faq-answer-inner {
  padding: 0 0 20px;
  font-size: 0.9rem;
  color: var(--ink-sub);
  line-height: 1.7;
}

/* ── Footer ────────────────────────────────────────────────────────────────── */

.footer {
  background: var(--card);
  border-top: 1px solid var(--line);
  padding: 48px 0 32px;
  transition: background var(--transition), border-color var(--transition);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.footer-links {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-links a {
  font-size: 0.85rem;
  color: var(--ink-sub);
}

.footer-links a:hover { color: var(--green); }

.footer-copy {
  font-size: 0.8rem;
  color: var(--ink-faint);
}

/* ── Skeleton Loader ───────────────────────────────────────────────────────── */

.skeleton {
  background: var(--line);
  border-radius: var(--radius-sm);
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ── Conditions Result Card ────────────────────────────────────────────────── */

.conditions-card {
  padding: 24px;
}

.conditions-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}

.conditions-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink);
}

.conditions-label {
  font-size: 0.9rem;
  color: var(--ink-sub);
  margin-top: 2px;
}

.conditions-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.metric {
  text-align: center;
  padding: 12px;
  background: var(--card-alt);
  border-radius: var(--radius-sm);
}

.metric-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink);
}

.metric-label {
  font-size: 0.75rem;
  color: var(--ink-sub);
  margin-top: 2px;
}

/* ── Upsell Card ───────────────────────────────────────────────────────────── */

.upsell {
  background: var(--green-tint);
  border: 1px solid var(--green-pale);
  border-radius: var(--radius);
  padding: 24px;
}

.upsell h4 {
  font-size: 1rem;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.upsell ul {
  list-style: none;
  margin-bottom: 16px;
}

.upsell li {
  padding: 6px 0;
  font-size: 0.9rem;
  color: var(--ink-sub);
  display: flex;
  align-items: center;
  gap: 8px;
}

.upsell li::before {
  content: "✓";
  color: var(--green);
  font-weight: 700;
}

/* ── Blog Cards ────────────────────────────────────────────────────────────── */

.blog-card {
  display: flex;
  flex-direction: column;
}

.blog-card-body {
  padding: 24px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.blog-card-category {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--green);
  margin-bottom: 8px;
}

.blog-card-title {
  font-size: 1.1rem;
  margin-bottom: 8px;
  color: var(--ink);
}

.blog-card-excerpt {
  font-size: 0.85rem;
  color: var(--ink-sub);
  margin-bottom: 12px;
  flex: 1;
}

.blog-card-meta {
  font-size: 0.75rem;
  color: var(--ink-faint);
}

/* ── Feature Row (alternating) ─────────────────────────────────────────────── */

.feature-row {
  display: flex;
  flex-direction: column;
  gap: 32px;
  align-items: center;
}

.feature-row.reverse { flex-direction: column; }

.feature-row-content { flex: 1; }
.feature-row-visual {
  flex: 1;
  background: var(--card-alt);
  border-radius: var(--radius);
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-faint);
  font-size: 0.85rem;
  border: 1px solid var(--line);
}

@media (min-width: 768px) {
  .feature-row { flex-direction: row; }
  .feature-row.reverse { flex-direction: row-reverse; }
}

/* ── How It Works Steps ────────────────────────────────────────────────────── */

.steps {
  counter-reset: step;
}

.step {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}

.step:last-child { border-bottom: none; }

.step-num {
  counter-increment: step;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--green-tint);
  color: var(--green);
  font-weight: 700;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-content h3 {
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.step-content p {
  font-size: 0.9rem;
  color: var(--ink-sub);
}

/* ── Popular Rivers Chips ──────────────────────────────────────────────────── */

.river-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.river-chip {
  padding: 6px 14px;
  border-radius: 100px;
  background: var(--card);
  border: 1px solid var(--line);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--ink-sub);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
  text-decoration: none;
}

.river-chip:hover {
  background: var(--green-tint);
  border-color: var(--green-pale);
  color: var(--green);
}

/* ── Tooltip ───────────────────────────────────────────────────────────────── */

.tooltip {
  position: relative;
  cursor: help;
  border-bottom: 1px dotted var(--ink-faint);
}

.tooltip::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--page-bg);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 400;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 20;
}

.tooltip:hover::after { opacity: 1; }

/* ── Breadcrumbs ───────────────────────────────────────────────────────────── */

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--ink-faint);
  margin-bottom: 24px;
}

.breadcrumbs a { color: var(--ink-sub); }
.breadcrumbs a:hover { color: var(--green); }
.breadcrumbs span { color: var(--ink-faint); }

/* ── Loading Spinner ───────────────────────────────────────────────────────── */

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--line);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Empty / No Results ────────────────────────────────────────────────────── */

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--ink-sub);
}

.empty-state p {
  margin-bottom: 12px;
}
