/* ============================================================
   Jazr How It Works Widget Styles
   ============================================================ */

/* ---- CSS Variables (mirrors existing design system) ---- */
:root {
  --jazr-primary: hsl(204, 80%, 36%);
  --jazr-accent: hsl(24, 100%, 61%);
  --jazr-secondary: hsl(210, 20%, 96%);
  --jazr-foreground: hsl(0, 0%, 10%);
  --jazr-background: hsl(0, 0%, 100%);
  --jazr-muted: hsl(0, 0%, 35%);
  --jazr-border: hsl(214, 32%, 91%);
  --jazr-card-bg: hsl(30, 100%, 95%);
  --jazr-card-highlight-bg: hsl(28, 80%, 90%);
}

/* ---- Section ---- */
.jazr-hiw-section {
  width: 100%;
  padding: 5rem 0;
  background-color: var(--jazr-background);
}

@media (min-width: 768px) {
  .jazr-hiw-section {
    padding: 8rem 0;
  }
}

/* ---- Container ---- */
.jazr-hiw-container {
  max-width: 1280px;
  margin: 0 auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 640px) {
  .jazr-hiw-container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .jazr-hiw-container {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

/* ---- Header ---- */
.jazr-hiw-header {
  text-align: center;
  margin-bottom: 3.5rem;
}

.jazr-hiw-eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--jazr-accent);
  margin: 0 0 0.5rem;
}

.jazr-hiw-title {
  font-size: 1.875rem;
  font-weight: 800;
  color: var(--jazr-foreground);
  margin: 0 0 0.75rem;
  line-height: 1.2;
}

@media (min-width: 768px) {
  .jazr-hiw-title {
    font-size: 2.25rem;
  }
}

.jazr-hiw-subtitle {
  font-size: 1rem;
  color: var(--jazr-muted);
  max-width: 28rem;
  margin: 0 auto;
  line-height: 1.6;
}

/* ---- Bottom Message ---- */
.jazr-hiw-bottom-msg {
  text-align: center;
  font-size: 1rem;
  color: var(--jazr-muted);
  margin-top: 3.5rem;
}

/* ============================================================
   DESKTOP FLOW (>= 768px)
   ============================================================ */

/* Mobile first: show mobile, hide desktop */
.jazr-hiw-flow--desktop {
  display: none !important;
}

.jazr-hiw-flow--mobile {
  display: flex !important;
}

/* Desktop: show desktop, hide mobile */
@media (min-width: 768px) {
  .jazr-hiw-flow--desktop {
    display: flex !important;
    align-items: flex-start;
    justify-content: center;
  }

  .jazr-hiw-flow--mobile {
    display: none !important;
  }
}

/* Step wrapper — each step takes equal space */
.jazr-hiw-step {
  flex: 1;
  display: flex;
  align-items: flex-start;
}

/* Card — fills the step wrapper */
.jazr-hiw-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
}

/* ---- Card label (above the box) ---- */
.jazr-hiw-card-label {
  font-size: 1.0625rem;
  font-weight: 800;
  color: var(--jazr-foreground);
  margin: 0 0 1.25rem;
  line-height: 1.3;
}

/* ---- Icon box ---- */
.jazr-hiw-icon-box {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  width: 100%;
  padding: 2rem 1rem;
  border-radius: 1rem;
  background-color: var(--jazr-card-bg);
  box-shadow: none;
  margin-bottom: 1.75rem;
  transition: box-shadow 0.3s ease;
}

.jazr-hiw-icon-box--highlight {
  background-color: var(--jazr-card-highlight-bg);
  box-shadow: none;
}

.jazr-hiw-icon-svg svg {
  width: 3rem;
  height: 3rem;
  color: var(--jazr-accent);
  display: block;
}

/* ---- Step number badge ---- */
.jazr-hiw-step-number {
  position: absolute;
  top: -0.75rem;
  right: -0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background-color: var(--jazr-accent);
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 700;
  box-shadow: 0 2px 8px 0 hsla(24, 100%, 61%, 0.4);
  z-index: 1;
}

/* ---- Human / AI badge ---- */
.jazr-hiw-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
}

.jazr-hiw-badge svg {
  flex-shrink: 0;
}

