/* Modern FAQ Section Styles */

.faq-section {
  padding: 80px 0;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  position: relative;
  overflow: hidden;
  overflow-x: clip;
}

.faq-section::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(102, 126, 234, 0.1) 0%, transparent 70%);
  border-radius: 50%;
  animation: float 8s ease-in-out infinite;
}

.faq-section::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -5%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(118, 75, 162, 0.1) 0%, transparent 70%);
  border-radius: 50%;
  animation: float 10s ease-in-out infinite reverse;
}

.faq-container {
  position: relative;
  z-index: 2;
}

.faq-section,
.faq-container,
.faq-tabs,
.faq-content,
.faq-item,
.faq-question,
.faq-answer,
.faq-cta {
  box-sizing: border-box;
  max-width: 100%;
}

/* FAQ Tabs */
.faq-tabs {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 50px;
  width: 100%;
}

.faq-tab {
  padding: 12px 30px;
  background: #ffffff;
  border: 2px solid #e0e0e0;
  border-radius: 50px;
  color: #333;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  outline: none;
  max-width: 100%;
  white-space: normal;
}

.faq-tab::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  transform: translate(-50%, -50%);
  transition: width 0.4s ease, height 0.4s ease;
  z-index: -1;
}

.faq-tab:hover::before,
.faq-tab.active::before {
  width: 300px;
  height: 300px;
}

.faq-tab:hover,
.faq-tab.active {
  color: #ffffff;
  border-color: #667eea;
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(102, 126, 234, 0.3);
}

.faq-tab.search-match {
  border-color: #667eea;
  box-shadow: 0 4px 14px rgba(102, 126, 234, 0.22);
}

.faq-tab i {
  margin-right: 8px;
}

/* FAQ Content */
.faq-content {
  display: none;
  animation: fadeInUp 0.5s ease;
  width: 100%;
}

.faq-content.active {
  display: block;
}

/* Accordion Item */
.faq-item {
  background: #ffffff;
  border-radius: 15px;
  margin-bottom: 20px;
  overflow: hidden;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  opacity: 0;
  transform: translateY(20px);
  animation: slideInUp 0.5s ease forwards;
  width: 100%;
}

.faq-item:nth-child(1) { animation-delay: 0.1s; }
.faq-item:nth-child(2) { animation-delay: 0.2s; }
.faq-item:nth-child(3) { animation-delay: 0.3s; }
.faq-item:nth-child(4) { animation-delay: 0.4s; }
.faq-item:nth-child(5) { animation-delay: 0.5s; }
.faq-item:nth-child(6) { animation-delay: 0.6s; }

.faq-item:hover {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  transform: translateY(-3px);
}

/* Question */
.faq-question {
  padding: 25px 30px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  user-select: none;
  transition: all 0.3s ease;
  min-width: 0;
}

.faq-question:hover {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
}

.faq-item.active .faq-question {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  color: #667eea;
}

.faq-question h4 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #333;
  padding-right: 40px;
  line-height: 1.5;
  transition: color 0.3s ease;
  min-width: 0;
  overflow-wrap: anywhere;
}

.faq-item.active .faq-question h4 {
  color: #667eea;
}

/* Icon */
.faq-icon {
  width: 35px;
  height: 35px;
  min-width: 35px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  position: relative;
}

.faq-icon::before,
.faq-icon::after {
  content: '';
  position: absolute;
  background: #ffffff;
  transition: all 0.3s ease;
}

.faq-icon::before {
  width: 14px;
  height: 2px;
}

.faq-icon::after {
  width: 2px;
  height: 14px;
}

.faq-item.active .faq-icon {
  transform: rotate(45deg);
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

/* Answer */
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.4s ease;
  padding: 0 30px;
  width: 100%;
}

.faq-item.active .faq-answer {
  max-height: 1000px;
  padding: 0 30px 25px 30px;
}

