/* ══ FAQ Section – Cosmic Guidance ══ */
.studies-faq-section {
  padding: 5rem 0 6rem;
  background: linear-gradient(170deg, #f0f4ff 0%, #ffffff 35%, #f5f8ff 65%, #eef2ff 100%);
  position: relative;
  overflow: hidden;
}

/* ── Top separator ── */
.studies-faq-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 70%;
  max-width: 600px;
  height: 3px;
  background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.6), rgba(79, 70, 229, 0.4), rgba(124, 58, 237, 0.3), transparent);
  z-index: 2;
  border-radius: 2px;
}

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

/* ══ Nebula washes ══ */
.faq-nebula {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
}

.faq-nebula--1 {
  width: 750px; height: 750px;
  background: radial-gradient(circle at 30% 40%, rgba(37, 99, 235, 0.22), rgba(79, 70, 229, 0.10) 45%, transparent 70%);
  top: -200px; right: -120px;
  animation: faqNebulaDrift 22s ease-in-out infinite alternate;
}

.faq-nebula--2 {
  width: 650px; height: 650px;
  background: radial-gradient(circle at 60% 50%, rgba(124, 58, 237, 0.18), rgba(79, 70, 229, 0.08) 45%, transparent 70%);
  bottom: -180px; left: -100px;
  animation: faqNebulaDrift 26s ease-in-out infinite alternate-reverse;
}

.faq-nebula--3 {
  width: 450px; height: 450px;
  background: radial-gradient(circle at 50% 50%, rgba(79, 70, 229, 0.12), transparent 60%);
  top: 20%; left: 40%;
  filter: blur(80px);
  animation: faqNebulaPulse 16s ease-in-out infinite alternate;
}

/* ══ Central question mark with ripples ══ */
.faq-question-mark {
  position: absolute;
  top: 50%;
  left: 10%;
  transform: translateY(-50%);
  width: 200px;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.faq-question-mark span {
  font-family: "Outfit", sans-serif;
  font-size: 8rem;
  font-weight: 800;
  color: rgba(79, 70, 229, 0.2);
  position: relative;
  z-index: 2;
  animation: faqQMarkPulse 3s ease-in-out infinite;
  text-shadow: 0 0 60px rgba(79, 70, 229, 0.3), 0 0 120px rgba(79, 70, 229, 0.15);
}

.faq-ripple {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 2px solid rgba(79, 70, 229, 0.2);
  animation: faqRippleExpand 4s ease-out infinite;
}

.faq-ripple--1 { animation-delay: 0s; border-color: rgba(79, 70, 229, 0.25); }
.faq-ripple--2 { animation-delay: 1.3s; border-color: rgba(37, 99, 235, 0.2); }
.faq-ripple--3 { animation-delay: 2.6s; border-color: rgba(124, 58, 237, 0.15); }

@keyframes faqQMarkPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.7; }
}

@keyframes faqRippleExpand {
  0% { width: 60px; height: 60px; opacity: 0.8; }
  100% { width: 500px; height: 500px; opacity: 0; }
}

/* ══ Stars ══ */
.faq-star {
  position: absolute;
  border-radius: 50%;
  animation: faqStarTwinkle 4s ease-in-out infinite alternate;
}

