/* ============================================================
 * pain-chain.css — S274bis
 * Visualize pipeline as a SEQUENCE of pains resolved step-by-step.
 * Used on /services/*.html to show E2E pipeline pain-chain.
 * ============================================================ */

.pain-chain-section {
  padding: 4rem 0;
  background: linear-gradient(180deg, rgba(79, 186, 241, 0.02) 0%, rgba(79, 186, 241, 0.06) 100%);
}

.pain-chain-section .container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.pain-chain-section .chain-intro {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 3rem auto;
  font-size: 1.05rem;
  color: var(--text-secondary, #555);
}

.pain-chain {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  counter-reset: chain;
  list-style: none;
  padding: 0;
  margin: 0;
}

.pain-chain-step {
  position: relative;
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 1.25rem;
  padding: 1.5rem 1.5rem 1.5rem 1rem;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 14px;
  border-left: 4px solid var(--primary, #4FBAF1);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pain-chain-step:hover {
  transform: translateX(4px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.pain-chain-step::before {
  counter-increment: chain;
  content: counter(chain);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, #4FBAF1 0%, #2a8cb8 100%);
  color: white;
  font-weight: 800;
  font-size: 1.6rem;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(79, 186, 241, 0.3);
}

.pain-chain-step .step-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary, #1a1a1a);
  margin: 0 0 0.5rem 0;
}

.pain-chain-step .step-pain {
  font-style: italic;
  color: #d9480f;
  margin: 0 0 0.5rem 0;
  padding-left: 0.75rem;
  border-left: 2px solid #d9480f;
  font-size: 0.95rem;
}

.pain-chain-step .step-fix {
  color: var(--text-secondary, #444);
  margin: 0 0 0.35rem 0;
  font-size: 0.95rem;
}

.pain-chain-step .step-fix strong {
  color: var(--primary, #2a8cb8);
}

.pain-chain-step .step-gain {
  color: #0c7f3c;
  font-weight: 600;
  font-size: 0.9rem;
  margin: 0;
}

/* Connector arrow between steps */
.pain-chain-step:not(:last-child)::after {
  content: "";
  position: absolute;
  bottom: -0.5rem;
  left: 2.5rem;
  width: 2px;
  height: 1rem;
  background: linear-gradient(180deg, #4FBAF1 0%, transparent 100%);
}

/* Mobile */
@media (max-width: 768px) {
  .pain-chain-step {
    grid-template-columns: 48px 1fr;
    gap: 0.8rem;
    padding: 1.1rem 1rem 1.1rem 0.75rem;
  }
  .pain-chain-step::before {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }
  .pain-chain-step .step-title { font-size: 1rem; }
  .pain-chain-step .step-pain,
  .pain-chain-step .step-fix { font-size: 0.88rem; }
}

/* Dark mode */
body.dark .pain-chain-step {
  background: rgba(30, 30, 40, 0.9);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}
body.dark .pain-chain-step .step-title { color: #f0f0f0; }
body.dark .pain-chain-step .step-fix { color: #c5c5c5; }
body.dark .pain-chain-step .step-pain { color: #ff9040; border-left-color: #ff9040; }
body.dark .pain-chain-step .step-gain { color: #3dd977; }

/* RTL */
html[dir="rtl"] .pain-chain-step {
  border-left: none;
  border-right: 4px solid var(--primary, #4FBAF1);
}
html[dir="rtl"] .pain-chain-step .step-pain {
  border-left: none;
  border-right: 2px solid #d9480f;
  padding-left: 0;
  padding-right: 0.75rem;
}
html[dir="rtl"] .pain-chain-step:hover { transform: translateX(-4px); }
html[dir="rtl"] .pain-chain-step:not(:last-child)::after { left: auto; right: 2.5rem; }
