/* =====================================================
   MedSina — Enhanced FAQ Section
   Light medical theme with accordion animations
   ===================================================== */

/* ---------- Keyframes ---------- */
@keyframes ms-faq-slide-down {
  from { opacity:0; transform: translateY(-8px) }
  to   { opacity:1; transform: translateY(0) }
}
@keyframes ms-faq-item-in {
  from { opacity:0; transform: translateX(20px) }
  to   { opacity:1; transform: translateX(0) }
}
@keyframes ms-question-pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(37,99,235,0) }
  50%      { box-shadow: 0 0 0 4px rgba(37,99,235,.08) }
}
@keyframes ms-arrow-spin-in {
  from { transform: rotate(-90deg) scale(0) }
  to   { transform: rotate(0deg) scale(1) }
}
@keyframes ms-left-in {
  from { opacity:0; transform: translateX(-30px) }
  to   { opacity:1; transform: translateX(0) }
}
@keyframes ms-molecule-orbit {
  to { transform: rotate(360deg) }
}
@keyframes ms-faq-cross-drift {
  0%,100% { transform: translate(0,0) rotate(0deg) }
  33%      { transform: translate(6px,-8px) rotate(10deg) }
  66%      { transform: translate(-4px,5px) rotate(-6deg) }
}
@keyframes ms-pill-sway {
  0%,100% { transform: rotate(var(--pr,20deg)) translateY(0) }
  50%      { transform: rotate(calc(var(--pr,20deg)+8deg)) translateY(-8px) }
}
@keyframes ms-faq-num-count {
  from { opacity: 0; transform: scale(.5) }
  to   { opacity: .06; transform: scale(1) }
}

/* ---------- Section ---------- */
.faq {
  position: relative;
  overflow: hidden;
  padding: 110px 0 !important;
  background: linear-gradient(150deg,
    #ffffff 0%,
    #f8fbff 40%,
    #f0fdf9 80%,
    #f8fafc 100%
  ) !important;
}

/* ---------- Background decor ---------- */
.ms-faq-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

/* Large watermark number */
.ms-faq-watermark {
  position: absolute;
  font-size: 320px;
  font-weight: 900;
  line-height: 1;
  color: #2563eb;
  opacity: .025;
  top: 50%; right: -2%;
  transform: translateY(-50%);
  letter-spacing: -.05em;
  user-select: none;
  font-family: 'Inter', sans-serif;
}

/* Medical cross decorations */
.ms-faq-cross {
  position: absolute;
  opacity: .07;
}
.ms-faq-cross::before,
.ms-faq-cross::after {
  content: '';
  position: absolute;
  background: #2563eb;
  border-radius: 3px;
}
.ms-faq-cross::before { width:100%; height:32%; top:34%; left:0 }
.ms-faq-cross::after  { width:32%; height:100%; top:0; left:34% }
.ms-fqc1 { width:30px;height:30px; top:8%;  left:5%;  animation: ms-faq-cross-drift 8s ease-in-out infinite }
.ms-fqc2 { width:18px;height:18px; top:70%; left:8%;  animation: ms-faq-cross-drift 10s ease-in-out infinite; animation-delay:-3s }
.ms-fqc3 { width:22px;height:22px; top:15%; right:5%; animation: ms-faq-cross-drift 9s ease-in-out infinite; animation-delay:-5s }
.ms-fqc4 { width:14px;height:14px; top:80%; right:8%; animation: ms-faq-cross-drift 7s ease-in-out infinite; animation-delay:-2s }

