/* ==========================================
   FAQ - PERFORMANCE OPTIMIZED
   ========================================== */
html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
}
/* Dark/Light Mode Variables */
[data-theme="light"] {
  --faq-bg-primary: #ffffff;
  --faq-bg-secondary: rgba(250, 250, 250, 0.5);
  --faq-text-primary: #1a202c;
  --faq-text-secondary: #2d3748;
  --faq-text-muted: #0a0b0c;
  --faq-border: #e2e8f0;
  --faq-card-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  --faq-card-shadow-hover: 0 15px 35px rgba(0, 0, 0, 0.12);
  --faq-search-bg: #ffffff;
  --faq-search-border: #cbd5e0;
  --faq-hover-bg: rgba(102, 126, 234, 0.05);
  --faq-input-focus-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
  --faq-text-home: #667eea;
  --faq-accent: #667eea;
  --cat-bottom-theme: linear-gradient(135deg, #621c9f, #2a0248, #621c9f);
}

/* DARK MODE - Manual Toggle */
[data-theme="dark"] {
  --faq-bg-primary: #1e1e1e;
  --faq-bg-secondary: #353535;
  --faq-text-primary: #f7fafc;
  --faq-text-secondary: #ffffff;
  --faq-text-muted: #a0aec0;
  --faq-border: #4a5568;
  --faq-card-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  --faq-card-shadow-hover: 0 15px 35px rgba(0, 0, 0, 0.6);
  --faq-search-bg: #353535;
  --faq-search-border: #4a5568;
  --faq-hover-bg: rgba(130, 153, 255, 0.15);
  --faq-input-focus-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
  --faq-text-home: #a78bfa;
  --faq-accent: #a78bfa;
}

/* DARK MODE - System Preference */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --faq-bg-primary: #1e1e1e;
    --faq-bg-secondary: #353535;
    --faq-text-primary: #f7fafc;
    --faq-text-secondary: #ffffff;
    --faq-text-muted: #a0aec0;
    --faq-border: #4a5568;
    --faq-card-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    --faq-card-shadow-hover: 0 15px 35px rgba(0, 0, 0, 0.6);
    --faq-search-bg: #353535;
    --faq-search-border: #4a5568;
    --faq-hover-bg: rgba(125, 149, 255, 0.15);
    --faq-input-focus-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    --faq-text-home: #a78bfa;
    --faq-accent: #a78bfa;
  }
}

* {
  box-sizing: border-box;
}

/* ==========================================
  CONTENT CONTAINER - FIXED HEIGHT TO PREVENT CLS
  ========================================== */
.contentContainer {
  max-width: 900px;
  margin: 0 auto;
  padding: clamp(15px, 3vw, 30px);
  width: 100%;
  /* Prevent layout shift by reserving minimum height */
  min-height: 100vh;
}

.contentContainer::after {
  content: "";
  position: absolute;
  bottom: -150px;
  left: -150px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--faq-glow) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
}

/* ==========================================
   HEADER & BREADCRUMB - FIXED DIMENSIONS
   ========================================== */
.faqHeader {
  text-align: center;
  margin-bottom: clamp(25px, 5vw, 50px);
  /* Reserve space to prevent shift */
  min-height: 180px;
}

.breadcrumb {
  color: var(--card-header) !important;
  margin-bottom: clamp(12px, 2.5vw, 18px);
  font-size: clamp(13px, 2vw, 16px);
  word-wrap: break-word;
  line-height: 1.5;
  /* Fixed height to prevent CLS */
  min-height: 24px;
}

.breadcrumb a {
  color: var(--card-header) !important;
  text-decoration: none;
  font-weight: 500;
}

.breadcrumb a:hover {
  text-decoration: underline;
  opacity: 0.8;
}

.current {
  color: var(--faq-text-muted) !important;
  font-weight: bold;
}

.pageTitle {
  font-size: clamp(2rem, 5.5vw, 3.5rem);
  font-weight: 900;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #667eea 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: clamp(15px, 3vw, 20px);
  line-height: 1.2;
  padding: 0 clamp(10px, 2vw, 20px);
  letter-spacing: -0.02em;
  animation: gradientShift 5s ease infinite;
  filter: drop-shadow(0 4px 12px var(--faq-glow));
  /* Reserve space for title */
  min-height: 70px;
  /* Use will-change sparingly for animated elements */
  will-change: background-position;
}

