/*
 * Styles for the Advanced Rebate Adjudication animation on the public
 * Product page.  Colour palette is aligned with the app theme:
 *   deep indigo  #1d1f48
 *   accent green #b2d235
 */

#rebate-adjudication-demo {
  --ra-navy: #1d1f48;
  --ra-navy-soft: #2a2d6b;
  --ra-green: #b2d235;
  --ra-green-dark: #8fb222;
  --ra-red: #dc3545;
  --ra-ink: #1d1f48;
  --ra-ink-soft: #4a4c74;
  --ra-border: rgba(29, 31, 72, 0.12);
  --ra-surface: #ffffff;
  --ra-surface-alt: #f8f9fc;

  position: relative;
  margin: 2rem auto 4rem auto;
  max-width: 1200px;
  padding: 0 1rem;
  font-family: 'Poppins', sans-serif;
  color: var(--ra-ink);
}

/* ---------- Intro ----------------------------------------------------- */

#rebate-adjudication-demo .ra-intro {
  text-align: center;
  padding: 2.5rem 1rem 2rem 1rem;
  background: linear-gradient(135deg, #ffffff 0%, #f4f7ee 60%, #ffffff 100%);
  border-radius: 14px;
  border: 1px solid var(--ra-border);
  box-shadow: 0 6px 28px rgba(29, 31, 72, 0.06);
  margin-bottom: 1.5rem;
  overflow: hidden;
  position: relative;
}

#rebate-adjudication-demo .ra-intro::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 15% 20%, rgba(178, 210, 53, 0.18) 0, transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(29, 31, 72, 0.10) 0, transparent 45%);
  pointer-events: none;
}

#rebate-adjudication-demo .ra-intro-eyebrow {
  position: relative;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ra-green-dark);
  margin-bottom: 0.5rem;
}

#rebate-adjudication-demo .ra-intro-title {
  position: relative;
  font-weight: 700;
  font-size: clamp(1.8rem, 3.5vw, 3rem);
  line-height: 1.1;
  color: var(--ra-navy);
  margin: 0 auto 0.75rem auto;
  min-height: 1.2em;
}

#rebate-adjudication-demo .ra-intro-caret {
  display: inline-block;
  width: 4px;
  height: 1em;
  background: var(--ra-green);
  margin-left: 4px;
  vertical-align: -0.15em;
  animation: raCaretBlink 0.8s steps(2, start) infinite;
}

@keyframes raCaretBlink {
  to { background: transparent; }
}

#rebate-adjudication-demo .ra-intro-subtitle {
  position: relative;
  max-width: 640px;
  margin: 0 auto 0.75rem auto;
  font-size: 1rem;
  color: var(--ra-ink-soft);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

#rebate-adjudication-demo .ra-intro-subtitle.is-visible,
#rebate-adjudication-demo .ra-intro-tagline.is-visible,
#rebate-adjudication-demo .ra-table-stage.is-visible,
#rebate-adjudication-demo .ra-details.is-visible {
  opacity: 1;
  transform: translateY(0);
}

#rebate-adjudication-demo .ra-intro-tagline {
  position: relative;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ra-navy);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.6s ease 0.1s, transform 0.6s ease 0.1s;
  text-transform: lowercase;
}

#rebate-adjudication-demo .ra-intro-tagline .heading-bracket {
  color: var(--ra-green);
  margin: 0 6px;
  font-weight: 600;
}

/* ---------- Playback controls ---------------------------------------- */

#rebate-adjudication-demo .ra-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--ra-surface);
  border: 1px solid var(--ra-border);
  border-radius: 999px;
  padding: 0.45rem 0.75rem;
  margin: 0 auto 1.25rem auto;
  width: fit-content;
  max-width: 100%;
  box-shadow: 0 6px 20px rgba(29, 31, 72, 0.08);
  flex-wrap: wrap;
  justify-content: center;
}

#rebate-adjudication-demo .ra-ctrl {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--ra-border);
  background: #fff;
  color: var(--ra-navy);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
  padding: 0;
}

#rebate-adjudication-demo .ra-ctrl:hover:not(:disabled) {
  background: var(--ra-navy);
  color: #fff;
  border-color: var(--ra-navy);
  transform: translateY(-1px);
}

