/* ============================================
   FAQ 페이지 스타일
   ============================================ */

/* ============================================
   1. 전역 리셋 및 기본 레이아웃
   ============================================ */

html, body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
    height: auto;
    min-height: 100%;
}

body:not(.dark-mode) {
    background: #ffffff !important;
}

/* ============================================
   2. FAQ 컨테이너
   ============================================ */

.faq-container {
    max-width: 1160px !important;
    width: 1160px !important;
    margin: 0 auto;
    padding: 48px 20px 80px;
    min-height: calc(100vh - 200px);
    box-sizing: border-box;
}

#faqContent {
    position: relative;
}

/* ============================================
   3. 페이지 타이틀 및 서브타이틀
   ============================================ */

.page-title {
    font-size: 42px;
    font-weight: 800;
    color: #1a1a2e;
    margin-bottom: 16px;
    text-align: center;
    letter-spacing: -0.5px;
}

.page-subtitle {
    font-size: 18px;
    color: #666;
    margin-bottom: 32px;
    text-align: center;
    line-height: 1.6;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* ============================================
   4. 카테고리 탭
   ============================================ */

.category-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.category-tab {
    height: 44px;
    padding: 0 24px;
    border: 1px solid #E5E7EB;
    background: white;
    border-radius: 20px;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-sizing: border-box;
}

.category-tab:hover {
    border-color: #1E3A8A;
    color: #1E3A8A;
}

.category-tab.active {
    background: #1E3A8A;
    border-color: #1E3A8A;
    color: white;
}

.category-tab i {
    font-size: 14px;
}

/* ============================================
   5. FAQ 섹션
   ============================================ */

.faq-section {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.faq-section.hidden {
    display: none !important;
}

.faq-section-title {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.faq-section-title i {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
}

.faq-section-title i.purple { background: linear-gradient(135deg, #4f46e5, #4338ca); }
.faq-section-title i.blue { background: linear-gradient(135deg, #4f46e5, #4338ca); }
.faq-section-title i.green { background: linear-gradient(135deg, #14B8A6, #34D399); }
.faq-section-title i.orange { background: linear-gradient(135deg, #F59E0B, #FBBF24); }
.faq-section-title i.red { background: linear-gradient(135deg, #EF4444, #F87171); }

/* ============================================
   6. FAQ 아이템 (아코디언)
   ============================================ */

.faq-item {
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 0;
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-question {
    padding: 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s ease;
    border-radius: 8px;
}

.faq-question:hover {
    background: #f8f9fa;
}

.faq-question-text {
    font-size: 16px;
    font-weight: 500;
    color: #1a1a2e;
    flex: 1;
}

.faq-question-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1E3A8A;
    transition: transform 0.3s ease;
    flex-shrink: 0;
    margin-left: 16px;
}

.faq-item.active .faq-question-icon {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding: 0 20px;
}

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

.faq-answer-content {
    font-size: 14px;
    color: #666;
    line-height: 1.8;
    padding-top: 10px;
}

.faq-answer-content ul {
    margin: 12px 0;
    padding-left: 24px;
}

.faq-answer-content li {
    margin-bottom: 8px;
}

/* ============================================
   7. 검색 바
   ============================================ */

.search-bar {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 30px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.search-input-wrapper {
    position: relative;
}

.search-input {
    width: 100%;
    padding: 14px 16px 14px 48px;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    font-size: 15px;
    color: #1a1a2e;
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: #1E3A8A;
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 18px;
}

/* ============================================
   8. 빈 상태
   ============================================ */

.empty-state {
    text-align: center;
    padding: 60px 20px;
    display: none;
}

.empty-icon {
    width: 80px;
    height: 80px;
    background: #f0f0f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 32px;
    color: #999;
}

.empty-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 8px;
}

.empty-desc {
    font-size: 14px;
    color: #666;
}

/* ============================================
   9. 다크모드 스타일
   ============================================ */

body.dark-mode {
    background: rgb(32, 33, 37) !important;
}

body.dark-mode .faq-container {
    color: #f1f5f9;
}

body.dark-mode .page-title {
    color: #f1f5f9;
}

body.dark-mode .page-subtitle {
    color: #94a3b8;
}

body.dark-mode .category-tab {
    background: #2a2a2d;
    border-color: rgba(148, 163, 184, 0.1);
    color: #94a3b8;
}

body.dark-mode .category-tab:hover {
    border-color: #1E3A8A;
    color: #1E3A8A;
    box-shadow: none;
}

body.dark-mode .category-tab.active {
    background: #1E3A8A;
    border-color: #1E3A8A;
    color: white;
    box-shadow: none;
}

body.dark-mode .category-tab i {
    color: #ffffff;
}

body.dark-mode .faq-section {
    background: #2a2a2d;
    border-color: rgba(148, 163, 184, 0.1);
}

body.dark-mode .faq-section-title {
    color: #f1f5f9;
}

body.dark-mode .faq-question {
    color: #f1f5f9;
}

body.dark-mode .faq-question:hover {
    background: rgba(6, 182, 212, 0.1);
}

body.dark-mode .faq-question-text {
    color: #f1f5f9;
}

body.dark-mode .faq-answer-content {
    color: #94a3b8;
}

body.dark-mode .faq-answer-content strong {
    color: #f1f5f9;
}

body.dark-mode .faq-item {
    border-bottom-color: rgba(148, 163, 184, 0.1);
}

body.dark-mode .faq-question-icon {
    color: #ffffff;
}

body.dark-mode .search-bar {
    background: #2a2a2d;
    border-color: rgba(148, 163, 184, 0.1);
}

body.dark-mode .search-input {
    background: #2a2a2d;
    border-color: rgba(148, 163, 184, 0.1);
    color: #f1f5f9;
}

body.dark-mode .search-input:focus {
    border-color: #1E3A8A;
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.2);
}

body.dark-mode .search-icon {
    color: #94a3b8;
}

body.dark-mode .empty-icon {
    background: rgba(148, 163, 184, 0.1);
    color: #94a3b8;
}

body.dark-mode .empty-title {
    color: #f1f5f9;
}

body.dark-mode .empty-desc {
    color: #94a3b8;
}

/* ============================================
   10. 반응형 디자인
   ============================================ */

@media (max-width: 768px) {
    .faq-container {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 auto;
        padding: 20px 20px 80px;
        box-sizing: border-box;
    }

    .page-title {
        font-size: 28px;
    }

    .page-subtitle {
        display: none;
    }

    .category-tabs {
        flex-wrap: nowrap;
        gap: 6px;
        margin-bottom: 20px;
    }

    .category-tab {
        flex: 1 1 0;
        min-width: 0;
        padding: 10px 6px;
        font-size: 12px;
        justify-content: center;
    }

    .faq-section {
        padding: 20px;
    }

    .faq-question {
        padding: 16px;
    }

    .faq-question-text {
        font-size: 15px;
    }
}