.faq-star--1 { top: 12%; left: 10%; width: 7px; height: 7px; background: #2563eb; box-shadow: 0 0 14px rgba(37,99,235,0.7), 0 0 30px rgba(37,99,235,0.2); animation-delay: 0s; }
.faq-star--2 { top: 8%; right: 18%; width: 9px; height: 9px; background: #4f46e5; box-shadow: 0 0 18px rgba(79,70,229,0.7), 0 0 35px rgba(79,70,229,0.2); animation-delay: 0.7s; }
.faq-star--3 { top: 35%; left: 5%; width: 6px; height: 6px; background: #7c3aed; box-shadow: 0 0 12px rgba(124,58,237,0.6), 0 0 25px rgba(124,58,237,0.2); animation-delay: 1.4s; }
.faq-star--4 { bottom: 30%; right: 8%; width: 8px; height: 8px; background: #2563eb; box-shadow: 0 0 16px rgba(37,99,235,0.7), 0 0 32px rgba(37,99,235,0.2); animation-delay: 2.1s; }
.faq-star--5 { bottom: 12%; left: 22%; width: 7px; height: 7px; background: #4f46e5; box-shadow: 0 0 14px rgba(79,70,229,0.6), 0 0 28px rgba(79,70,229,0.2); animation-delay: 0.3s; }
.faq-star--6 { top: 55%; right: 25%; width: 6px; height: 6px; background: #7c3aed; box-shadow: 0 0 12px rgba(124,58,237,0.6), 0 0 25px rgba(124,58,237,0.2); animation-delay: 2.8s; }

/* ══ Question mark constellation ══ */
.faq-question-constellation {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.15;
}

.faq-q-circle {
  fill: none;
  stroke: url(#faqQConstGrad);
  stroke-width: 2;
  stroke-dasharray: 6 8;
  animation: faqConstOrbit 30s linear infinite;
}

.faq-q-tail {
  fill: none;
  stroke: url(#faqQConstGrad);
  stroke-width: 2;
  stroke-dasharray: 4 6;
  animation: faqConstDash 25s linear infinite;
}

.faq-q-dot {
  fill: #2563eb;
  animation: faqStarTwinkle 3s ease-in-out infinite alternate;
}

/* ══ Compass (guidance) ══ */
.faq-compass {
  position: absolute;
  top: 18%;
  left: 6%;
  width: 80px;
  height: 80px;
  animation: faqCompassFloat 20s ease-in-out infinite;
}

.faq-compass-ring {
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  border: 1.5px solid rgba(37, 99, 235, 0.15);
  animation: faqCompassSpin 30s linear infinite;
}

.faq-compass-ring::before {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  border: 1px dashed rgba(79, 70, 229, 0.1);
}

.faq-compass-n {
  position: absolute;
  top: -4px; left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 8px solid rgba(37, 99, 235, 0.25);
}

.faq-compass-s {
  position: absolute;
  bottom: -4px; left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 8px solid rgba(79, 70, 229, 0.18);
}

.faq-compass-e {
  position: absolute;
  top: 50%; right: -4px;
  transform: translateY(-50%);
  width: 0; height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 8px solid rgba(124, 58, 237, 0.15);
}

.faq-compass-w {
  position: absolute;
  top: 50%; left: -4px;
  transform: translateY(-50%);
  width: 0; height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-right: 8px solid rgba(79, 70, 229, 0.12);
}

.faq-compass-needle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2px;
  height: 28px;
  background: linear-gradient(to top, #4f46e5 50%, #2563eb 50%);
  transform: translate(-50%, -50%) rotate(25deg);
  border-radius: 1px;
  box-shadow: 0 0 8px rgba(37, 99, 235, 0.2);
  animation: faqNeedleSway 6s ease-in-out infinite alternate;
}

/* ══ Orbital rings ══ */
.faq-orbit {
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid;
  pointer-events: none;
}

.faq-orbit--1 {
  width: 260px; height: 260px;
  bottom: 10%; right: 5%;
  border-color: rgba(37, 99, 235, 0.12);
  animation: faqOrbitSpin 24s linear infinite;
}

.faq-orbit--2 {
  width: 180px; height: 180px;
  top: 35%; right: 28%;
  border-color: rgba(124, 58, 237, 0.08);
  animation: faqOrbitSpin 18s linear infinite reverse;
}

.faq-orbit-dot {
  position: absolute;
  top: 0; left: 50%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: faqOrbitDotPulse 3s ease-in-out infinite alternate;
}

.faq-orbit--1 .faq-orbit-dot {
  width: 9px; height: 9px;
  background: #2563eb;
  box-shadow: 0 0 14px rgba(37, 99, 235, 0.5);
}

.faq-orbit--2 .faq-orbit-dot {
  width: 7px; height: 7px;
  background: #4f46e5;
  box-shadow: 0 0 10px rgba(79, 70, 229, 0.4);
  animation-delay: 1.5s;
}

/* ══ Signal waves (support) ══ */
.faq-signal {
  position: absolute;
  opacity: 0.08;
}

.faq-signal--1 {
  bottom: 22%; left: 8%;
  animation: faqSignalPulse 4s ease-in-out infinite;
}

.faq-signal--2 {
  top: 45%; right: 10%;
  opacity: 0.05;
  animation: faqSignalPulse 5s ease-in-out infinite 2s;
}

.faq-signal-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
  border: 1.5px solid #2563eb;
  transform: translate(-50%, -50%) scale(0);
  animation: faqSignalExpand 3s ease-out infinite;
}

.faq-signal-ring--1 { width: 14px; height: 14px; animation-delay: 0s; }
.faq-signal-ring--2 { width: 28px; height: 28px; animation-delay: 0.7s; }
.faq-signal-ring--3 { width: 42px; height: 42px; animation-delay: 1.4s; }

.faq-signal--2 .faq-signal-ring { border-color: #4f46e5; }
.faq-signal--2 .faq-signal-ring--1 { width: 12px; height: 12px; }
.faq-signal--2 .faq-signal-ring--2 { width: 24px; height: 24px; }

/* ══ Keyframes ══ */
@keyframes faqNebulaDrift {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(65px, -45px) scale(1.3); }
}

@keyframes faqNebulaPulse {
  0% { opacity: 0.4; transform: scale(1); }
  100% { opacity: 1; transform: scale(1.6); }
}

@keyframes faqStarTwinkle {
  0% { opacity: 0.25; transform: scale(0.8); }
  100% { opacity: 1; transform: scale(1.5); }
}

@keyframes faqConstOrbit {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes faqConstDash {
  0% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: -200; }
}

@keyframes faqCompassFloat {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(10px, -8px) rotate(3deg); }
  66% { transform: translate(-6px, 6px) rotate(-2deg); }
}

@keyframes faqCompassSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes faqNeedleSway {
  0% { transform: translate(-50%, -50%) rotate(20deg); }
  100% { transform: translate(-50%, -50%) rotate(40deg); }
}

@keyframes faqOrbitSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes faqOrbitDotPulse {
  0% { opacity: 0.2; transform: translate(-50%, -50%) scale(0.7); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1.4); }
}

@keyframes faqSignalPulse {
  0%, 100% { opacity: 0.04; }
  50% { opacity: 0.12; }
}

@keyframes faqSignalExpand {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
  30% { opacity: 0.6; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}

/* ══ Reduced motion ══ */
@media (prefers-reduced-motion: reduce) {
  .faq-nebula,
  .faq-star,
  .faq-q-circle,
  .faq-q-tail,
  .faq-q-dot,
  .faq-compass,
  .faq-compass-ring,
  .faq-compass-needle,
  .faq-orbit,
  .faq-orbit-dot,
  .faq-signal,
  .faq-signal-ring,
  .faq-item.active {
    animation: none !important;
  }

  .faq-item::before { background: none !important; }
  .faq-item.active::after { opacity: 1 !important; transform: translateX(0) !important; animation: none !important; }

  .faq-nebula { opacity: 0.08; }
  .faq-star { opacity: 0.25; }
  .faq-question-constellation { opacity: 0.04; }
  .faq-compass { opacity: 0.06; }
  .faq-orbit-dot { opacity: 0.3; }
  .faq-signal { opacity: 0.03; }
}

/* ── Header ── */
.faq-header {
  text-align: center;
  border-bottom: none;
  margin-bottom: 2.5rem;
  display: flex;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.faq-subtitle {
    font-family: "Outfit", sans-serif;
    font-size: 1.1rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: transparent;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    -webkit-background-clip: text;
    background-clip: text;
    margin: 0 0 0.6rem;
}

.faq-main-title {
  font-family: "Outfit", sans-serif;
  font-size: clamp(2.2rem, 4vw, 3.5rem);
  font-weight: 800;
  color: #0f172a;
  line-height: 1.1;
  margin: 0;
  letter-spacing: -0.03em;
}

.faq-title-accent {
  font-weight: 800;
}

.faq-title-blue {
  background: linear-gradient(135deg, #2563eb, #4f46e5, #7c3aed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
  font-weight: 800;
}

/* ── Grid ── */
.studies-faq-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  column-gap: 2rem;
  row-gap: 1.5rem;
  align-items: flex-start;
  position: relative;
  z-index: 1;
}

/* ── FAQ Item ── */
.faq-item {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(37, 99, 235, 0.08);
  border-radius: 18px;
  box-shadow:
    0 4px 16px rgba(37, 99, 235, 0.03),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  overflow: hidden;
  position: relative;
  isolation: isolate;
}

/* ── Shimmer hover ── */
.faq-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    110deg,
    transparent 25%,
    rgba(255, 255, 255, 0.5) 38%,
    rgba(255, 255, 255, 0.6) 42%,
    transparent 55%
  );
  background-size: 250% 100%;
  background-position: 200% 0;
  transition: background-position 0.5s ease;
  pointer-events: none;
  border-radius: inherit;
  z-index: 0;
}

.faq-item:hover::before {
  background-position: -50% 0;
}

.faq-item:hover {
  transform: translateY(-3px);
  border-color: rgba(37, 99, 235, 0.2);
  box-shadow:
    0 12px 28px rgba(37, 99, 235, 0.08),
    0 4px 12px rgba(79, 70, 229, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.faq-item.active {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(37, 99, 235, 0.25);
  box-shadow:
    0 16px 40px rgba(37, 99, 235, 0.1),
    0 6px 18px rgba(79, 70, 229, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  animation: faqItemGlow 3s ease-in-out infinite;
}

.faq-item.active::before {
  opacity: 0;
}

/* ── Active left bar ── */
.faq-item.active::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(to bottom, #2563eb, #4f46e5, #7c3aed);
  border-radius: 4px 0 0 4px;
  opacity: 0;
  animation: faqBarIn 0.5s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
  pointer-events: none;
  z-index: 1;
}

@keyframes faqBarIn {
  0%   { opacity: 0; transform: translateX(-4px); }
  100% { opacity: 1; transform: translateX(0); }
}

@keyframes faqItemGlow {
  0%, 100% { box-shadow: 0 16px 40px rgba(37, 99, 235, 0.1), 0 6px 18px rgba(79, 70, 229, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.8); }
  50%      { box-shadow: 0 20px 50px rgba(37, 99, 235, 0.15), 0 8px 24px rgba(79, 70, 229, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.8); }
}

/* ── Question Button ── */
.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 2rem;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  color: #1e293b;
  outline: none;
}

.faq-question-text {
  font-family: "Outfit", sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.4;
  padding-right: 1.5rem;
  color: #0f172a;
}

.faq-item.active .faq-question-text {
  background: linear-gradient(135deg, #2563eb, #4f46e5, #7c3aed);
  -webkit-background-clip: text;
  background-clip: text;
}

/* ── Icon ── */
.faq-icon {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(79, 70, 229, 0.06));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2563eb;
  transition:
    transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
    background 0.3s,
    color 0.3s,
    box-shadow 0.3s;
}

.faq-item:hover .faq-icon {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.14), rgba(79, 70, 229, 0.10));
  color: #4f46e5;
}

.faq-item.active .faq-icon {
  transform: rotate(135deg) scale(1.1);
  background: linear-gradient(135deg, #2563eb, #4f46e5, #7c3aed);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

/* ── Answer ── */
.faq-answer-wrapper {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.45s cubic-bezier(0.2, 0.9, 0.4, 1);
}

.faq-item.active .faq-answer-wrapper {
  grid-template-rows: 1fr;
}

.faq-answer-inner {
  overflow: hidden;
}

.faq-answer-content {
  padding: 0 2rem 1.5rem 2rem;
  font-family: "Inter", sans-serif;
  font-size: 1rem;
  color: #64748b;
  line-height: 1.7;
  opacity: 0;
  transform: translateY(-10px);
  transition:
    opacity 0.35s ease,
    transform 0.45s ease;
  transition-delay: 0s;
}

.faq-item.active .faq-answer-content {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.1s;
}

/* ── Answer content stagger ── */
.faq-answer-content > * {
  transform: translateY(6px);
  transition: transform 0.4s cubic-bezier(0.2, 0.9, 0.4, 1);
  transition-delay: 0s;
}

.faq-item.active .faq-answer-content > * {
  transform: translateY(0);
}

.faq-answer-content > *:nth-child(1) { transition-delay: 0.12s; }
.faq-answer-content > *:nth-child(2) { transition-delay: 0.18s; }
.faq-answer-content > *:nth-child(3) { transition-delay: 0.24s; }
.faq-answer-content > *:nth-child(4) { transition-delay: 0.30s; }
.faq-answer-content > *:nth-child(5) { transition-delay: 0.36s; }

/* ── Responsive ── */
@media (max-width: 992px) {
  .studies-faq-grid {
    grid-template-columns: 1fr;
    max-width: 800px;
    margin: 0 auto;
    gap: 1.25rem;
  }
}

@media (max-width: 768px) {
  .faq-question {
    padding: 1.25rem 1.5rem;
  }

  .faq-question-text {
    font-size: 1.05rem;
  }

  .faq-answer-content {
    padding: 0 1.5rem 1.25rem 1.5rem;
  }
}

@media (max-width: 480px) {
  .studies-faq-section { padding: 2rem 0; }
  .studies-faq-title { font-size: 1.3rem; padding: 0 12px; }
  .studies-faq-subtitle { font-size: 0.85rem; padding: 0 12px; }
  .faq-question { padding: 1rem 1.25rem; }
  .faq-question-text { font-size: 0.92rem; }
  .faq-answer-content { padding: 0 1.25rem 1rem 1.25rem; }
  .faq-answer-text { font-size: 0.85rem; }
}
