/**
 * HrdFlex FAQ Theme CSS
 * FAQ 섹션 전용 스타일
 * Created: 배서연
 */

/* ========================================
   1. FAQ 컨테이너 & 레이아웃
   ======================================== */

/* 헤더 겹침 방지 & 중앙 정렬 */
#section {
  padding-top: 110px;
  max-width: 1400px;
  margin: 0 auto;
}

.faq-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 12%;
  margin-bottom: 4rem;
}

.faq-header {
  text-align: center;
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 2px solid var(--border-light);
}

.faq-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 1rem;
  line-height: 1.3;
}

.faq-subtitle {
  font-size: 1.1rem;
  color: var(--text-gray);
  line-height: 1.6;
}

/* ========================================
   2. FAQ 카테고리 탭
   ======================================== */
.faq-tabs {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 2.5rem;
  padding: 0.5rem;
  background: var(--bg-light);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  scrollbar-width: thin;
}

.faq-category-title{
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 1.5rem;
  text-align: center;
}

.faq-tabs::-webkit-scrollbar {
  height: 6px;
}

.faq-tabs::-webkit-scrollbar-track {
  background: var(--bg-light);
}

.faq-tabs::-webkit-scrollbar-thumb {
  background: var(--border-gray);
  border-radius: 3px;
}

.faq-tab {
  padding: 0.75rem 1.5rem;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--font-size-base);
  font-weight: 500;
  color: var(--text-gray);
  cursor: pointer;
  transition: var(--transition-smooth);
  white-space: nowrap;
  position: relative;
  text-decoration: none;
}

.faq-tab:hover {
  color: var(--text-dark);
  background: rgba(255, 255, 255, 0.5);
}

.faq-tab.active {
  background: white;
  color: var(--primary-blue);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.faq-tab.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 20%;
  right: 20%;
  height: 3px;
  background: var(--primary-blue);
  border-radius: 2px;
}

/* ========================================
   3. FAQ 아코디언
   ======================================== */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.faq-item {
  background: white;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition-smooth);
}

.faq-item:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.faq-item.active {
  border-color: var(--primary-blue);
  box-shadow: 0 6px 20px rgba(0, 102, 255, 0.1);
}

/* FAQ 질문 헤더 */
.faq-question {
  width: 100%;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: var(--transition-base);
  text-align: left;
  font-family: var(--font-family);
}

.faq-item.active .faq-question {
  background: rgba(0, 102, 255, 0.03);
}

.faq-question:hover {
  background: var(--bg-light);
}

.faq-question-content {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
}

.faq-q-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--primary-blue) 0%, #0052cc 100%);
  color: white;
  border-radius: 50%;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}

.faq-question-text {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-dark);
  line-height: 1.5;
  flex: 1;
}

.faq-arrow {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
  color: var(--text-gray);
}

.faq-arrow svg {
  width: 20px;
  height: 20px;
  transition: transform 0.3s ease;
}

.faq-item.active .faq-arrow svg {
  transform: rotate(180deg);
}

.faq-item.active .faq-arrow {
  color: var(--primary-blue);
}

/* FAQ 답변 */
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-item.active .faq-answer {
  max-height: 1000px;
}

.faq-answer-content {
  padding: 0 1.5rem 1.5rem 1.5rem;
}

.faq-answer-inner {
  padding: 1.25rem;
  background: var(--bg-light);
  border-radius: var(--radius-md);
  border-left: 4px solid var(--primary-blue);
}

.faq-a-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: rgba(34, 197, 94, 0.1);
  color: #059669;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.9rem;
  margin-right: 0.75rem;
  margin-bottom: 0.5rem;
  float: left;
}

.faq-answer-text {
  font-size: 0.95rem;
  color: var(--text-dark);
  line-height: 1.7;
  overflow: hidden;
}

.faq-answer-text p {
  margin-bottom: 1rem;
}

.faq-answer-text p:last-child {
  margin-bottom: 0;
}

.faq-answer-text ul,
.faq-answer-text ol {
  margin: 1rem 0 1rem 1.5rem;
}

.faq-answer-text li {
  margin-bottom: 0.5rem;
}

.faq-answer-text strong {
  font-weight: 600;
  color: var(--text-dark);
}

/* ========================================
   4. FAQ 검색
   ======================================== */
.faq-search-box {
  max-width: 600px;
  margin: 0 auto 3rem;
  position: relative;
}

.faq-search-input {
  width: 100%;
  padding: 1rem 3.5rem 1rem 1.25rem;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-full);
  font-size: 1rem;
  transition: var(--transition-base);
  background: white;
}

.faq-search-input:focus {
  border-color: var(--primary-blue);
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.1);
}