.jazr-hiw-badge--human {
  background-color: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.jazr-hiw-badge--ai {
  background-color: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

/* ---- Coming soon badge (below icon box) ---- */
.jazr-hiw-soon {
  position: absolute;
  bottom: -0.75rem;
  left: 50%;
  transform: translateX(-50%);
  background-color: hsl(30, 100%, 95%);
  color: var(--jazr-accent);
  border: 1px solid hsla(24, 100%, 61%, 0.35);
  border-radius: 9999px;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.2rem 0.75rem;
  white-space: nowrap;
  z-index: 1;
}

/* ---- Detail line ---- */
.jazr-hiw-detail {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--jazr-accent);
  margin: 0 0 1rem;
}

.jazr-hiw-detail svg {
  flex-shrink: 0;
  color: var(--jazr-accent);
}

/* ---- Bullet list ---- */
.jazr-hiw-bullets {
  list-style: none;
  margin: 0;
  padding: 0;
  text-align: left;
  width: 100%;
}

.jazr-hiw-bullets li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--jazr-muted);
  line-height: 1.5;
  margin-bottom: 0.625rem;
}

.jazr-hiw-bullets li:last-child {
  margin-bottom: 0;
}

.jazr-hiw-bullet-dot {
  display: block;
  flex-shrink: 0;
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 50%;
  background-color: var(--jazr-accent);
  margin-top: 0.4375rem;
}

/* ---- Connector between cards ---- */
.jazr-hiw-connector {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 1.5rem;
  /* Align with center of icon box:
     card-label (~2.5rem) + icon-box margin-bottom + icon-box padding-top (2rem) ≈ 5.75rem */
  margin-top: 5.75rem;
  padding-right: 1.375rem;
  overflow: visible;
}

/* Horizontal line — fills the full connector width */
.jazr-hiw-connector-line {
  display: block;
  height: 2px;
  width: 100%;
  background-color: var(--jazr-border);
  border-radius: 9999px;
  flex-shrink: 0;
}

/* Arrow tip — sits just outside the line on the right */
.jazr-hiw-arrow {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  color: var(--jazr-accent);
  display: flex;
  align-items: center;
  opacity: 0.8;
}

.jazr-hiw-arrow svg {
  width: 1.125rem;
  height: 1.125rem;
}

/* Traveling dot — rides along the connector line left → right */
.jazr-hiw-dot {
  display: block;
  position: absolute;
  top: 50%;
  left: 0;
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 50%;
  background-color: var(--jazr-accent);
  transform: translateY(-50%);
  opacity: 0;
  /* Total cycle = 1.8s travel + ~3s pause = 5s period */
  animation: jazrDotTravel 5s ease-in-out infinite;
  pointer-events: none;
  z-index: 2;
}

/* Inline animation-delay from PHP handles the stagger per connector */

@keyframes jazrDotTravel {
  /* sit invisible */
  0%   { left: 0%;    opacity: 0; }
  /* begin travel — fade in */
  2%   { left: 2%;    opacity: 1; }
  /* travel across full line width */
  34%  { left: 98%;   opacity: 1; }
  /* fade out at right edge */
  36%  { left: 100%;  opacity: 0; }
  /* stay invisible for the rest of the cycle (pause) */
  100% { left: 100%;  opacity: 0; }
}

/* ============================================================
   MOBILE FLOW (< 768px)
   ============================================================ */

.jazr-hiw-flow--mobile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.jazr-hiw-mobile-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 26rem;
}

/* Mobile card row */
.jazr-hiw-mobile-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  padding: 1.25rem;
  border-radius: 1rem;
  border: 1px solid var(--jazr-border);
  background-color: #fff;
  box-shadow: 0 2px 8px 0 rgba(0,0,0,0.06);
}

.jazr-hiw-mobile-card--highlight {
  border-color: hsla(204, 80%, 36%, 0.25);
  box-shadow: 0 4px 16px 0 rgba(19,111,163,0.12);
}

/* Mobile icon */
.jazr-hiw-mobile-icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 4rem;
  height: 4rem;
  border-radius: 0.75rem;
  background-color: var(--jazr-card-bg);
}

.jazr-hiw-mobile-icon--soon {
  border: 2px dashed hsla(204, 80%, 36%, 0.35);
}

.jazr-hiw-icon-svg--sm svg {
  width: 1.75rem;
  height: 1.75rem;
  color: var(--jazr-accent);
}

