/* ============================================================
   Q&A 게시판 (커뮤니티 보드) 스타일
   ============================================================ */

/* ---- 공통 ---- */
.qna-board-wrap {
    max-width: 1024px;
    margin: 0 auto;
    color: #1e293b;
    padding: 40px 0 64px 0
}

/* ---- 헤더 ---- */
.qna-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.qna-header-title {
    font-size: 22px;
    font-weight: 750;
    color: #0f172a;
}

.qna-header-btns {
    display: flex;
    gap: 8px;
}

.qna-btn-my,
.qna-btn-write,
.qna-btn-primary {
    padding: 8px 18px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
}

.qna-btn-my {
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #dbeafe;
}

.qna-btn-my:hover {
    background: #dbeafe;
    color: #1d4ed8;
}

.qna-btn-my.active {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}

.qna-btn-write,
.qna-btn-primary {
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #dbeafe;
}

.qna-btn-write:hover,
.qna-btn-primary:hover {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}

.qna-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ---- 검색 바 ---- */
.qna-search-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.qna-search-bar input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s;
}

.qna-search-bar input:focus {
    border-color: #2563eb;
}

.qna-search-btn {
    padding: 10px 20px;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

/* ---- 카테고리 탭 (1depth) ---- */
.qna-cat-tabs-wrap {
    margin-bottom: 16px;
}

.qna-cat-tabs {
    display: flex;
    gap: 2px;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    border-bottom: 2px solid #e2e8f0;
}

.qna-cat-tabs .qna-cat-btn {
    flex-shrink: 0;
    padding: 8px 18px;
    border: none;
    background: none;
    font-size: 14px;
    font-weight: 600;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.qna-cat-tabs .qna-cat-btn:hover {
    color: #1e293b;
}

.qna-cat-tabs .qna-cat-btn.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
}

/* ---- 서브카테고리 탭 (2depth) ---- */
.qna-subcat-tabs {
    display: flex;
    gap: 2px;
    overflow-x: auto;
    padding: 8px 0 0;
    -webkit-overflow-scrolling: touch;
}

.qna-subcat-tabs .qna-subcat-btn {
    flex-shrink: 0;
    padding: 6px 14px;
    border: none;
    background: none;
    font-size: 13px;
    font-weight: 500;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.qna-subcat-tabs .qna-subcat-btn:hover {
    color: #64748b;
}

.qna-subcat-tabs .qna-subcat-btn.active {
    color: #2563eb;
    font-weight: 600;
}

/* ---- 검색바 ---- */
.qna-search-section {
    margin-bottom: 16px;
}

.qna-search-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.qna-search-bar input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    font-family: inherit;
}

.qna-search-bar input:focus {
    border-color: #2563eb;
}

.qna-search-btn {
    padding: 10px 20px;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.qna-search-btn:hover {
    background: #1d4ed8;
}

/* ---- 게시글 카운트 + 정렬 ---- */
.qna-info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.qna-info-total {
    font-size: 13px;
    color: #64748b;
}

.qna-info-total strong {
    color: #2563eb;
    font-weight: 700;
}

.qna-sort-row {
    display: flex;
    gap: 8px;
}

.qna-sort-btn {
    font-size: 13px;
    color: #94a3b8;
    cursor: pointer;
    text-decoration: none;
}

.qna-sort-btn.on {
    color: #2563eb;
    font-weight: 600;
}

/* ---- 테이블 ---- */
.qna-table {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

.qna-thead {
    display: flex;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 10px 14px;
    font-size: 12px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.qna-row {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.1s;
    font-size: 14px;
}

.qna-row:last-child {
    border-bottom: none;
}

.qna-row:hover {
    background: #f8fafc;
}

.qna-row.qna-row-notice {
    background: #fffbeb;
}

.qna-row.qna-row-notice:hover {
    background: #fef3c7;
}

.qna-th-title,
.qna-cell-title {
    flex: 1;
    min-width: 0;
}

.qna-th-writer,
.qna-cell-writer {
    width: 100px;
    text-align: center;
    flex-shrink: 0;
}

.qna-th-date,
.qna-cell-date {
    width: 90px;
    text-align: center;
    flex-shrink: 0;
}

.qna-th-hit,
.qna-cell-hit {
    width: 60px;
    text-align: center;
    flex-shrink: 0;
}

.qna-cell-title a {
    color: #1e293b;
    text-decoration: none;
    font-weight: 500;
}

.qna-cell-title a:hover {
    color: #2563eb;
}

.qna-cell-writer,
.qna-cell-date,
.qna-cell-hit {
    font-size: 13px;
    color: #64748b;
}

/* ---- 배지 ---- */
.qna-badge-notice {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    background: #f59e0b;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    margin-right: 4px;
    vertical-align: middle;
}

.qna-badge-new {
    display: inline-block;
    padding: 1px 5px;
    border-radius: 3px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    margin-left: 4px;
    vertical-align: middle;
}

/* ---- 댓글 아이콘 + 카운트 ---- */
.qna-reply-count {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-left: 6px;
    font-size: 12px;
    color: #64748b;
    vertical-align: middle;
}

.qna-reply-count svg {
    width: 13px;
    height: 13px;
    stroke: #94a3b8;
}

/* ---- 페이지네이션 ---- */
.qna-pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: 24px;
}

.qna-page-btn {
    padding: 8px 13px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #fff;
    font-size: 13px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s;
    min-width: 36px;
    text-align: center;
}

.qna-page-btn:hover {
    border-color: #2563eb;
    color: #2563eb;
}

.qna-page-btn.active {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

/* ---- 로딩/빈 상태 ---- */
.qna-loading,
.qna-empty {
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
    font-size: 14px;
}

/* ---- 상세 페이지 ---- */
.qna-detail-wrap {
    max-width: 760px;
    margin: 0 auto;
    padding: 24px 16px;
}

.qna-detail-actions {
    margin-bottom: 24px;
}

.qna-btn-list {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    background: #f1f5f9;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    text-decoration: none;
    transition: background 0.15s;
}

.qna-btn-list:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.qna-btn-list::before {
    content: '←';
    font-size: 14px;
}

.qna-detail-header {
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 16px;
    margin-bottom: 24px;
}

.qna-detail-title {
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 10px;
}

.qna-detail-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}

.qna-detail-content {
    font-size: 15px;
    line-height: 1.75;
    color: #334155;
    margin-bottom: 40px;
}

/* ---- 댓글 영역 ---- */
.qna-detail-comments {
    border-top: 1px solid #e2e8f0;
    padding-top: 24px;
}

.qna-comments-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.qna-comments-header h3 {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    color: #0f172a;
}

/* 관심글 댓글 알림 토글 */
.qna-notif-toggle-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.qna-notif-toggle-label {
    font-size: 12px;
    color: #64748b;
    white-space: nowrap;
}

.qna-toggle-switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
    cursor: pointer;
}

.qna-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.qna-toggle-slider {
    position: absolute;
    inset: 0;
    background: #cbd5e1;
    border-radius: 20px;
    transition: background 0.2s;
}

.qna-toggle-slider::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    left: 2px;
    bottom: 2px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}

.qna-toggle-switch input:checked+.qna-toggle-slider {
    background: #2563eb;
}

.qna-toggle-switch input:checked+.qna-toggle-slider::before {
    transform: translateX(16px);
}

.qna-comment-item {
    padding: 14px 0;
    border-bottom: 1px solid #f1f5f9;
}

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

.qna-comment-author {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}

.qna-comment-content {
    font-size: 14px;
    color: #475569;
    line-height: 1.7;
}

.qna-comment-content p {
    margin: 0 0 8px;
}

.qna-comment-content p:last-child {
    margin-bottom: 0;
}

.qna-comment-date {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 6px;
}

.qna-comment-form {
    margin-top: 20px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px;
}

.qna-comment-writer-row {
    margin-bottom: 10px;
}

.qna-comment-writer-name {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
}

.qna-comment-form textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    resize: vertical;
    outline: none;
    box-sizing: border-box;
    font-family: inherit;
    line-height: 1.6;
    background: #fff;
}

