/* ============================================================
   ParentingPath — Interactive Component Styles
   Load after components.css, before responsive.css
   ============================================================ */

/* ===========================
   ANIMATED COUNTER
   =========================== */
.counter {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.counter-stat {
  text-align: center;
  padding: 24px 16px;
}

.counter-stat .counter {
  font-size: var(--fs-display-lg);
  font-weight: 600;
  color: var(--navy);
  display: block;
  margin-bottom: 8px;
}

.counter-stat .counter-label {
  font-family: var(--font-body);
  font-size: var(--fs-label);
  color: var(--mid);
}

.stats-strip {
  display: flex;
  justify-content: center;
  gap: 48px;
  padding: 40px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: 48px 0;
}

@media (max-width: 767px) {
  .stats-strip {
    flex-wrap: wrap;
    gap: 24px;
  }
  .counter-stat { flex: 1 1 40%; }
}

/* ===========================
   CAROUSEL (Generic)
   =========================== */
.carousel {
  position: relative;
  overflow: hidden;
}

.carousel-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity var(--duration-medium) var(--ease-move);
  pointer-events: none;
}

.carousel-slide.is-active {
  position: relative;
  opacity: 1;
  pointer-events: auto;
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--border);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background var(--duration-short) var(--ease-move), width var(--duration-short) var(--ease-move);
}

.carousel-dot.is-active {
  width: 24px;
  background: var(--navy);
}

/* ===========================
   TAB SYSTEM
   =========================== */
.tab-bar {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--stone);
  border-radius: var(--radius-sm);
  margin-bottom: 32px;
  width: fit-content;
}

.tab-btn {
  font-family: var(--font-body);
  font-size: var(--fs-label);
  font-weight: 500;
  color: var(--mid);
  background: none;
  border: none;
  padding: 8px 20px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all var(--duration-short) var(--ease-move);
  white-space: nowrap;
}

.tab-btn.is-active {
  background: var(--white);
  color: var(--navy);
  box-shadow: var(--shadow-sm);
}

.tab-btn:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: block;
}

/* ===========================
   FILTER PILLS
   =========================== */
.filter-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.filter-pill {
  font-family: var(--font-body);
  font-size: var(--fs-meta);
  font-weight: 500;
  color: var(--mid);
  background: var(--white);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--duration-short) var(--ease-move);
}

.filter-pill:hover {
  border-color: var(--navy);
  color: var(--navy);
}

.filter-pill.is-active {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}

.filter-pill:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* Cards being filtered */
.filter-target {
  transition: opacity var(--duration-medium) var(--ease-move), transform var(--duration-medium) var(--ease-move);
}

.filter-target.is-hidden {
  opacity: 0;
  transform: scale(0.95);
  pointer-events: none;
  position: absolute;
  visibility: hidden;
}

/* ===========================
   SVG LINE DRAW
   =========================== */
.svg-draw path,
.svg-draw line,
.svg-draw polyline {
  stroke-dasharray: var(--path-length, 100);
  stroke-dashoffset: var(--path-length, 100);
  transition: stroke-dashoffset 0.8s var(--ease-enter);
}

.svg-draw.is-drawn path,
.svg-draw.is-drawn line,
.svg-draw.is-drawn polyline {
  stroke-dashoffset: 0;
}

/* ===========================
   ANIMATED BAR
   =========================== */
.animated-bar-track {
  height: 8px;
  background: var(--stone);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.animated-bar-fill {
  height: 100%;
  width: 0;
  border-radius: var(--radius-full);
  transition: width 1s var(--ease-enter);
}

.animated-bar-fill.is-filled {
  width: var(--bar-width, 0%);
}

.bar-green { background: var(--success); }
.bar-amber { background: var(--amber); }
.bar-red { background: var(--danger); }
.bar-navy { background: var(--navy); }

/* ===========================
   SCORE GAUGE
   =========================== */
.score-gauge {
  display: flex;
  align-items: center;
  gap: 12px;
}

.score-gauge-bar {
  flex: 1;
  height: 6px;
  background: var(--stone);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.score-gauge-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width var(--duration-medium) var(--ease-move), background-color var(--duration-medium) var(--ease-move);
}

.score-gauge-value {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 600;
  min-width: 40px;
  text-align: right;
}

/* ===========================
   PROGRESS RING (SVG circle)
   =========================== */
.progress-ring circle {
  transition: stroke-dashoffset 0.8s var(--ease-enter);
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
}

/* ===========================
   PHASE STEPPER
   =========================== */
.phase-stepper {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 48px;
}

.phase-step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: var(--fs-label);
  font-weight: 500;
  color: var(--mid);
  padding: 10px 16px;
  cursor: pointer;
  border: none;
  background: none;
  transition: color var(--duration-short) var(--ease-move);
  white-space: nowrap;
}