.jazr-hiw-step-number--sm {
  position: absolute;
  top: -0.5rem;
  right: -0.5rem;
  width: 1.5rem;
  height: 1.5rem;
  font-size: 0.6875rem;
  box-shadow: 0 1px 4px 0 hsla(24, 100%, 61%, 0.35);
}

/* Mobile text content */
.jazr-hiw-mobile-content {
  flex: 1;
  min-width: 0;
}

.jazr-hiw-mobile-badges {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin-bottom: 0.25rem;
}

.jazr-hiw-badge--sm {
  font-size: 0.625rem;
  padding: 0.15rem 0.5rem;
  gap: 0.25rem;
}

.jazr-hiw-badge--soon {
  background-color: hsl(30, 100%, 95%);
  color: var(--jazr-accent);
  border: 1px solid hsla(24, 100%, 61%, 0.35);
}

.jazr-hiw-mobile-label {
  font-size: 1rem;
  font-weight: 800;
  color: var(--jazr-foreground);
  margin: 0 0 0.375rem;
}

.jazr-hiw-bullets--sm li {
  font-size: 0.8125rem;
  margin-bottom: 0.375rem;
}

/* Vertical connector */
.jazr-hiw-vconnector {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2px;
  height: 2.5rem;
  margin: 0 auto;
}

.jazr-hiw-vconnector-line {
  width: 2px;
  height: 100%;
  background-color: var(--jazr-border);
  border-radius: 9999px;
}

/* Traveling dot (vertical) */
.jazr-hiw-vdot {
  position: absolute;
  left: 50%;
  top: 0;
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 50%;
  background-color: var(--jazr-accent);
  transform: translateX(-50%);
  opacity: 0;
  animation: jazrVdotTravel 1.2s ease-in-out infinite;
  pointer-events: none;
}

@keyframes jazrVdotTravel {
  0%   { top: 0%;   opacity: 0; }
  15%  { opacity: 1; }
  85%  { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

/* ============================================================
   SCROLL-TRIGGERED ANIMATIONS
   ============================================================ */

/* Cards start hidden when .jazr-hiw-animated is on section */
.jazr-hiw-animated .jazr-hiw-card,
.jazr-hiw-animated .jazr-hiw-mobile-card {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

/* Revealed by JS (IntersectionObserver) */
.jazr-hiw-animated .jazr-hiw-card.jazr-hiw-visible,
.jazr-hiw-animated .jazr-hiw-mobile-card.jazr-hiw-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Header also animates */
.jazr-hiw-animated .jazr-hiw-header {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.jazr-hiw-animated .jazr-hiw-header.jazr-hiw-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Bottom message animates */
.jazr-hiw-animated .jazr-hiw-bottom-msg {
  opacity: 0;
  transition: opacity 0.5s ease-out 0.6s;
}

.jazr-hiw-animated .jazr-hiw-bottom-msg.jazr-hiw-visible {
  opacity: 1;
}

/* Stagger delays — steps are direct children of the flow */
.jazr-hiw-flow--desktop > .jazr-hiw-step:nth-child(1) .jazr-hiw-card { transition-delay: 0s; }
.jazr-hiw-flow--desktop > .jazr-hiw-step:nth-child(2) .jazr-hiw-card { transition-delay: 0.15s; }
.jazr-hiw-flow--desktop > .jazr-hiw-step:nth-child(3) .jazr-hiw-card { transition-delay: 0.3s; }
.jazr-hiw-flow--desktop > .jazr-hiw-step:nth-child(4) .jazr-hiw-card { transition-delay: 0.45s; }

.jazr-hiw-mobile-step:nth-child(1) .jazr-hiw-mobile-card { transition-delay: 0s; }
.jazr-hiw-mobile-step:nth-child(2) .jazr-hiw-mobile-card { transition-delay: 0.1s; }
.jazr-hiw-mobile-step:nth-child(3) .jazr-hiw-mobile-card { transition-delay: 0.2s; }
.jazr-hiw-mobile-step:nth-child(4) .jazr-hiw-mobile-card { transition-delay: 0.3s; }
.jazr-hiw-mobile-step:nth-child(5) .jazr-hiw-mobile-card { transition-delay: 0.4s; }