@keyframes gradientShift {
  0%,
  100% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }
}

.pageDescription {
  color: var(--faq-text-secondary);
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  margin-bottom: clamp(30px, 5vw, 45px);
  padding: 0 clamp(15px, 3vw, 25px);
  line-height: 1.7;
  max-width: 750px;
  margin-left: auto;
  margin-right: auto;
  font-weight: 400;
  opacity: 0.9;
  /* Reserve space */
  min-height: 60px;
}

/* ==========================================
   SEARCH BOX - FIXED HEIGHT TO PREVENT CLS
   ========================================== */
.faqSearchWrapper {
  position: relative;
  margin: 0 auto clamp(40px, 6vw, 55px);
  max-width: 900px;
  width: 100%;
  /* Fixed height to prevent layout shift */
  height: 70px;
}

.faqSearchInput {
  width: 100% !important;
  max-width: 100% !important;
  height: 100% !important;
  padding: 20px 24px 20px 60px !important;
  border: 2px solid var(--faq-search-border) !important;
  border-radius: 16px !important;
  font-size: 17px !important;
  font-weight: 500 !important;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease !important;
  outline: none !important;
  background: var(--faq-search-bg) !important;
  color: var(--faq-text-primary) !important;
  box-sizing: border-box !important;
  font-family: inherit !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
  /* Use contain for better performance */
  contain: layout style;
}

.faqSearchInput::placeholder {
  color: var(--faq-text-muted) !important;
  font-weight: 500 !important;
}

.faqSearchInput:focus {
  border-color: transparent !important;
  box-shadow: 0 12px 40px var(--faq-input-focus-shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
  background: var(--faq-search-bg) !important;
  transform: translateY(-3px) scale(1.01);
}

.faqSearchIcon {
  position: absolute;
  left: 22px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--faq-text-muted);
  font-size: 20px;
  pointer-events: none;
  transition: color 0.3s ease, transform 0.3s ease;
  /* Optimize icon rendering */
  will-change: transform;
}

.faqSearchInput:focus ~ .faqSearchIcon {
  color: #667eea;
  transform: translateY(-50%) scale(1.1);
}

/* ==========================================
   FAQ ITEMS - OPTIMIZED FOR PERFORMANCE
   ========================================== */
.faqItemsWrapper {
  display: flex;
  flex-direction: column;
  gap: clamp(18px, 3vw, 24px);
  width: 100%;
  /* Optimize rendering */
  contain: layout;
}

.faqItem {
  background: var(--faq-bg-primary);
  box-shadow: var(--faq-card-shadow);
  border-radius: clamp(14px, 2.5vw, 20px);
  overflow: hidden;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
  border: 1px solid var(--faq-border);
  width: 100%;
  position: relative;
  /* Optimize rendering */
  contain: layout style;
  /* Use transform3d for GPU acceleration */
  transform: translate3d(0, 0, 0);
}

.faqItem::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 0;
  background: var(--faq-accent);
  transition: height 0.3s ease;
  border-radius: 0 4px 4px 0;
  /* Optimize animation */
  will-change: height;
}

.faqItem:hover::before {
  height: 100%;
}

/* ==========================================
   FAQ QUESTION - FIXED HEIGHT
   ========================================== */
.faqQuestion {
  width: 100%;
  min-height: 68px;
  padding: clamp(18px, 3.5vw, 24px) clamp(20px, 3.5vw, 28px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: clamp(12px, 2.5vw, 18px);
  background: transparent;
  border: none;
  cursor: pointer;
  font-weight: 700;
  font-size: clamp(14px, 2.2vw, 17px);
  color: var(--faq-text-primary);
  border-bottom: 1px solid var(--faq-border);
  transition: background 0.3s ease, transform 0.3s ease;
  text-align: left;
  line-height: 1.6;
  position: relative;
  /* Optimize rendering */
  contain: layout style;
}

.faqQuestion::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--faq-accent);
  transition: width 0.3s ease;
  /* Optimize animation */
  will-change: width;
}

.faqQuestion:hover::after {
  width: 100%;
}

