/* ============================================================
   TAQWA CRM — INTERACTIVE JOURNEY CURVE & OBSIDIAN DARK THEME
   Inspired by Moorly CRM & Talvo Cash Flow Dashboards
   Surface: #131916 + 1px glass border (rgba(255,255,255,0.06))
   Accents: Electric Lime (#C6FF00), Emerald (#00E676), Cyan (#00E5FF)
   ============================================================ */

/* ── Journey Mini Badges on Customer / Member Rows ───────── */
.journey-btn-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #ECFDF5;
  color: #047857;
  border: 1px solid #A7F3D0;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  cursor: pointer;
  line-height: 1.4;
  vertical-align: middle;
  text-decoration: none;
  transition: all 0.2s ease;
  margin-left: 6px;
  white-space: nowrap;
}
.journey-btn-badge:hover {
  background: #10B981;
  color: #FFFFFF;
  border-color: #10B981;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
}
.journey-btn-badge svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
}

/* ── Journey Modal Overlay ────────────────────────────────── */
.jc-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 6, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
.jc-modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* ── Main Modal Container ─────────────────────────────────── */
.jc-modal {
  width: 100%;
  max-width: 980px;
  max-height: 92vh;
  background: #090D0B;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.75), 0 0 1px rgba(0, 230, 118, 0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: #E2E8F0;
  transform: scale(0.96) translateY(12px);
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.jc-modal-overlay.open .jc-modal {
  transform: scale(1) translateY(0);
}

/* ── Modal Header ─────────────────────────────────────────── */
.jc-header {
  padding: 20px 26px;
  background: #0E1410;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.jc-customer-info {
  display: flex;
  align-items: center;
  gap: 14px;
}
.jc-avatar {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, #00E676, #008744);
  color: #090D0B;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  box-shadow: 0 0 18px rgba(0, 230, 118, 0.4);
}
.jc-name-wrap h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: #FFFFFF;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.jc-name-wrap p {
  margin: 2px 0 0;
  font-size: 13px;
  color: #94A3B8;
  display: flex;
  align-items: center;
  gap: 10px;
}
.jc-status-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.jc-status-member {
  background: rgba(0, 230, 118, 0.15);
  color: #00E676;
  border: 1px solid rgba(0, 230, 118, 0.4);
}
.jc-status-pending {
  background: rgba(255, 179, 0, 0.15);
  color: #FFB300;
  border: 1px solid rgba(255, 179, 0, 0.4);
}

.jc-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.jc-btn-play {
  background: #C6FF00;
  color: #090D0B;
  border: none;
  font-size: 12px;
  font-weight: 800;
  padding: 7px 14px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
  box-shadow: 0 0 16px rgba(198, 255, 0, 0.35);
}
.jc-btn-play:hover {
  background: #D4FF32;
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 0 22px rgba(198, 255, 0, 0.55);
}
.jc-btn-close {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94A3B8;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all 0.2s;
}
.jc-btn-close:hover {
  background: rgba(255, 82, 82, 0.2);
  color: #FF5252;
  border-color: rgba(255, 82, 82, 0.4);
}

/* ── Modal Body & Scrollable Area ─────────────────────────── */
.jc-body {
  padding: 24px 26px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.jc-body::-webkit-scrollbar {
  width: 6px;
}
.jc-body::-webkit-scrollbar-track {
  background: #090D0B;
}
.jc-body::-webkit-scrollbar-thumb {
  background: #1B241E;
  border-radius: 4px;
}

/* ── HERO: Interactive Curve Canvas Box ──────────────────── */
.jc-curve-box {
  background: #131916;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 18px;
  padding: 24px 20px 28px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4);
}
.jc-curve-box::before {
  content: "";
  position: absolute;
  top: -60px;
  right: -60px;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(0, 230, 118, 0.09) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.jc-curve-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94A3B8;
}
.jc-curve-title span.pulse-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #00E676;
}
.jc-curve-title span.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00E676;
  box-shadow: 0 0 10px #00E676;
  animation: jcPulse 1.8s infinite;
}

@keyframes jcPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.5); opacity: 0.6; }
}