#rebate-adjudication-demo .ra-ctrl:active:not(:disabled) {
  transform: translateY(0);
}

#rebate-adjudication-demo .ra-ctrl:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

#rebate-adjudication-demo .ra-ctrl.ra-ctrl-play {
  background: var(--ra-green);
  color: var(--ra-navy);
  border-color: var(--ra-green);
  width: 44px;
  height: 44px;
  font-size: 1rem;
  box-shadow: 0 4px 12px rgba(178, 210, 53, 0.4);
}

#rebate-adjudication-demo .ra-ctrl.ra-ctrl-play:hover:not(:disabled) {
  background: var(--ra-green-dark);
  color: #fff;
  border-color: var(--ra-green-dark);
}

#rebate-adjudication-demo .ra-ctrl.ra-ctrl-play.is-playing {
  background: var(--ra-navy);
  color: var(--ra-green);
  border-color: var(--ra-navy);
}

#rebate-adjudication-demo .ra-step-indicator {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-left: 0.5rem;
  padding: 0 0.75rem;
  min-width: 180px;
  border-left: 1px solid var(--ra-border);
  font-size: 0.75rem;
}

#rebate-adjudication-demo .ra-step-label {
  font-weight: 600;
  color: var(--ra-navy);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#rebate-adjudication-demo .ra-step-count {
  font-family: 'Open Sans', monospace;
  color: var(--ra-ink-soft);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
}

#rebate-adjudication-demo .ra-step-progress {
  height: 3px;
  background: rgba(29, 31, 72, 0.08);
  border-radius: 2px;
  overflow: hidden;
  margin: 2px 0;
}

#rebate-adjudication-demo .ra-step-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--ra-green) 0%, var(--ra-navy) 100%);
  border-radius: 2px;
  transition: width 0.35s ease;
}

@media (max-width: 520px) {
  #rebate-adjudication-demo .ra-controls { gap: 0.35rem; padding: 0.4rem 0.5rem; }
  #rebate-adjudication-demo .ra-step-indicator {
    min-width: 0;
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--ra-border);
    padding: 0.35rem 0.25rem 0 0.25rem;
    margin-left: 0;
  }
}

/* ---------- Table stage ---------------------------------------------- */

#rebate-adjudication-demo .ra-table-stage {
  background: var(--ra-surface);
  border-radius: 14px;
  border: 1px solid var(--ra-border);
  box-shadow: 0 10px 32px rgba(29, 31, 72, 0.08);
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

#rebate-adjudication-demo .ra-table-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--ra-navy);
  color: #fff;
  padding: 0.55rem 0.9rem;
  font-size: 0.82rem;
}

#rebate-adjudication-demo .ra-table-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

#rebate-adjudication-demo .ra-dot-red    { background: #ff5f57; }
#rebate-adjudication-demo .ra-dot-yellow { background: #febc2e; }
#rebate-adjudication-demo .ra-dot-green  { background: #28c840; }

#rebate-adjudication-demo .ra-table-filename {
  margin-left: 0.5rem;
  font-family: 'Open Sans', monospace;
  opacity: 0.8;
  letter-spacing: 0.02em;
}

#rebate-adjudication-demo .ra-table-status {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
}

#rebate-adjudication-demo .ra-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ra-green);
  box-shadow: 0 0 0 0 rgba(178, 210, 53, 0.7);
  animation: raPulse 1.6s ease-out infinite;
}

@keyframes raPulse {
  0%   { box-shadow: 0 0 0 0 rgba(178, 210, 53, 0.7); }
  70%  { box-shadow: 0 0 0 10px rgba(178, 210, 53, 0); }
  100% { box-shadow: 0 0 0 0 rgba(178, 210, 53, 0); }
}

#rebate-adjudication-demo .ra-table-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: auto;
  -webkit-overflow-scrolling: touch;
}

#rebate-adjudication-demo .ra-table-scroll::-webkit-scrollbar {
  height: 6px;
}

#rebate-adjudication-demo .ra-table-scroll::-webkit-scrollbar-thumb {
  background: rgba(29, 31, 72, 0.2);
  border-radius: 3px;
}

