/* FAQ 섹션 - 현대적이고 최신 디자인 */
.section-faq {
  width: 100%;
  padding: 0;
  box-sizing: border-box;
  background: transparent;
  color: #1f2937;
  position: relative;
  overflow: hidden;
}

.section-faq::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(44, 90, 160, 0.1), transparent);
}

.faq-container {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  position: relative;
}

.faq-title {
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 700;
  margin: 0 auto 112px;
  line-height: 1.15;
  color: #0f172a;
  text-align: center;
  letter-spacing: -0.06em;
  max-width: 100%;
  padding: 140px 0 0;
  position: relative;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.faq-title::after {
  display: none;
}

/* 공통 FAQ 항목 스타일 */
.faq-item {
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 0;
  background: #ffffff;
  box-shadow: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  padding: 0;
  margin: 0 0 16px 0;
  position: relative;
}

.faq-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 0;
  background: linear-gradient(180deg, #2c5aa0, #1e40af);
  transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 0;
}

.faq-item:hover {
  box-shadow: none;
  transform: translateY(0);
  border-color: rgba(0, 0, 0, 0.1);
}

.faq-item.active {
  box-shadow: none;
  border-color: rgba(0, 0, 0, 0.1);
}

.faq-item.active::before {
  height: 100%;
}

.faq-question {
  width: 100%;
  padding: 24px 28px;
  background: transparent;
  border: none;
  font-size: clamp(18px, 2.2vw, 21px);
  font-weight: 600;
  color: #0f172a;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  line-height: 1.6;
  position: relative;
  text-align: left;
}

.faq-question-text {
  flex: 1;
  position: relative;
}

/* 정렬 옵션 - 질문 텍스트 */
.faq-align-left .faq-question-text {
  text-align: left;
}

.faq-align-center .faq-question-text {
  text-align: center;
}

.faq-align-right .faq-question-text {
  text-align: right;
}

/* 정렬 옵션 - 답변 텍스트 */
.faq-align-left .faq-answer {
  text-align: left;
}

.faq-align-center .faq-answer {
  text-align: center;
}

.faq-align-right .faq-answer {
  text-align: right;
}

.faq-expand-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s ease;
  color: #64748b;
  background: rgba(44, 90, 160, 0.05);
  border-radius: 0;
}

.faq-expand-icon svg {
  width: 100%;
  height: 100%;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-item.active .faq-expand-icon {
  color: #2c5aa0;
  background: rgba(44, 90, 160, 0.1);
  transform: rotate(45deg);
}

.faq-item.active .faq-expand-icon svg {
  transform: rotate(45deg);
}

.faq-question:hover {
  color: #2c5aa0;
}

.faq-question:hover .faq-expand-icon {
  color: #2c5aa0;
  background: rgba(44, 90, 160, 0.1);
}

.faq-answer {
  padding: 0 28px;
  font-size: clamp(16px, 2.1vw, 19px);
  line-height: 1.8;
  color: #475569;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
              padding 0.4s ease, 
              opacity 0.3s ease;
  padding-top: 0;
  position: relative;
}

.faq-item.active .faq-answer {
  padding-top: 0;
  padding-bottom: 24px;
  max-height: 5000px;
  opacity: 1;
}

.faq-answer p {
  margin: 0 0 20px 0;
}

.faq-answer p:last-child {
  margin-bottom: 0;
}

.faq-answer strong {
  color: #0f172a;
  font-weight: 600;
}

.faq-answer a {
  color: #2c5aa0;
  text-decoration: none;
  border-bottom: 2px solid rgba(44, 90, 160, 0.2);
  transition: all 0.3s ease;
  font-weight: 500;
}

.faq-answer a:hover {
  border-bottom-color: #2c5aa0;
  color: #1e40af;
}

/* ===== 사이드바 레이아웃 ===== */
.faq-template-sidebar .faq-content-wrapper {
  width: 100%;
  max-width: 100%;
  padding: 0 0 120px;
}

.faq-template-sidebar .faq-sidebar-wrapper {
  display: grid;
  grid-template-columns: 2fr 2fr 6fr;
  gap: 0;
  max-width: 100%;
  align-items: flex-start;
}

/* 단일 FAQ 모드 (카테고리 없이 표시) */
.faq-single-mode .faq-sidebar-wrapper {
  display: grid;
  grid-template-columns: 3fr 7fr;
  gap: 0;
  max-width: 100%;
  align-items: flex-start;
}

.faq-single-mode .faq-sidebar {
  display: none;
}

.faq-single-mode .faq-main {
  min-width: 0;
}

/* 단일 모드에서도 PC에서 오른쪽 답변 열 표시 */
@media (min-width: 769px) {
  .faq-single-mode .faq-answer-column {
    display: block !important;
  }
  
  .faq-single-mode .faq-main-items .faq-answer {
    display: none;
  }
}

/* 정렬 옵션 - 사이드바 템플릿 */
.faq-sidebar-btn-text {
  display: block;
  width: 100%;
}

.faq-container.faq-align-left .faq-sidebar-btn-text,
.faq-align-left .faq-sidebar-btn-text {
  text-align: left !important;
}

.faq-container.faq-align-center .faq-sidebar-btn-text,
.faq-align-center .faq-sidebar-btn-text {
  text-align: center !important;
}

.faq-container.faq-align-right .faq-sidebar-btn-text,
.faq-align-right .faq-sidebar-btn-text {
  text-align: right !important;
}

.faq-container.faq-align-right .faq-template-sidebar .faq-sidebar-btn:hover {
  transform: translateX(-4px);
}

.faq-template-sidebar .faq-sidebar {
  background: transparent;
  border-radius: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  position: sticky;
  top: 180px;
  max-height: calc(100vh - 220px);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
  box-shadow: none;
  border: none;
  min-width: 0;
}

.faq-template-sidebar .faq-sidebar::-webkit-scrollbar {
  width: 6px;
}

.faq-template-sidebar .faq-sidebar::-webkit-scrollbar-track {
  background: #f8fafc;
  border-radius: 3px;
}

.faq-template-sidebar .faq-sidebar::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
  transition: background 0.3s ease;
}