/* ── SVG Journey Curve ────────────────────────────────────── */
.jc-svg-wrap {
  position: relative;
  width: 100%;
  min-height: 160px;
}
.jc-svg-element {
  width: 100%;
  height: 160px;
  overflow: visible;
}
.jc-track-bg {
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 4;
  fill: none;
  stroke-linecap: round;
  stroke-dasharray: 6 6;
}
.jc-track-active {
  stroke: url(#jcGradientActive);
  stroke-width: 5;
  fill: none;
  stroke-linecap: round;
  filter: drop-shadow(0 0 8px rgba(0, 230, 118, 0.6));
  transition: stroke-dashoffset 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Curve Nodes (Milestones) ─────────────────────────────── */
.jc-nodes-row {
  position: relative;
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  padding: 0 10px;
  gap: 8px;
}
.jc-node-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  flex: 1;
  text-align: center;
  transition: all 0.2s ease;
  min-width: 75px;
}
.jc-node-item:hover {
  transform: translateY(-3px);
}
.jc-node-badge {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #0E1410;
  border: 2px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #64748B;
  transition: all 0.24s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  z-index: 2;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}
.jc-node-item.done .jc-node-badge {
  background: #00E676;
  color: #090D0B;
  border-color: #00E676;
  box-shadow: 0 0 16px rgba(0, 230, 118, 0.55);
}
.jc-node-item.active .jc-node-badge {
  background: #C6FF00;
  color: #090D0B;
  border-color: #C6FF00;
  transform: scale(1.15);
  box-shadow: 0 0 20px rgba(198, 255, 0, 0.7);
}
.jc-node-item.pending .jc-node-badge {
  background: #1B241E;
  border-color: rgba(255, 255, 255, 0.1);
  color: #475569;
}

.jc-node-label {
  margin-top: 10px;
  font-size: 12px;
  font-weight: 700;
  color: #94A3B8;
  line-height: 1.25;
}
.jc-node-item.active .jc-node-label {
  color: #C6FF00;
  font-weight: 800;
}
.jc-node-item.done .jc-node-label {
  color: #E2E8F0;
}
.jc-node-date {
  font-size: 10px;
  color: #64748B;
  margin-top: 3px;
  font-family: monospace;
}
.jc-node-item.active .jc-node-date {
  color: #00E5FF;
}

/* ── Voyage Marker (Traveling Boat / Pointer) ─────────────── */
.jc-voyage-marker {
  position: absolute;
  top: 0;
  left: 0;
  width: 28px;
  height: 28px;
  background: #C6FF00;
  border: 3px solid #090D0B;
  border-radius: 50%;
  box-shadow: 0 0 16px #C6FF00, 0 0 30px rgba(198, 255, 0, 0.8);
  pointer-events: none;
  z-index: 5;
  transform: translate(-50%, -50%);
  transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  align-items: center;
  justify-content: center;
}
.jc-voyage-marker::after {
  content: "";
  width: 8px;
  height: 8px;
  background: #090D0B;
  border-radius: 50%;
}

/* ── Detail Cards Section (Obsidian Glass Cards) ──────────── */
.jc-timeline-cards {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.jc-card {
  background: #131916;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 16px 20px;
  transition: all 0.22s ease;
  position: relative;
  overflow: hidden;
}
.jc-card:hover {
  border-color: rgba(0, 230, 118, 0.3);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  transform: translateY(-2px);
}
.jc-card.highlight {
  border-color: #00E676;
  background: #16221B;
  box-shadow: 0 0 24px rgba(0, 230, 118, 0.2);
}
.jc-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.jc-card-step-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
  color: #00E676;
}
.jc-card-date {
  font-size: 11px;
  font-family: monospace;
  color: #94A3B8;
  background: rgba(255, 255, 255, 0.04);
  padding: 2px 8px;
  border-radius: 6px;
}
.jc-card-title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 700;
  color: #FFFFFF;
}
.jc-card-desc {
  margin: 0;
  font-size: 13px;
  color: #CBD5E1;
  line-height: 1.5;
}
.jc-quote-box {
  margin-top: 10px;
  background: rgba(0, 0, 0, 0.3);
  border-left: 3px solid #C6FF00;
  padding: 8px 12px;
  border-radius: 0 8px 8px 0;
  font-size: 12px;
  color: #F1F5F9;
  font-style: italic;
}
.jc-installments-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
}
.jc-inst-pill {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  padding: 8px 10px;
  text-align: center;
}
.jc-inst-pill .inst-amt {
  font-size: 13px;
  font-weight: 800;
  color: #C6FF00;
}
.jc-inst-pill .inst-meta {
  font-size: 10px;
  color: #94A3B8;
  margin-top: 2px;
}

/* ── Responsive adjustments ───────────────────────────────── */
@media (max-width: 680px) {
  .jc-modal {
    max-height: 96vh;
    border-radius: 16px;
  }
  .jc-header {
    padding: 16px;
  }
  .jc-body {
    padding: 16px;
  }
  .jc-nodes-row {
    overflow-x: auto;
    padding-bottom: 8px;
    justify-content: flex-start;
  }
  .jc-node-item {
    min-width: 70px;
  }
}
