/* ========================================
   게시판 스타일 (board.css)
   ======================================== */

/* 게시판 컨테이너 */
.board-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 32px 24px;
}

/* 게시판 헤더 */
.board-header {
    margin-bottom: 28px;
}

.board-header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.board-header p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* 탭 네비게이션 */
.board-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 0;
}

.board-tab {
    padding: 10px 24px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #64748b;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    bottom: -2px;
    border-bottom: 2px solid transparent;
}

.board-tab:hover {
    color: var(--text-primary);
}

.board-tab.active {
    color: #2563eb;
    font-weight: 600;
    border-bottom: 2px solid #2563eb;
}

/* 검색 + 글쓰기 영역 */
.board-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    gap: 12px;
}

.board-search {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 14px;
    flex: 1;
    max-width: 360px;
    transition: border-color 0.2s;
}

.board-search:focus-within {
    border-color: #2563eb;
    background: white;
}

.board-search input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.85rem;
    color: var(--text-primary);
    width: 100%;
    font-family: inherit;
}

.board-search input::placeholder {
    color: #94a3b8;
}

.board-search svg {
    color: #94a3b8;
    flex-shrink: 0;
}

.btn-write {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 20px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    white-space: nowrap;
}

.btn-write:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* 게시글 목록 테이블 */
.board-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.board-table thead {
    background: #f8fafc;
    border-top: 2px solid #1e293b;
    border-bottom: 1px solid #e2e8f0;
}

.board-table thead th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #475569;
    font-size: 0.8rem;
    letter-spacing: 0.02em;
}

.board-table tbody tr {
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.15s;
    cursor: pointer;
}

.board-table tbody tr:hover {
    background: #f8fafc;
}

.board-table tbody td {
    padding: 14px 16px;
    color: var(--text-primary);
}

/* 번호 열 */
.col-no {
    width: 60px;
    text-align: center;
    color: #94a3b8 !important;
    font-size: 0.8rem;
}

/* 제목 열 */
.col-title {
    font-weight: 500;
}

.col-title a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

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

.comment-count {
    color: #2563eb;
    font-size: 0.8rem;
    font-weight: 600;
    margin-left: 6px;
}

.badge-notice {
    display: inline-block;
    padding: 2px 8px;
    background: #fee2e2;
    color: #dc2626;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 4px;
    margin-right: 8px;
}

.badge-new {
    display: inline-block;
    padding: 1px 5px;
    background: #dbeafe;
    color: #2563eb;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 3px;
    margin-left: 6px;
}

/* 작성자 열 */
.col-author {
    width: 100px;
    color: #64748b !important;
    font-size: 0.82rem;
}

/* 날짜 열 */
.col-date {
    width: 100px;
    color: #94a3b8 !important;
    font-size: 0.8rem;
}

/* 조회수 열 */
.col-views {
    width: 60px;
    text-align: center;
    color: #94a3b8 !important;
    font-size: 0.8rem;
}

/* 빈 상태 */
.board-empty {
    text-align: center;
    padding: 80px 20px;
    color: #94a3b8;
}

.board-empty svg {
    margin-bottom: 16px;
    color: #cbd5e1;
}

.board-empty p {
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.board-empty small {
    font-size: 0.8rem;
    color: #cbd5e1;
}

/* 로딩 */
.board-loading {
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
    font-size: 0.9rem;
}

.board-loading .spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e2e8f0;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 12px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

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

.board-pagination button {
    min-width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e2e8f0;
    background: white;
    color: #64748b;
    font-size: 0.82rem;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.board-pagination button:hover {
    background: #f1f5f9;
    color: var(--text-primary);
}

.board-pagination button.active {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}

.board-pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ========================================
   FAQ 아코디언 스타일
   ======================================== */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.faq-item {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.2s;
}

.faq-item:hover {
    border-color: #cbd5e1;
}

.faq-item.open {
    border-color: #2563eb;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
}

.faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: white;
    cursor: pointer;
    transition: background 0.2s;
    gap: 16px;
}

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

.faq-q-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.faq-q-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 0.85rem;
    font-weight: 800;
    border-radius: 6px;
    flex-shrink: 0;
}

.faq-q-text {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-primary);
}

.faq-arrow {
    transition: transform 0.3s;
    color: #94a3b8;
    flex-shrink: 0;
}

.faq-item.open .faq-arrow {
    transform: rotate(180deg);
    color: #2563eb;
}

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

.faq-item.open .faq-answer {
    max-height: 500px;
}

.faq-a-inner {
    padding: 0 20px 20px 60px;
    font-size: 0.88rem;
    color: #475569;
    line-height: 1.7;
}

