/* ============================================
   LEAKaware Escalation Graph
   ============================================ */

.leak-graph-container {
  width: 100% !important;
  max-width: none !important;
  margin: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.elementor-widget-leakaware_escalation {
  width: 100% !important;
  max-width: none !important;
}

.leak-graph-area {
  position: relative;
  width: 100%;
  height: 560px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  background: #ffffff;
}

/* ── Phases ── */
.leak-phases {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 1fr 2px 1fr;
  z-index: 1;
}

.leak-phase {
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
}

.leak-phase--prevention {
  background: #ffffff;
}

.leak-phase--damage {
  background: linear-gradient(135deg, rgba(239,68,68,0.03) 0%, rgba(239,68,68,0.10) 100%);
}

.leak-phase__header {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #334155;
  font-weight: 800;
  font-size: 18px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.leak-phase__subtitle {
  margin-top: 4px;
  color: #64748b;
  font-size: 14px;
  font-weight: 500;
}

.leak-phase-divider {
  background: linear-gradient(180deg, transparent 0%, #e2e8f0 15%, #e2e8f0 85%, transparent 100%);
  z-index: 10;
}

/* ── Indicators ── */
.leak-indicators {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

.leak-indicators--right {
  margin-top: auto;
  padding-bottom: 60px;
}

.leak-indicator {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: #1D293D;
  font-weight: 450;
  line-height: 1.35;
}

.leak-indicator__icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.leak-indicator__icon--blue {
  background: #ECF5FD;
  color: #64748b;
}

.leak-indicator__icon--red {
  background: #fef2f2;
  color: #f87171;
}

/* ── SVG Curve ── */
.leak-curve-svg {
  position: absolute;
  left: 0;
  bottom: 50px;
  width: 100%;
  height: calc(100% - 50px);
  z-index: 5;
  pointer-events: none;
}

.leak-curve-path {
  stroke-dasharray: 2200;
  stroke-dashoffset: 2200;
  animation: leakDrawCurve 2.5s cubic-bezier(0.4, 0, 0.2, 1) 0.3s forwards;
}

/* ── Dot groups (circle + label) ── */
.leak-dot-group {
  position: absolute;
  width: 0;
  height: 0;
  z-index: 20;
  opacity: 0;
}
.leak-dot-group--1 { animation: leakFadeIn 0.4s ease 0.8s forwards; }
.leak-dot-group--2 { animation: leakFadeIn 0.4s ease 1.2s forwards; }
.leak-dot-group--3 { animation: leakFadeIn 0.4s ease 1.6s forwards; }
.leak-dot-group--4 { animation: leakFadeIn 0.4s ease 2.0s forwards; }
.leak-dot-group--5 { animation: leakFadeIn 0.4s ease 2.4s forwards; }

.leak-dot-circle {
  position: absolute;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 4px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  left: -14px;
  bottom: -14px;
}

@keyframes leakDrawCurve {
  to { stroke-dashoffset: 0; }
}

@keyframes leakPopIn {
  0%   { opacity: 0; transform: scale(0); }
  60%  { transform: scale(1.3); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes leakFadeIn {
  to { opacity: 1; }
}

/* ── Alert Labels ── */
.leak-dot-group .leak-alert-label {
  position: absolute;
  top: 20px;
  left: -14px;
  background: #ffffff;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: #1D293D;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.06);
}

.leak-alert-label__brand {
  font-weight: 700;
}

/* ── Callout ── */
.leak-noticed-callout {
  position: absolute;
  bottom: 55px;
  left: 76%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 2px dashed #fca5a5;
  border-radius: 24px;
  background: rgba(254, 242, 242, 0.85);
  font-size: 13px;
  font-weight: 700;
  color: #ef4444;
  white-space: nowrap;
  z-index: 20;
  opacity: 0;
  animation: leakFadeIn 0.5s ease 2.8s forwards;
}

.leak-noticed-callout::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 100%;
  transform: translateX(-50%);
  width: 2px;
  height: 2000px;
  border-left: 2px dashed #fca5a5;
  z-index: 19;
}

/* ── Timeline ── */
.leak-timeline {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50px;
  z-index: 15;
  padding: 0 28px;
}

.leak-timeline__line {
  position: absolute;
  top: 0;
  left: 28px;
  right: 28px;
  height: 1px;
  background: #e2e8f0;
}

.leak-timeline__mark {
  position: absolute;
  top: 14px;
  transform: translateX(-50%);
  font-size: 12px;
  font-weight: 500;
  color: #64748b;
}

.leak-timeline__mark::before {
  content: '';
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 8px;
  background: #e2e8f0;
}

/* ── Mobile timeline (hidden on desktop) ── */
.leak-mobile-timeline {
  display: none;
}

/* ── Tablet ── */
@media (max-width: 1024px) and (min-width: 768px) {
  .leak-graph-area { height: 500px; }
  .leak-phase { padding: 18px 16px; }
  .leak-phase__header { font-size: 15px; }
  .leak-phase__header svg { width: 22px; height: 22px; }
  .leak-indicators { gap: 7px; margin-top: 14px; }
  .leak-indicator { font-size: 12px; gap: 8px; }
  .leak-indicator__icon { width: 30px; height: 30px; }
  .leak-indicator__icon svg { width: 15px; height: 15px; }
  .leak-dot-group .leak-alert-label { font-size: 10px; padding: 4px 10px; }
  .leak-noticed-callout { font-size: 11px; padding: 6px 12px; }
  .leak-timeline__mark { font-size: 10px; }
}

/* ── Mobile: vertical timeline ── */
@media (max-width: 767px) {
  .leak-graph-area {
    display: none !important;
  }

  .leak-mobile-timeline {
    display: block;
    font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    background: #ffffff;
  }

  /* ── Phase sections ── */
  .leak-mt-phase {
    padding: 20px 20px 16px;
  }

  .leak-mt-phase--prevention {
    background: #ffffff;
  }

  .leak-mt-phase--damage {
    background: linear-gradient(135deg, rgba(239,68,68,0.03) 0%, rgba(239,68,68,0.10) 100%);
  }

  .leak-mt-phase__header {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #334155;
  }

  .leak-mt-phase__header svg {
    flex-shrink: 0;
  }

  .leak-mt-phase__title {
    font-weight: 800;
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1.2;
  }

  .leak-mt-phase__sub {
    color: #64748b;
    font-size: 13px;
    font-weight: 500;
  }

  /* ── Indicators inside phases ── */
  .leak-mt-indicators {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 14px;
  }

  .leak-mt-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #1D293D;
    font-weight: 450;
    line-height: 1.35;
  }

  .leak-mt-indicator__icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .leak-mt-indicator__icon svg {
    width: 16px;
    height: 16px;
  }

  .leak-mt-indicator__icon--blue {
    background: #ECF5FD;
    color: #64748b;
  }

  .leak-mt-indicator__icon--red {
    background: #fef2f2;
    color: #f87171;
  }

  /* ── Vertical alert timeline ── */
  .leak-mt-alerts {
    position: relative;
    padding: 24px 20px 24px 48px;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
  }

  .leak-mt-alerts__line {
    position: absolute;
    left: 29px;
    top: 36px;
    bottom: 36px;
    width: 3px;
    border-radius: 2px;
  }

  /* ── Each alert step ── */
  .leak-mt-step {
    position: relative;
    padding-bottom: 20px;
    padding-left: 20px;
  }

  .leak-mt-step:last-child {
    padding-bottom: 0;
  }

  .leak-mt-step__dot {
    position: absolute;
    left: -19px;
    top: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 3px solid #ffffff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
    z-index: 2;
  }

  .leak-mt-step__content {
    padding-top: 0;
  }

  .leak-mt-step__time {
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
  }

  .leak-mt-step__label {
    font-size: 14px;
    font-weight: 600;
    color: #1D293D;
    line-height: 1.3;
  }

  .leak-mt-step__brand {
    font-weight: 700;
  }

  /* ── Callout between steps ── */
  .leak-mt-callout {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 8px 0 8px 20px;
    padding: 7px 14px;
    border: 2px dashed #fca5a5;
    border-radius: 20px;
    background: rgba(254, 242, 242, 0.9);
    font-size: 12px;
    font-weight: 700;
    color: #ef4444;
    width: fit-content;
  }

  .leak-mt-callout svg {
    flex-shrink: 0;
  }
}

/* ── Small mobile (< 380px) ── */
@media (max-width: 379px) {
  .leak-mt-phase { padding: 16px 14px 12px; }
  .leak-mt-indicator { font-size: 12px; gap: 8px; }
  .leak-mt-indicator__icon { width: 28px; height: 28px; }
  .leak-mt-indicator__icon svg { width: 14px; height: 14px; }
  .leak-mt-alerts { padding: 20px 14px 20px 42px; }
  .leak-mt-alerts__line { left: 23px; }
  .leak-mt-step__dot { left: -19px; width: 16px; height: 16px; }
  .leak-mt-step__label { font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  .leak-curve-path,
  .leak-dot-group,
  .leak-noticed-callout {
    animation: none !important;
    opacity: 1 !important;
    stroke-dashoffset: 0 !important;
    transform: scale(1) !important;
  }
}