.qna-comment-form textarea:focus {
    border-color: #2563eb;
}

.qna-comment-form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
}

.qna-comment-form-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.qna-comment-attach-btn,
.qna-comment-secret-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    user-select: none;
}

.qna-comment-attach-label,
.qna-comment-secret-label {
    font-size: 12px;
    color: #94a3b8;
    font-weight: 500;
}

.qna-comment-attach-btn:hover .qna-comment-attach-label,
.qna-comment-secret-toggle:hover .qna-comment-secret-label {
    color: #2563eb;
}

.qna-comment-secret-toggle input:checked~.qna-comment-secret-label {
    color: #2563eb;
    font-weight: 600;
}

.qna-comment-secret-toggle input:checked~svg {
    stroke: #2563eb;
}

.qna-comment-file-name {
    font-size: 12px;
    color: #2563eb;
    margin-top: 6px;
    padding: 4px 8px;
    background: #eff6ff;
    border-radius: 4px;
    display: inline-block;
}

.qna-comment-form .qna-btn-primary {
    padding: 8px 22px;
    font-size: 13px;
}

.qna-comment-login-msg {
    font-size: 13px;
    color: #94a3b8;
    text-align: center;
    padding: 20px;
}

.qna-comment-login-msg a {
    color: #2563eb;
    font-weight: 600;
}

/* ---- 모바일 반응형 ---- */
@media (max-width: 600px) {
    .qna-board-wrap {
        padding: 12px 10px 32px;
    }

    .qna-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .qna-thead,
    .qna-row {
        padding: 10px 10px;
        font-size: 13px;
    }

    .qna-th-writer,
    .qna-cell-writer,
    .qna-th-date,
    .qna-cell-date {
        display: none;
    }

    .qna-th-hit,
    .qna-cell-hit {
        width: 40px;
    }

    .qna-detail-title {
        font-size: 18px;
    }
}