.faq-template-sidebar .faq-sidebar::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.faq-template-sidebar .faq-sidebar-btn {
  width: 100%;
  padding: 16px 20px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 0;
  font-size: clamp(17px, 2.2vw, 21px);
  font-weight: 500;
  color: #475569;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  text-align: left;
  box-sizing: border-box;
  margin: 0 0 8px 0;
  box-shadow: none;
}

.faq-template-sidebar .faq-sidebar-btn::before {
  display: none;
}

.faq-container.faq-align-left .faq-sidebar-btn:hover,
.faq-align-left .faq-sidebar-btn:hover {
  transform: translateX(2px);
  background: #f8fafc;
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: none;
}

.faq-container.faq-align-center .faq-sidebar-btn:hover,
.faq-align-center .faq-sidebar-btn:hover {
  transform: translateY(-1px);
  background: #f8fafc;
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: none;
}

.faq-container.faq-align-right .faq-sidebar-btn:hover,
.faq-align-right .faq-sidebar-btn:hover {
  transform: translateX(-2px);
  background: #f8fafc;
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: none;
}

.faq-template-sidebar .faq-sidebar-btn.active {
  color: #2c5aa0;
  font-weight: 600;
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: none;
}

.faq-template-sidebar .faq-sidebar-btn.active::before {
  display: none;
}

.faq-template-sidebar .faq-main {
  min-width: 0;
}

.faq-template-sidebar .faq-main-items {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 100%;
}

/* 오른쪽 답변 열 (PC 전용) */
.faq-template-sidebar .faq-answer-column {
  display: none;
  min-width: 0;
  padding: 0 24px;
  position: sticky;
  top: 180px;
  max-height: calc(100vh - 220px);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.faq-template-sidebar .faq-answer-column::-webkit-scrollbar {
  width: 6px;
}

.faq-template-sidebar .faq-answer-column::-webkit-scrollbar-track {
  background: #f8fafc;
  border-radius: 3px;
}

.faq-template-sidebar .faq-answer-column::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
  transition: background 0.3s ease;
}