.faqQuestion span {
  font-weight: 700;
  font-size: clamp(14px, 2.2vw, 17px);
  color: var(--faq-text-primary);
  flex: 1;
  word-wrap: break-word;
  overflow-wrap: break-word;
  letter-spacing: -0.01em;
}

/* ==========================================
   FAQ ICON 
   ========================================== */
.faqIcon {
  font-size: clamp(16px, 2.2vw, 20px);
  color: var(--faq-text-muted);
  flex-shrink: 0;
  min-width: 24px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--faq-hover-bg);
  border-radius: 50%;
  padding: 4px;
  transition: transform 0.3s ease, color 0.3s ease, background 0.3s ease;
  /* Optimize rotation animation */
  will-change: transform;
}

.rotate {
  transform: rotate(180deg);
  color: #2143cb;
  background: linear-gradient(
    135deg,
    rgba(102, 126, 234, 0.15) 0%,
    rgba(118, 75, 162, 0.15) 100%
  );
}

/* ==========================================
   FAQ ANSWER - OPTIMIZED TRANSITIONS
   ========================================== */
.faqAnswer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
  /* Optimize rendering */
  contain: layout;
}

.faqAnswerContent {
  padding: clamp(18px, 3.5vw, 26px) clamp(20px, 3.5vw, 28px);
  background: var(--faq-bg-secondary);
  border-top: 1px solid var(--faq-border);
  animation: fadeInAnswer 0.4s ease forwards;
  /* Optimize animation performance */
  will-change: opacity, transform;
}

.faqAnswerContent p {
  margin: 0;
  color: var(--faq-text-secondary);
  line-height: 1.8;
  font-size: clamp(14px, 2vw, 16px);
  word-wrap: break-word;
  overflow-wrap: break-word;
  font-weight: 500;
}

@keyframes fadeInAnswer {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================
   NO RESULTS 
   ========================================== */
.faqNoResults {
  text-align: center;
  padding: clamp(60px, 10vw, 90px) clamp(20px, 4vw, 30px);
  background: var(--faq-bg-secondary);
  border-radius: 20px;
  border: 1px dashed var(--faq-border);
  /* Reserve minimum height */
  min-height: 200px;
}

.faqNoResults h3 {
  color: var(--faq-text-primary);
  margin-bottom: clamp(12px, 2.5vw, 18px);
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 800;
}

.faqNoResults p {
  color: var(--faq-text-muted);
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  line-height: 1.7;
  font-weight: 500;
}

/* ==========================================
   CTA SECTION - FIXED HEIGHT TO PREVENT CLS
   ========================================== */
.faqCtaSection {
  margin-top: clamp(40px, 8vw, 70px);
  position: relative;
  background: var(--cat-bottom-theme);
  border-radius: clamp(14px, 3vw, 24px);
  padding: clamp(35px, 6vw, 60px) clamp(20px, 5vw, 40px);
  text-align: center;
  color: white;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(102, 126, 234, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.1) inset;
  /* CRITICAL: Reserve space to prevent CLS */
  min-height: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  /* Optimize rendering */
  contain: layout style;
}

.faqCtaSection::after {
  content: "";
  position: absolute;
  bottom: -100px;
  right: -100px;
  width: clamp(200px, 30vw, 350px);
  height: clamp(200px, 30vw, 350px);
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.08) 0%,
    transparent 70%
  );
  border-radius: 50%;
  pointer-events: none;
}

.faqCtaSection > * {
  position: relative;
  z-index: 1;
}

.faqCtaSection h2 {
  min-height: 3rem;
  margin: 0 0 clamp(10px, 2vw, 16px) 0;
  font-size: clamp(1.4rem, 4vw, 2.3rem);
  font-weight: 700;
  line-height: 1.3;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.2);
  letter-spacing: -0.02em;
  word-wrap: break-word;
}

.faqCtaSection p {
  min-height: 3.5rem;
  margin: 0 auto clamp(22px, 4vw, 32px);
  font-size: clamp(0.95rem, 2.2vw, 1.2rem);
  line-height: 1.6;
  opacity: 0.95;
  max-width: 650px;
  word-wrap: break-word;
}