.phase-step-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border-strong);
  transition: background var(--duration-short) var(--ease-move), transform var(--duration-short) var(--ease-move);
}

.phase-step.is-active .phase-step-dot {
  background: var(--navy);
  transform: scale(1.3);
}

.phase-step.is-active {
  color: var(--navy);
  font-weight: 600;
}

.phase-step.is-complete .phase-step-dot {
  background: var(--success);
}

.phase-connector {
  flex: 1;
  height: 2px;
  background: var(--border);
  position: relative;
}

.phase-connector-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0;
  background: var(--navy);
  transition: width var(--duration-long) var(--ease-move);
}

/* ===========================
   SPLIT BAR (expense tracking)
   =========================== */
.split-bar {
  display: flex;
  height: 32px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  width: 100%;
}

.split-bar-segment {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  font-weight: 600;
  color: var(--white);
  transition: width var(--duration-medium) var(--ease-move);
}

.split-bar-a { background: var(--navy); }
.split-bar-b { background: var(--mist); color: var(--charcoal); }

/* ===========================
   BEFORE / AFTER CARD
   =========================== */
.before-after {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.before-card,
.after-card {
  padding: 24px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.before-card {
  background: rgba(192, 106, 91, 0.06);
  border-color: rgba(192, 106, 91, 0.2);
}

.after-card {
  background: rgba(110, 143, 122, 0.06);
  border-color: rgba(110, 143, 122, 0.2);
}

.before-card .card-label { color: var(--danger); }
.after-card .card-label { color: var(--success); }

.card-label {
  font-family: var(--font-body);
  font-size: var(--fs-micro);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

@media (max-width: 479px) {
  .before-after { grid-template-columns: 1fr; }
}

/* ===========================
   PULSE DOT
   =========================== */
.pulse-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse-dot 2s ease-in-out infinite;
}

.pulse-dot-amber { background: var(--amber); }
.pulse-dot-danger { background: var(--danger); }

/* ===========================
   COST CALCULATOR
   =========================== */
.calculator-widget {
  background: var(--stone);
  border-radius: var(--radius-md);
  padding: 32px;
  margin-bottom: 48px;
}

.calculator-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.calculator-label {
  font-family: var(--font-body);
  font-size: var(--fs-body-sm);
  color: var(--charcoal);
  min-width: 160px;
}

.calculator-select {
  font-family: var(--font-body);
  font-size: var(--fs-body-sm);
  padding: 8px 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--charcoal);
  cursor: pointer;
}

.calculator-result {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  margin-top: 24px;
}

.calculator-savings {
  font-family: var(--font-mono);
  font-size: var(--fs-heading-lg);
  font-weight: 700;
  color: var(--success);
}

@media (max-width: 767px) {
  .calculator-row { flex-direction: column; align-items: flex-start; gap: 8px; }
  .calculator-result { flex-direction: column; gap: 16px; text-align: center; }
}

/* ===========================
   STICKY CATEGORY NAV (FAQ)
   =========================== */
.sticky-category-nav {
  position: sticky;
  top: 112px; /* header height */
  z-index: 50;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.sticky-category-nav a {
  font-family: var(--font-body);
  font-size: var(--fs-meta);
  font-weight: 500;
  color: var(--mid);
  text-decoration: none;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  white-space: nowrap;
  transition: all var(--duration-short) var(--ease-move);
}

.sticky-category-nav a.is-active {
  background: var(--navy);
  color: var(--white);
}

/* ===========================
   TIMELINE (vertical SVG-based)
   =========================== */
.timeline {
  position: relative;
  padding-left: 48px;
}

.timeline-line {
  position: absolute;
  left: 16px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-line-fill {
  width: 100%;
  height: 0;
  background: var(--navy);
  transition: height 1.2s var(--ease-enter);
}

.timeline-line-fill.is-filled {
  height: 100%;
}

.timeline-item {
  position: relative;
  padding-bottom: 48px;
}

.timeline-dot {
  position: absolute;
  left: -40px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--white);
  border: 2px solid var(--border);
  transition: border-color var(--duration-short) var(--ease-move), background var(--duration-short) var(--ease-move);
}

.timeline-item.is-visible .timeline-dot {
  background: var(--navy);
  border-color: var(--navy);
}

.timeline-content {
  opacity: 0;
  transform: translateX(16px);
  transition: opacity var(--duration-medium) var(--ease-enter), transform var(--duration-medium) var(--ease-enter);
}

.timeline-item.is-visible .timeline-content {
  opacity: 1;
  transform: translateX(0);
}
