/* 통합 게시판 CSS */

/* 학습지원센터 하단 여백 조정 (common.css의 200px 오버라이드) */
section > .container.board-container {
    padding-bottom: 60px;
}

/* 탭 메뉴 스타일 - 미니멀 밑줄 디자인 */
.board-tabs {
    display: flex;
    gap: 32px;
    border-bottom: 1px solid #e5e7eb;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.board-tabs::-webkit-scrollbar {
    display: none;
}

.board-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 16px 4px;
    white-space: nowrap;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    font-size: 15px;
    font-weight: 500;
    color: #9ca3af;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    margin-bottom: -1px;
}

.board-tabs .tab-btn:hover {
    color: #374151;
}

.board-tabs .tab-btn.active {
    color: var(--brand-color);
    font-weight: 600;
    border-bottom-color: var(--brand-color);
}

/* 탭 컨텐츠 */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* FAQ 스타일 - 카드형 토글 디자인 */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.faq-list > div:not(.no-data) {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.faq-list .no-data {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 15px;
}

.faq-item {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.faq-item:hover {
    border-color: var(--brand-color);
    box-shadow: 0 2px 8px rgba(0, 82, 156, 0.1);
}

.faq-item.active {
    border-color: var(--brand-color);
    box-shadow: 0 4px 12px rgba(0, 82, 156, 0.15);
}

.faq-question {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    cursor: pointer;
    background-color: #fff;
    transition: background-color 0.2s;
    gap: 12px;
}

.faq-question:hover {
    background-color: #f8fafc;
}

.faq-item.active .faq-question {
    background-color: #f0f7ff;
    border-bottom: 1px solid #e5e7eb;
}

.faq-question .faq-icon {
    width: 32px;
    height: 32px;
    background-color: var(--brand-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.faq-question .faq-category {
    display: inline-block;
    padding: 4px 10px;
    background-color: #eef2ff;
    color: var(--brand-color);
    font-size: 12px;
    font-weight: 600;
    border-radius: 4px;
    flex-shrink: 0;
}

.faq-question .faq-title {
    flex: 1;
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.4;
}

.faq-question .faq-toggle {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
}

.faq-question .faq-toggle::before {
    content: '';
    width: 8px;
    height: 8px;
    border-right: 2px solid #9ca3af;
    border-bottom: 2px solid #9ca3af;
    transform: rotate(45deg);
    transition: transform 0.2s ease;
    margin-top: -3px;
}

.faq-item.active .faq-question .faq-toggle::before {
    transform: rotate(-135deg);
    margin-top: 3px;
    border-color: var(--brand-color);
}

.faq-answer {
    display: none;
    padding: 20px 24px;
    background-color: #fff;
}

.faq-item.active .faq-answer {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.faq-answer .faq-icon {
    width: 32px;
    height: 32px;
    background-color: #f0f7ff;
    color: var(--brand-color);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
    border: 1px solid #dbeafe;
}

.faq-answer .faq-content {
    flex: 1;
    font-size: 14px;
    line-height: 1.8;
    color: #4b5563;
}

/* FAQ 답변 내용의 Toast UI Editor 콘텐츠 line-height */
.faq-answer .faq-content > div {
    line-height: 1.9 !important;
}

.faq-answer .faq-content p,
.faq-answer .faq-content div,
.faq-answer .faq-content span,
.faq-answer .faq-content li {
    line-height: 1.8 !important;
}

/* FAQ 답변 내용의 이미지 센터 정렬 */
.faq-answer .faq-content img {
    display: block;
    margin-left: auto;
    margin-right: auto;
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin-top: 12px;
    margin-bottom: 12px;
}

/* 자료실 파일 뱃지 */
.file-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px; /* 아이콘과 숫자 사이 간격 */
    margin-left: 8px;
    font-size: 10px;
    color: #666;
}

/* 모바일 대응 */
@media (max-width: 768px) {
    .board-tabs {
        gap: 24px;
    }

    .board-tabs .tab-btn {
        padding: 14px 2px;
        font-size: 14px;
    }

    /* FAQ 모바일 스타일 */
    .faq-list {
        gap: 10px;
    }

    .faq-item {
        border-radius: 6px;
    }

    .faq-question {
        padding: 14px 16px;
        gap: 10px;
    }

    .faq-question .faq-icon,
    .faq-answer .faq-icon {
        width: 28px;
        height: 28px;
        font-size: 12px;
        border-radius: 5px;
    }

    .faq-question .faq-category {
        font-size: 11px;
        padding: 3px 8px;
    }

    .faq-question .faq-title {
        font-size: 14px;
    }

    .faq-question .faq-toggle {
        width: 18px;
        height: 18px;
    }

    .faq-question .faq-toggle::before {
        width: 7px;
        height: 7px;
    }

    .faq-answer {
        padding: 16px;
    }

    .faq-answer .faq-content {
        font-size: 13px;
    }
}

/* 카드형 리스트 스타일 */
.card-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.card-list .no-data {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 15px;
}

.card-item {
    display: block;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px 24px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.card-item:hover {
    border-color: var(--brand-color);
    box-shadow: 0 2px 8px rgba(0, 82, 156, 0.1);
}

.card-item.notice {
    background: #f0f7ff;
    border-left: 3px solid var(--brand-color);
}

.card-item .card-badge {
    display: inline-block;
    padding: 3px 8px;
    background: var(--brand-color);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    margin-right: 8px;
    flex-shrink: 0;
}

.card-item .card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 10px;
    line-height: 1.4;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.card-item .card-title > span:not(.card-badge) {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.4;
}

.card-item .card-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    color: #6b7280;
}

.card-item .card-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.card-item .card-meta .file-icon {
    color: var(--brand-color);
}

/* 모바일 카드 리스트 */
@media (max-width: 768px) {
    .card-item {
        padding: 16px;
    }

    .card-item .card-title {
        font-size: 15px;
    }

    .card-item .card-meta {
        font-size: 12px;
        gap: 12px;
    }
}

/* 공통 테이블 스타일 (notice-detail.css와 통일) */
.table-box {
    margin-top: 20px;
}

.table-box table {
    width: 100%;
    border-collapse: collapse;
    border-top: 1px solid #333;
}

.table-box table thead tr {
    background-color: #f8f8f8;
}

.table-box table th,
.table-box table td {
    padding: 15px 10px;
    text-align: center;
    border-bottom: 1px solid #e0e0e0;
    font-size: 15px;
}

.table-box table th {
    font-weight: bold;
    color: #555;
}

.table-box table td.subject {
    text-align: left;
}

.table-box table tr.notice {
    background-color: #fffbf0;
}

.table-box table th.num,
.table-box table th.date,
.table-box table th.hit,
.table-box table th.file {
    width: 80px;
}

.table-box table .text-center {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

/* 모바일 테이블 스타일 */
.table-box table .mo {
    display: none;
}

@media (max-width: 768px) {
    .table-box table .pc {
        display: none;
    }

    .table-box table .mo {
        display: table-cell;
        text-align: left;
        padding: 15px 10px;
    }

    .table-box table .mo-subject {
        font-size: 14px;
        font-weight: 500;
        margin-bottom: 5px;
    }

    .table-box table .mo-info {
        font-size: 12px;
        color: #999;
        display: flex;
        justify-content: space-between;
    }
}