/* ============================================================
   CODEXPERIA — PROBLEM SECTION
   problem.css
   ============================================================ */

/* ============================================================
   SECTION WRAPPER
   ============================================================ */
.section-problem {
  padding-top: var(--space-section);
  padding-bottom: var(--space-section);
  position: relative;
  overflow: hidden;
  background: linear-gradient(
    180deg,
    var(--color-bg-base) 0%,
    rgba(7, 17, 31, 0.95) 50%,
    var(--color-bg-base) 100%
  );
}

/* Subtle horizontal light streak */
.section-problem::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(56, 189, 248, 0.06) 20%,
    rgba(56, 189, 248, 0.12) 50%,
    rgba(56, 189, 248, 0.06) 80%,
    transparent 100%
  );
  pointer-events: none;
}

/* ============================================================
   SECTION HEADER
   ============================================================ */
.section-problem .section-header h2 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: var(--weight-extrabold);
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin-bottom: var(--space-5);
}

.section-problem .section-header p {
  font-size: var(--text-md);
  color: var(--color-text-secondary);
  max-width: 600px;
  line-height: var(--leading-relaxed);
}


/* ============================================================
   CLAIM FLOW VISUALIZATION
   ============================================================ */
.problem-flow {
  margin-top: var(--space-12);
  position: relative;
}

.problem-svg {
  width: 100%;
  max-width: 1100px;
  height: auto;
  display: block;
  margin: 0 auto;
  overflow: visible;
}

/* Pipeline track */
.prob-pipe {
  stroke-dashoffset: 0;
}

/* Animated main pipe */
@media (prefers-reduced-motion: no-preference) {
  .prob-pipe:first-of-type {
    animation: pipe-march 2s linear infinite;
    stroke-dasharray: 6 4;
  }

  @keyframes pipe-march {
    to { stroke-dashoffset: -20; }
  }
}

/* Stage nodes */
.prob-node {
  cursor: default;
  transition: opacity 0.3s ease;
}

/* Traveling packets */
.prob-packet {
  will-change: transform, opacity;
}

/* Warning blocks */
.prob-block {
  will-change: opacity, transform;
}


/* ============================================================
   ISSUE TAGS ROW
   ============================================================ */
.problem-issues {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-5);
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-border-subtle);
  justify-content: center;
}

.problem-issue {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--color-text-secondary);
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 0.4s ease,
    transform 0.4s ease;
}

.problem-issue.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.issue-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.issue-dot--warning {
  background: var(--color-warning);
  box-shadow: 0 0 6px var(--color-warning);
}

.issue-dot--error {
  background: var(--color-error);
  box-shadow: 0 0 6px var(--color-error);
}

.issue-dot--info {
  background: var(--color-secondary);
  box-shadow: 0 0 6px var(--color-secondary);
}

/* Pulsing dots on issue row */
@media (prefers-reduced-motion: no-preference) {
  .issue-dot {
    animation: issue-pulse 2s ease-in-out infinite;
  }

  @keyframes issue-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.5; }
  }
}


/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .problem-flow {
    margin-top: var(--space-8);
    overflow-x: hidden;
  }

  .problem-svg {
    min-width: 600px;
    overflow: visible;
  }

  /* Scroll-container for mobile */
  .problem-flow {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(56,189,248,0.2) transparent;
  }

  .problem-issues {
    justify-content: flex-start;
    gap: var(--space-3);
  }
}