/* Molecule / atom rings */
.ms-faq-atom {
  position: absolute;
  opacity: .08;
}
.ms-faq-atom-ring {
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid #2563eb;
}
.ms-fatom1 {
  width: 100px; height: 100px;
  top: 5%; left: 38%;
}
.ms-fatom1 .ms-faq-atom-ring:nth-child(1) { inset:0; animation: ms-atom-spin 7s linear infinite }
.ms-fatom1 .ms-faq-atom-ring:nth-child(2) { inset:14px; border-color:#0d9488; animation: ms-atom-spin-r 9s linear infinite }
.ms-fatom1::after { content:''; position:absolute; width:8px;height:8px; background:#2563eb; border-radius:50%; top:50%;left:50%;transform:translate(-50%,-50%) }

.ms-fatom2 {
  width: 70px; height: 70px;
  bottom: 8%; right: 22%;
  opacity: .06;
}
.ms-fatom2 .ms-faq-atom-ring:nth-child(1) { inset:0; border-color:#0d9488; animation: ms-atom-spin-r 6s linear infinite }
.ms-fatom2 .ms-faq-atom-ring:nth-child(2) { inset:12px; animation: ms-atom-spin 8s linear infinite }
.ms-fatom2::after { content:''; position:absolute; width:6px;height:6px; background:#0d9488; border-radius:50%; top:50%;left:50%;transform:translate(-50%,-50%) }

/* Floating pills */
.ms-faq-pill {
  position: absolute;
  border-radius: 100px;
  opacity: .08;
}
.ms-faq-pill::before,
.ms-faq-pill::after {
  content: ''; position:absolute; border-radius:100px;
  top:0; bottom:0; width:50%;
}
.ms-faq-pill::before { left:0; background:#2563eb }
.ms-faq-pill::after  { right:0; background:#0d9488 }
.ms-fp1 { --pr:25deg; width:40px;height:14px; top:25%; left:3%;  animation: ms-pill-sway 6s ease-in-out infinite }
.ms-fp2 { --pr:-15deg; width:28px;height:10px; top:65%; right:5%; animation: ms-pill-sway 8s ease-in-out infinite; animation-delay:-3s }
.ms-fp3 { --pr:40deg; width:34px;height:12px; top:85%; left:20%; animation: ms-pill-sway 7s ease-in-out infinite; animation-delay:-1s }

/* DNA side strips */
.ms-faq-dna {
  position: absolute;
  display: flex; flex-direction: column;
  justify-content: space-around;
  padding: 30px 0;
  opacity: .09;
}
.ms-faq-dna-l { left:.5%; top:0; bottom:0 }
.ms-faq-dna-r { right:.5%; top:0; bottom:0 }
.ms-faq-dna-pair {
  display:flex; align-items:center; gap:10px;
}
.ms-faq-dna-dot { width:6px;height:6px; border-radius:50%; background:#2563eb; flex-shrink:0 }
.ms-faq-dna-dot.t { background:#0d9488 }
.ms-faq-dna-bridge { flex:1; height:1px; background:linear-gradient(90deg,#2563eb44,#0d948844) }
.ms-faq-dna-pair:nth-child(odd) { transform: scaleX(.6) }

/* Stethoscope watermark */
.ms-faq-steth {
  position: absolute;
  bottom: -20px; left: 30%;
  opacity: .04;
  width: 200px; height: 200px;
  animation: ms-steth-spin 12s ease-in-out infinite;
}

/* Heartbeat line at bottom */
.ms-faq-ecg {
  position: absolute;
  bottom: 0; left: 0;
  width: 100%; height: 80px;
  opacity: .1;
}
.ms-faq-ecg-path {
  fill: none;
  stroke: url(#faqEcgGrad);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-dasharray: 2400;
  stroke-dashoffset: 2400;
}
.ms-faq-ecg-path.go {
  animation: ms-ecg-draw 3s ease forwards;
}

/* ---------- FAQ inner layout ---------- */
.faq-inner {
  position: relative;
  z-index: 1;
}

/* ---------- FAQ left panel ---------- */
.faq-left {
  position: sticky;
  top: 100px;
}
.faq-left .section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg,#eff6ff,#f0fdfa);
  border: 1px solid rgba(37,99,235,.18);
  border-radius: 100px;
  padding: 6px 18px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  color: #2563eb;
  margin-bottom: 20px;
}
.faq-left .section-label::before {
  content:'';
  width:7px; height:7px;
  border-radius:50%;
  background:linear-gradient(135deg,#2563eb,#0d9488);
  display:inline-block;
  animation: ms-dot-pulse 2.2s ease-in-out infinite;
}
.faq-left .section-title {
  font-size: 42px;
  line-height: 1.15;
  margin-bottom: 16px;
}
.faq-left p {
  font-size: 15px;
  line-height: 1.7;
  margin-bottom: 28px;
}
.faq-left .btn-primary {
  background: linear-gradient(135deg,#2563eb,#0d9488);
  box-shadow: 0 4px 20px rgba(37,99,235,.3);
  border: none;
  transition: transform .3s, box-shadow .3s;
}
.faq-left .btn-primary:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 8px 32px rgba(37,99,235,.5);
}

/* ---------- FAQ list ---------- */
.faq-list { gap: 10px !important; }

/* ---------- FAQ item ---------- */
.faq-item {
  border: 1px solid rgba(226,232,240,.9) !important;
  border-radius: 14px !important;
  background: rgba(255,255,255,.9) !important;
  backdrop-filter: blur(8px);
  overflow: hidden;
  transition: border-color .3s, box-shadow .3s, transform .3s !important;
  position: relative;
}

/* Number watermark inside each item */
.faq-item[data-faq-num]::before {
  content: attr(data-faq-num);
  position: absolute;
  right: 56px; top: 50%;
  transform: translateY(-50%);
  font-size: 64px;
  font-weight: 900;
  color: #2563eb;
  opacity: .04;
  line-height: 1;
  font-family: monospace;
  pointer-events: none;
  transition: opacity .3s;
}
.faq-item.open[data-faq-num]::before { opacity: .07 }

/* Left accent bar */
.faq-item::after {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg,#2563eb,#0d9488);
  border-radius: 14px 0 0 14px;
  opacity: 0;
  transition: opacity .3s;
}
.faq-item:hover::after,
.faq-item.open::after { opacity: 1 }

.faq-item:hover {
  border-color: rgba(37,99,235,.2) !important;
  box-shadow: 0 8px 32px rgba(15,23,42,.08), 0 2px 8px rgba(37,99,235,.06) !important;
  transform: translateX(4px) !important;
}
.faq-item.open {
  border-color: rgba(37,99,235,.25) !important;
  box-shadow: 0 12px 40px rgba(37,99,235,.1) !important;
}

/* ---------- FAQ question button ---------- */
.faq-question {
  padding: 20px 24px !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  gap: 16px !important;
  transition: color .25s, background .25s !important;
  border-radius: 14px;
}
.faq-question:hover {
  background: rgba(37,99,235,.03) !important;
}
.faq-item.open .faq-question {
  color: #2563eb !important;
  background: rgba(37,99,235,.04) !important;
}

/* ---------- FAQ arrow ---------- */
.faq-arrow {
  width: 22px !important; height: 22px !important;
  flex-shrink: 0;
  transition: transform .35s cubic-bezier(.34,1.56,.64,1), color .25s !important;
  border-radius: 50%;
  padding: 2px;
  background: rgba(37,99,235,.06);
}
.faq-item.open .faq-arrow {
  transform: rotate(180deg) !important;
  color: #2563eb !important;
  background: rgba(37,99,235,.12) !important;
}
.faq-question:hover .faq-arrow {
  background: rgba(37,99,235,.1) !important;
}

/* ---------- FAQ answer ---------- */
.faq-answer {
  display: block !important;       /* override display:none so we can animate */
  padding: 0 24px !important;
  font-size: 14px !important;
  line-height: 1.75 !important;
  color: #475569 !important;
  max-height: 0;
  overflow: hidden;
  transition: max-height .4s cubic-bezier(.4,0,.2,1),
              padding-bottom .3s ease,
              opacity .3s ease;
  opacity: 0;
}
.faq-item.open .faq-answer {
  max-height: 300px;
  padding-bottom: 20px !important;
  opacity: 1;
  animation: ms-faq-slide-down .35s ease;
}

/* ---------- Scroll-reveal ---------- */
.ms-faq-left-hidden {
  opacity: 0;
  transform: translateX(-30px);
}
.ms-faq-left-visible {
  opacity: 1 !important;
  transform: translateX(0) !important;
  transition: opacity .65s ease, transform .65s ease;
}
.ms-faq-item-hidden {
  opacity: 0;
  transform: translateX(24px);
}
.ms-faq-item-visible {
  opacity: 1 !important;
  transform: translateX(0) !important;
  transition: opacity .5s cubic-bezier(.4,0,.2,1),
              transform .5s cubic-bezier(.4,0,.2,1);
}