/* CTA Icon Wrapper - FIXED SIZE */
.ctaIconWrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(55px, 10vw, 80px);
  height: clamp(55px, 10vw, 80px);
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border-radius: 50%;
  margin-bottom: clamp(18px, 3vw, 24px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1),
    0 0 0 1px rgba(255, 255, 255, 0.2) inset;
  /* Fixed dimensions prevent shift */
  flex-shrink: 0;
}

/* CTA Icon */
.ctaIcon {
  color: white;
  font-size: clamp(28px, 6vw, 48px);
  transition: transform 0.3s ease, color 0.3s ease;
  will-change: transform;
}

/* CTA Button - FIXED HEIGHT */
.ctaButton {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: clamp(8px, 1.5vw, 12px);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  color: #591bcf;
  font-weight: 600;
  padding: clamp(12px, 2.5vw, 16px) clamp(28px, 6vw, 48px);
  min-height: 48px;
  border-radius: clamp(10px, 2vw, 14px);
  text-decoration: none;
  font-size: clamp(14px, 2vw, 17px);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(255, 255, 255, 0.5) inset;
  letter-spacing: 0.01em;
  border: none;
  transition: background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
  /* Optimize animation */
  will-change: transform;
}

.ctaButton::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.5),
    transparent
  );
  transition: left 0.5s ease;
}

/* ==========================================
   HOVER EFFECTS - DESKTOP ONLY
   ========================================== */
@media (hover: hover) and (pointer: fine) {
  .faqItem:hover {
    box-shadow: var(--faq-card-shadow-hover);
    transform: translate3d(0, -3px, 0) scale(1.01);
  }

  .faqQuestion:hover {
    background: var(--faq-hover-bg);
    transform: translateX(5px);
  }

  .faqCtaSection:hover {
    box-shadow: 0 30px 80px rgba(102, 126, 234, 0.4),
      0 0 0 1px rgba(255, 255, 255, 0.15) inset;
  }

  .ctaButton:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25),
      0 0 0 1px rgba(255, 255, 255, 0.6) inset;
  }

  .ctaButton:hover::before {
    left: 100%;
  }

  .ctaButton:hover i {
    transform: translateX(3px);
  }

  .ctaButton:active {
    transform: translateY(0px) scale(0.98);
  }
}

/* ==========================================
   RESPONSIVE - OPTIMIZED BREAKPOINTS
   ========================================== */

/* Mobile Small (320px - 479px) */
@media (max-width: 479px) {
  .faqHeader {
    min-height: 140px;
  }

  .pageTitle {
    min-height: 50px;
  }

  .pageDescription {
    min-height: 50px;
  }

  .faqSearchWrapper {
    height: 60px;
  }

  .faqQuestion {
    min-height: 56px;
  }

  .faqCtaSection {
    min-height: 280px;
  }

  .faqCtaSection h2 {
    min-height: 2.5rem;
  }

  .faqCtaSection p {
    min-height: 3rem;
  }
}

/* Tablet (600px - 991px) */
@media (min-width: 600px) and (max-width: 991px) {
  .faqSearchWrapper {
    height: 65px;
  }

  .faqQuestion {
    min-height: 60px;
  }
}

/* ==========================================
   ACCESSIBILITY - REDUCED MOTION
   ========================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  /* Remove will-change for reduced motion */
  .pageTitle,
  .faqSearchIcon,
  .faqItem::before,
  .faqQuestion::after,
  .faqIcon,
  .faqAnswerContent,
  .ctaButton {
    will-change: auto !important;
  }
}

/* ==========================================
   TOUCH DEVICE OPTIMIZATIONS
   ========================================== */
@media (hover: none) and (pointer: coarse) {
  .faqQuestion {
    min-height: 60px;
    padding: 16px 18px;
  }

  .faqSearchInput {
    min-height: 56px;
  }

  .ctaButton {
    min-height: 56px;
    padding: 14px 28px;
  }

  .faqItem:active {
    transform: scale(0.98);
  }

  .faqQuestion:active {
    background: var(--faq-hover-bg);
  }

  .ctaButton:active {
    transform: scale(0.97);
  }
}

/* ==========================================
   SELECTION STYLES
   ========================================== */
::selection {
  background: rgba(102, 126, 234, 0.3);
  color: var(--faq-text-primary);
}

::-moz-selection {
  background: rgba(102, 126, 234, 0.3);
  color: var(--faq-text-primary);
}