#rebate-adjudication-demo .ra-claims-table {
  margin-bottom: 0;
  font-size: 0.82rem;
  background: var(--ra-surface);
  color: var(--ra-ink);
  border-collapse: separate;
  border-spacing: 0;
  min-width: 1900px;
}

#rebate-adjudication-demo .ra-claims-table thead th {
  background: var(--ra-surface-alt);
  color: var(--ra-navy);
  font-weight: 600;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 2px solid var(--ra-navy);
  white-space: nowrap;
  padding: 0.75rem 0.75rem;
}

#rebate-adjudication-demo .ra-claims-table tbody td {
  border-top: 1px solid rgba(29, 31, 72, 0.06);
  padding: 0.6rem 0.75rem;
  white-space: nowrap;
  vertical-align: middle;
}

#rebate-adjudication-demo .ra-claims-table tbody tr:nth-child(even) td {
  background: #fbfbfd;
}

#rebate-adjudication-demo .ra-claims-table tbody tr:hover td {
  background: rgba(178, 210, 53, 0.08);
}

#rebate-adjudication-demo .ra-claims-table thead th.ra-outcome-col {
  background: var(--ra-navy);
  color: #fff;
  border-bottom-color: var(--ra-green);
  text-align: center;
}

#rebate-adjudication-demo .ra-claims-table td.ra-outcome-col {
  text-align: center;
  background: rgba(29, 31, 72, 0.02);
  position: relative;
  transition: background 0.4s ease;
}

#rebate-adjudication-demo .ra-claims-table td.ra-outcome-col.ra-outcome-hit {
  background: rgba(178, 210, 53, 0.10);
}

#rebate-adjudication-demo .ra-outcome {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 1.05rem;
  transform: scale(0.4);
  opacity: 0;
  animation: raPop 0.45s ease-out forwards;
}

#rebate-adjudication-demo .ra-outcome-col.ra-outcome-hit .ra-outcome {
  animation-delay: 0.05s;
}

@keyframes raPop {
  0%   { transform: scale(0.4); opacity: 0; }
  60%  { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

#rebate-adjudication-demo .ra-outcome.ra-pass {
  color: #2f7d2f;
  background: rgba(178, 210, 53, 0.22);
}

#rebate-adjudication-demo .ra-outcome.ra-fail {
  color: #b22222;
  background: rgba(220, 53, 69, 0.16);
}

#rebate-adjudication-demo .ra-scroll-progress {
  height: 3px;
  width: 100%;
  background: rgba(29, 31, 72, 0.06);
}

#rebate-adjudication-demo .ra-scroll-progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--ra-green) 0%, var(--ra-navy) 100%);
  transition: width 0.1s linear;
}

/* ---------- Detail panels -------------------------------------------- */

#rebate-adjudication-demo .ra-details {
  margin-top: 2rem;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

#rebate-adjudication-demo .ra-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
  margin-bottom: 1.25rem;
}

#rebate-adjudication-demo .ra-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Poppins', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ra-navy);
  background: var(--ra-surface);
  border: 1px solid var(--ra-border);
  border-radius: 999px;
  padding: 0.45rem 1rem;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

#rebate-adjudication-demo .ra-chip:hover {
  transform: translateY(-1px);
  border-color: var(--ra-green);
}

#rebate-adjudication-demo .ra-chip.is-active {
  background: var(--ra-navy);
  color: #fff;
  border-color: var(--ra-navy);
  box-shadow: 0 6px 16px rgba(29, 31, 72, 0.2);
}

#rebate-adjudication-demo .ra-chip.is-active i {
  color: var(--ra-green);
}

#rebate-adjudication-demo .ra-detail-stage {
  position: relative;
  min-height: 360px;
}

#rebate-adjudication-demo .ra-detail-panel {
  position: absolute;
  inset: 0;
  background: var(--ra-surface);
  border: 1px solid var(--ra-border);
  border-radius: 14px;
  box-shadow: 0 10px 32px rgba(29, 31, 72, 0.08);
  padding: 1.5rem 1.75rem;
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: opacity 0.45s ease, transform 0.45s ease;
  overflow: hidden;
}

#rebate-adjudication-demo .ra-detail-panel.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  position: relative;
  inset: auto;
}

#rebate-adjudication-demo .ra-detail-header {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