.faq-template-sidebar .faq-answer-column::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.faq-template-sidebar .faq-answer-content {
  background: #ffffff;
  border-radius: 0;
  padding: 28px;
  font-size: clamp(16px, 2.1vw, 19px);
  line-height: 1.8;
  color: #475569;
  box-shadow: none;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.faq-template-sidebar .faq-answer-content p {
  margin: 0 0 20px 0;
}

.faq-template-sidebar .faq-answer-content p:last-child {
  margin-bottom: 0;
}

.faq-template-sidebar .faq-answer-content strong {
  color: #0f172a;
  font-weight: 600;
}

.faq-template-sidebar .faq-answer-content a {
  color: #2c5aa0;
  text-decoration: none;
  border-bottom: 2px solid rgba(44, 90, 160, 0.2);
  transition: all 0.3s ease;
  font-weight: 500;
}

.faq-template-sidebar .faq-answer-content a:hover {
  border-bottom-color: #2c5aa0;
  color: #1e40af;
}

/* PC에서 메인 영역의 답변 숨기기 (단일 모드가 아닐 때만) */
@media (min-width: 769px) {
  .faq-template-sidebar:not(.faq-single-mode) .faq-main-items .faq-answer {
    display: none;
  }
  
  .faq-template-sidebar:not(.faq-single-mode) .faq-answer-column {
    display: block;
  }
  
}

/* ===== 반응형 스타일 (768px 기준) ===== */
@media (max-width: 768px) {
  .section-faq {
    background: transparent;
  }

  .faq-container {
    padding: 0;
  }

  .faq-title {
    font-size: clamp(30px, 6.5vw, 46px);
    margin-bottom: 80px;
    padding: 100px 24px 0;
  }

  .faq-title::after {
    display: none;
  }

  /* 사이드바 템플릿 모바일 */
  .faq-template-sidebar .faq-content-wrapper {
    padding: 0 24px 80px;
  }

  .faq-template-sidebar .faq-sidebar-wrapper {
    grid-template-columns: 1fr;
    gap: 48px;
  }
  
  /* 단일 모드 모바일 */
  .faq-single-mode .faq-sidebar-wrapper {
    grid-template-columns: 1fr;
    gap: 0;
  }
  
  /* 모바일에서 오른쪽 답변 열 숨기기 */
  .faq-template-sidebar .faq-answer-column {
    display: none !important;
  }
  
  /* 모바일에서 메인 영역의 답변 다시 표시 */
  .faq-template-sidebar .faq-main-items .faq-answer {
    display: block;
  }

  .faq-align-left .faq-template-sidebar .faq-sidebar-wrapper,
  .faq-align-center .faq-template-sidebar .faq-sidebar-wrapper,
  .faq-align-right .faq-template-sidebar .faq-sidebar-wrapper {
    margin-left: auto;
    margin-right: auto;
  }

  .faq-template-sidebar .faq-sidebar {
    position: static;
    max-height: none;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    width: 100%;
    padding: 8px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(44, 90, 160, 0.08);
  }

  .faq-template-sidebar .faq-sidebar-btn {
    padding: 14px 16px;
    font-size: clamp(16px, 4.2vw, 18px);
    border-radius: 10px;
    background: #ffffff;
    margin: 0;
  }

  /* 모바일에서도 정렬 옵션 적용 - 버튼 자체 정렬 */
  .faq-container.faq-align-left .faq-template-sidebar .faq-sidebar-btn,
  .faq-align-left .faq-template-sidebar .faq-sidebar-btn {
    text-align: left !important;
  }

  .faq-container.faq-align-left .faq-template-sidebar .faq-sidebar-btn .faq-sidebar-btn-text,
  .faq-align-left .faq-template-sidebar .faq-sidebar-btn .faq-sidebar-btn-text {
    text-align: left !important;
  }

  .faq-container.faq-align-center .faq-template-sidebar .faq-sidebar-btn,
  .faq-align-center .faq-template-sidebar .faq-sidebar-btn {
    text-align: center !important;
  }

  .faq-container.faq-align-center .faq-template-sidebar .faq-sidebar-btn .faq-sidebar-btn-text,
  .faq-align-center .faq-template-sidebar .faq-sidebar-btn .faq-sidebar-btn-text {
    text-align: center !important;
  }

  .faq-container.faq-align-right .faq-template-sidebar .faq-sidebar-btn,
  .faq-align-right .faq-template-sidebar .faq-sidebar-btn {
    text-align: right !important;
  }

  .faq-container.faq-align-right .faq-template-sidebar .faq-sidebar-btn .faq-sidebar-btn-text,
  .faq-align-right .faq-template-sidebar .faq-sidebar-btn .faq-sidebar-btn-text {
    text-align: right !important;
  }

  .faq-template-sidebar .faq-sidebar-btn::before {
    display: none;
  }

  .faq-template-sidebar .faq-sidebar-btn:hover {
    background: #f8fafc;
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: none;
  }

  .faq-template-sidebar .faq-sidebar-btn.active {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: none;
  }

  /* 공통 FAQ 항목 모바일 */
  .faq-item {
    padding: 0;
    margin-bottom: 12px;
    border-radius: 0;
  }

  .faq-question {
    padding: 20px 18px;
    font-size: clamp(17px, 4.3vw, 19px);
    gap: 16px;
  }

  .faq-expand-icon {
    width: 26px;
    height: 26px;
  }

  .faq-answer {
    padding: 0 18px;
    font-size: clamp(15px, 3.9vw, 17px);
  }

  .faq-item.active .faq-answer {
    padding-top: 0;
    padding-bottom: 20px;
  }
}