.faq-search-button {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background: var(--primary-blue);
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-base);
}

.faq-search-button:hover {
  background: #0052cc;
  transform: translateY(-50%) scale(1.05);
}

/* ========================================
   5. FAQ 통계/정보 박스
   ======================================== */
.faq-info-boxes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.faq-info-box {
  padding: 1.5rem;
  background: linear-gradient(135deg, white 0%, var(--bg-light) 100%);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  text-align: center;
  transition: var(--transition-smooth);
}

.faq-info-box:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.faq-info-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 1rem;
  background: linear-gradient(135deg, var(--primary-blue) 0%, #0052cc 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
}

.faq-info-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
}

.faq-info-desc {
  font-size: 0.9rem;
  color: var(--text-gray);
}

/* ========================================
   6. 로딩 & 빈 상태
   ======================================== */
.faq-empty {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--bg-light);
  border-radius: var(--radius-lg);
  margin: 2rem 0;
}

.faq-empty-icon {
  font-size: 4rem;
  color: var(--text-gray);
  margin-bottom: 1rem;
}

.faq-empty-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
}

.faq-empty-desc {
  color: var(--text-gray);
}

/* ========================================
   7. 반응형 디자인
   ======================================== */
@media (max-width: 1024px) {
  .faq-container {
    padding: 2rem 5%;
  }
}

@media (max-width: 768px) {
  #section {
    padding-top: 80px;
  }

  .faq-container {
    padding: 1.5rem 3%;
  }

  .faq-title {
    font-size: 2rem;
  }

  .faq-tabs {
    gap: 0.25rem;
    padding: 0.25rem;
  }

  .faq-tab {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
  }

  .faq-question {
    padding: 1rem;
  }

  .faq-question-content {
    gap: 0.75rem;
  }

  .faq-q-icon {
    width: 28px;
    height: 28px;
    font-size: 0.9rem;
  }

  .faq-question-text {
    font-size: 0.95rem;
  }

  .faq-answer-inner {
    padding: 1rem;
  }

  .faq-info-boxes {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  #section {
    padding-top: 60px;
  }

  .faq-container {
    padding: 1rem;
  }

  .faq-title {
    font-size: 1.5rem;
  }

  .faq-subtitle {
    font-size: 1rem;
  }

  .faq-tabs {
    justify-content: flex-start;
    overflow-x: auto;
  }

  .faq-tab {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
  }

  .faq-question {
    padding: 0.75rem;
  }

  .faq-q-icon {
    width: 24px;
    height: 24px;
    font-size: 0.8rem;
  }

  .faq-question-text {
    font-size: 0.9rem;
  }

  .faq-arrow {
    width: 20px;
    height: 20px;
  }

  .faq-answer-content {
    padding: 0 0.75rem 0.75rem 0.75rem;
  }

  .faq-answer-text {
    font-size: 0.9rem;
  }

  .faq-search-input {
    font-size: 0.9rem;
    padding: 0.75rem 3rem 0.75rem 1rem;
  }

  .faq-search-button {
    width: 36px;
    height: 36px;
  }
}

/* ========================================
   8. 애니메이션 & 인터랙션
   ======================================== */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.faq-item.active .faq-answer-content {
  animation: slideDown 0.4s ease;
}

/* 키보드 포커스 스타일 */
.faq-question:focus-visible {
  outline: 2px solid var(--primary-blue);
  outline-offset: 2px;
}

.faq-tab:focus-visible {
  outline: 2px solid var(--primary-blue);
  outline-offset: 2px;
}

/* ========================================
   9. 도움말 툴팁
   ======================================== */
.faq-tooltip {
  position: relative;
  display: inline-block;
  margin-left: 0.5rem;
}

.faq-tooltip-icon {
  width: 18px;
  height: 18px;
  background: var(--text-gray);
  color: white;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  cursor: help;
}

.faq-tooltip-content {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.5rem 0.75rem;
  background: var(--text-dark);
  color: white;
  font-size: 0.85rem;
  border-radius: var(--radius-md);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-base);
  margin-bottom: 0.5rem;
  z-index: var(--z-tooltip);
}

.faq-tooltip:hover .faq-tooltip-content {
  opacity: 1;
  visibility: visible;
}

/* ========================================
   10. 프린트 스타일
   ======================================== */
@media print {
  .faq-tabs,
  .faq-search-box,
  .faq-arrow {
    display: none !important;
  }

  .faq-item {
    page-break-inside: avoid;
    border: 1px solid #ddd;
    margin-bottom: 1rem;
  }

  .faq-item .faq-answer {
    max-height: none !important;
    display: block !important;
  }
}