.faq-a-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #fef2f2;
    color: #dc2626;
    font-size: 0.85rem;
    font-weight: 800;
    border-radius: 6px;
    margin-right: 8px;
    vertical-align: middle;
}

/* ========================================
   글 상세 페이지
   ======================================== */
.post-detail {
    max-width: 960px;
    margin: 0 auto;
    padding: 32px 24px;
}

.post-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #64748b;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 24px;
    transition: color 0.2s;
}

.post-back:hover {
    color: #2563eb;
}

.post-header {
    border-bottom: 2px solid #1e293b;
    padding-bottom: 16px;
    margin-bottom: 24px;
}

.post-header h1 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    line-height: 1.4;
}

.post-meta {
    display: flex;
    gap: 20px;
    font-size: 0.82rem;
    color: #94a3b8;
}

.post-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.post-body {
    padding: 24px 0;
    font-size: 0.95rem;
    color: var(--text-primary);
    line-height: 1.8;
    min-height: 200px;
    border-bottom: 1px solid #f1f5f9;
    white-space: pre-wrap;
}

/* 관리 버튼 */
.post-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 0;
    border-bottom: 1px solid #f1f5f9;
}

.btn-edit, .btn-delete {
    padding: 7px 16px;
    font-size: 0.82rem;
    font-weight: 500;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background: white;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

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

.btn-delete:hover {
    border-color: #dc2626;
    color: #dc2626;
    background: #fef2f2;
}

/* ========================================
   댓글 영역
   ======================================== */
.comments-section {
    margin-top: 32px;
}

.comments-section h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.comments-count {
    background: #eff6ff;
    color: #2563eb;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
}

/* 댓글 입력 */
.comment-form {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
}

.comment-form textarea {
    flex: 1;
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.88rem;
    font-family: inherit;
    resize: none;
    min-height: 70px;
    outline: none;
    transition: border-color 0.2s;
    color: var(--text-primary);
}

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

.comment-form textarea::placeholder {
    color: #94a3b8;
}

.btn-comment {
    align-self: flex-end;
    padding: 10px 20px;
    background: #1e293b;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-comment:hover {
    background: #0f172a;
}

/* 댓글 목록 */
.comment-list {
    display: flex;
    flex-direction: column;
}

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

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

.comment-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.comment-author {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.comment-date {
    font-size: 0.75rem;
    color: #94a3b8;
}

.comment-text {
    font-size: 0.88rem;
    color: #475569;
    line-height: 1.6;
}

.comment-delete {
    background: none;
    border: none;
    color: #cbd5e1;
    font-size: 0.75rem;
    cursor: pointer;
    margin-left: 8px;
    transition: color 0.2s;
}

.comment-delete:hover {
    color: #dc2626;
}

.comments-empty {
    text-align: center;
    padding: 32px;
    color: #cbd5e1;
    font-size: 0.85rem;
}

/* ========================================
   글쓰기 폼
   ======================================== */
.write-form {
    max-width: 960px;
    margin: 0 auto;
    padding: 32px 24px;
}

.write-form h1 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 28px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
    color: var(--text-primary);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: #2563eb;
}

.form-group textarea {
    min-height: 300px;
    resize: vertical;
    line-height: 1.7;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
}

.btn-cancel {
    padding: 10px 24px;
    background: white;
    color: #64748b;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-cancel:hover {
    background: #f1f5f9;
}

.btn-submit {
    padding: 10px 28px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

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

/* ========================================
   반응형 - 모바일
   ======================================== */
@media (max-width: 768px) {
    .board-container {
        padding: 20px 16px;
    }

    .board-header h1 {
        font-size: 1.3rem;
    }

    .board-header p {
        font-size: 0.82rem;
    }

    .board-tabs {
        gap: 0;
    }

    .board-tab {
        padding: 10px 14px;
        font-size: 0.82rem;
    }

    .post-table th,
    .post-table td {
        padding: 10px 8px;
        font-size: 0.82rem;
    }

    /* 날짜, 조회수 열 숨기기 */
    .post-table th:nth-child(n+3),
    .post-table td:nth-child(n+3) {
        display: none;
    }

    .board-toolbar {
        flex-direction: column;
        gap: 10px;
    }

    .search-box {
        width: 100%;
    }

    .search-box input {
        width: 100%;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn-cancel,
    .form-actions .btn-submit {
        width: 100%;
        text-align: center;
    }

    .form-group textarea {
        min-height: 200px;
    }
}

@media (max-width: 480px) {
    .board-container {
        padding: 16px 12px;
    }

    .board-tab {
        padding: 8px 10px;
        font-size: 0.78rem;
    }
}