.faq-answer p {
  margin: 0;
  color: #666;
  font-size: 15px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.faq-answer ul {
  margin: 15px 0 0 20px;
  padding: 0;
}

.faq-answer li {
  color: #666;
  font-size: 15px;
  line-height: 1.8;
  margin-bottom: 8px;
  position: relative;
  overflow-wrap: anywhere;
}

@supports not (overflow: clip) {
  .faq-section {
    overflow-x: hidden;
  }
}

.faq-answer li::before {
  content: '✓';
  color: #667eea;
  font-weight: bold;
  margin-right: 8px;
}

/* Animations */
@keyframes slideInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Contact CTA */
.faq-cta {
  text-align: center;
  margin-top: 60px;
  padding: 40px;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.faq-cta h3 {
  font-size: 28px;
  color: #333;
  margin-bottom: 15px;
  font-weight: 700;
}

.faq-cta p {
  color: #666;
  font-size: 16px;
  margin-bottom: 25px;
}

.faq-cta-btn {
  display: inline-block;
  padding: 15px 40px;
  background: linear-gradient(135deg, #4b67e6 0%, #764ba2 100%);
  color: #ffffff;
  text-decoration: none;
  border-radius: 50px;
  font-weight: 600;
  font-size: 16px;
  transition: all 0.3s ease;
  box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.faq-cta-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(102, 126, 234, 0.6);
  text-decoration: none;
  color: #ffffff;
}

.faq-cta-btn i {
  margin-left: 8px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .faq-section {
    padding: 60px 0;
  }
  
  .faq-tabs {
    gap: 10px;
    margin-bottom: 30px;
  }
  
  .faq-tab {
    padding: 10px 18px;
    font-size: 14px;
    border-radius: 999px;
    overflow: hidden;
    isolation: isolate;
  }
  
  .faq-question {
    padding: 20px 20px;
  }
  
  .faq-question h4 {
    font-size: 16px;
    padding-right: 30px;
  }
  
  .faq-icon {
    width: 30px;
    height: 30px;
    min-width: 30px;
  }
  
  .faq-icon::before {
    width: 12px;
  }
  
  .faq-icon::after {
    height: 12px;
  }
  
  .faq-answer {
    padding: 0 20px;
  }
  
  .faq-item.active .faq-answer {
    padding: 0 20px 20px 20px;
  }
  
  .faq-answer p,
  .faq-answer li {
    font-size: 14px;
  }
  
  .faq-cta {
    padding: 30px 20px;
  }
  
  .faq-cta h3 {
    font-size: 22px;
  }
  
  .faq-cta p {
    font-size: 14px;
  }
  
  .faq-cta-btn {
    padding: 12px 30px;
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .faq-tabs {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  
  .faq-tab {
    text-align: center;
    width: 100%;
    border-radius: 999px !important;
    background: #ffffff !important;
    border: 2px solid #d6deea !important;
    color: #2b3445 !important;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
  }

  /* Remove radial pseudo fill on narrow screens (causing half-colored tabs) */
  .faq-tab::before {
    content: none !important;
    display: none !important;
  }

  .faq-tab.active,
  .faq-tab:hover {
    background: linear-gradient(135deg, #4b67e6 0%, #764ba2 100%) !important;
    border-color: #667eea !important;
    color: #ffffff !important;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.28) !important;
    transform: none;
  }
  
  .faq-question h4 {
    font-size: 15px;
  }
}

/* Search Box */
.faq-search-box {
  max-width: 600px;
  margin: 0 auto 40px;
  position: relative;
}

.faq-search-input {
  width: 100%;
  padding: 18px 60px 18px 25px;
  border: 2px solid #e0e0e0;
  border-radius: 50px;
  font-size: 16px;
  transition: all 0.3s ease;
  background: #ffffff;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
}

.faq-search-input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 5px 30px rgba(102, 126, 234, 0.2);
}

.faq-search-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 45px;
  height: 45px;
  background: linear-gradient(135deg, #4b67e6 0%, #764ba2 100%);
  border: none;
  border-radius: 50%;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.faq-search-btn:hover {
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 5px 20px rgba(102, 126, 234, 0.5);
}

/* FAQ Brand Palette Sync */
.faq-tab::before,
.faq-tab.active,
.faq-tab:hover,
.faq-search-btn,
.faq-icon,
.faq-cta-btn {
  background: linear-gradient(135deg, #16b8e8 0%, #22d3c5 100%) !important;
}

.faq-tab.active,
.faq-tab:hover {
  border-color: #16b8e8 !important;
  box-shadow: 0 6px 20px rgba(22, 184, 232, 0.28) !important;
}

.faq-item.active .faq-question,
.faq-question:hover {
  background: linear-gradient(135deg, rgba(22, 184, 232, 0.09) 0%, rgba(34, 211, 197, 0.08) 100%) !important;
}

.faq-item.active .faq-question h4,
.faq-item.active .faq-icon::before,
.faq-item.active .faq-icon::after {
  color: #0f172a !important;
}

/* Final unified brand lock */
.faq-section::before {
  background: radial-gradient(circle, rgba(22, 184, 232, 0.1) 0%, transparent 70%) !important;
}

.faq-section::after {
  background: radial-gradient(circle, rgba(34, 211, 197, 0.1) 0%, transparent 70%) !important;
}

.faq-tab,
.faq-tab.search-match {
  border-color: #16b8e8 !important;
}

.faq-tab:hover,
.faq-tab.active {
  box-shadow: 0 5px 20px rgba(22, 184, 232, 0.3) !important;
}

.faq-question:hover {
  background: linear-gradient(135deg, rgba(22, 184, 232, 0.06) 0%, rgba(34, 211, 197, 0.06) 100%) !important;
}

.faq-item.active .faq-question {
  background: linear-gradient(135deg, rgba(22, 184, 232, 0.1) 0%, rgba(34, 211, 197, 0.1) 100%) !important;
  color: #16b8e8 !important;
}

.faq-item.active .faq-question h4,
.faq-item.active .faq-icon {
  color: #16b8e8 !important;
}

.faq-answer li::before {
  color: #16b8e8 !important;
}

.faq-search-input:focus {
  border-color: #16b8e8 !important;
  box-shadow: 0 5px 30px rgba(22, 184, 232, 0.22) !important;
}

.faq-search-btn:hover {
  box-shadow: 0 5px 20px rgba(22, 184, 232, 0.45) !important;
}