#rebate-adjudication-demo .ra-detail-header.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

#rebate-adjudication-demo .ra-detail-header i {
  grid-row: 1 / span 2;
  font-size: 1.6rem;
  color: var(--ra-green-dark);
  background: rgba(178, 210, 53, 0.15);
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#rebate-adjudication-demo .ra-detail-header h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--ra-navy);
}

#rebate-adjudication-demo .ra-detail-header p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--ra-ink-soft);
}

#rebate-adjudication-demo .ra-detail-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

#rebate-adjudication-demo .ra-detail-body.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

@media (min-width: 800px) {
  #rebate-adjudication-demo .ra-detail-body {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem 1rem;
  }
}

#rebate-adjudication-demo .ra-detail-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  padding: 0.75rem 0.9rem;
  background: var(--ra-surface-alt);
  border-left: 3px solid transparent;
  border-radius: 8px;
  opacity: 0;
  transform: translateX(-10px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

#rebate-adjudication-demo .ra-detail-row.is-revealed {
  opacity: 1;
  transform: translateX(0);
}

#rebate-adjudication-demo .ra-detail-row.ra-row-pass {
  border-left-color: var(--ra-green);
}

#rebate-adjudication-demo .ra-detail-row.ra-row-fail {
  border-left-color: var(--ra-red);
  background: #fdf4f5;
}

#rebate-adjudication-demo .ra-detail-row-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--ra-ink-soft);
  margin-bottom: 0.2rem;
}

#rebate-adjudication-demo .ra-detail-row-id {
  font-family: 'Open Sans', monospace;
  font-weight: 600;
  color: var(--ra-navy);
}

#rebate-adjudication-demo .ra-detail-row-drug {
  color: var(--ra-navy);
  font-weight: 500;
}

#rebate-adjudication-demo .ra-detail-row-headline {
  font-weight: 600;
  color: var(--ra-navy);
  font-size: 0.95rem;
  margin-bottom: 0.15rem;
}

#rebate-adjudication-demo .ra-detail-row-reason {
  font-size: 0.85rem;
  color: var(--ra-ink-soft);
  line-height: 1.45;
}

#rebate-adjudication-demo .ra-detail-row-icon {
  align-self: start;
  padding-top: 0.1rem;
}

/* ---------- NLP flash ------------------------------------------------- */

#rebate-adjudication-demo .ra-nlp-flash {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: linear-gradient(135deg, #8fb222 0%, #b2d235 50%, #cde76a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
  overflow: hidden;
}

#rebate-adjudication-demo .ra-nlp-flash.is-active {
  opacity: 1;
  pointer-events: auto;
  animation: raNlpPulse 1.3s ease-in-out;
}

@keyframes raNlpPulse {
  0%   { filter: brightness(1.15); }
  25%  { filter: brightness(1.35); }
  60%  { filter: brightness(1); }
  100% { filter: brightness(1); }
}

#rebate-adjudication-demo .ra-nlp-flash-inner {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  color: #1d1f48;
  font-weight: 600;
  font-size: 1.05rem;
  background: rgba(255, 255, 255, 0.35);
  padding: 0.7rem 1.3rem;
  border-radius: 999px;
  backdrop-filter: blur(2px);
  position: relative;
  z-index: 1;
}

#rebate-adjudication-demo .ra-nlp-flash-inner i {
  color: #1d1f48;
  font-size: 1.2rem;
}

#rebate-adjudication-demo .ra-nlp-scan {
  position: absolute;
  top: 0;
  left: -40%;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.55) 50%,
    rgba(255, 255, 255, 0) 100%);
  animation: raNlpScan 1.3s linear;
}

@keyframes raNlpScan {
  0%   { left: -40%; }
  100% { left: 100%; }
}

/* ---------- Responsive tweaks ---------------------------------------- */

@media (max-width: 768px) {
  #rebate-adjudication-demo .ra-intro { padding: 2rem 1rem 1.5rem 1rem; }
  #rebate-adjudication-demo .ra-claims-table { min-width: 1400px; font-size: 0.76rem; }
  #rebate-adjudication-demo .ra-detail-panel { padding: 1.1rem 1rem; }
  #rebate-adjudication-demo .ra-detail-stage { min-height: 480px; }
}
