/* 관리자 페이지 CSS */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.admin-body {
    font-family: 'Noto Sans KR', sans-serif;
    background: #f0f2f5;
    min-height: 100vh;
}

/* 로그인 화면 */
.admin-login {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    padding: 20px;
}

.login-box {
    background: #ffffff;
    width: 100%;
    max-width: 400px;
    padding: 40px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    font-size: 28px;
    color: #1a1a2e;
    margin-bottom: 8px;
}

.login-header p {
    font-size: 14px;
    color: #888888;
}

.login-field {
    margin-bottom: 20px;
}

.login-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #333333;
    margin-bottom: 8px;
}

.login-field input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #dddddd;
    font-size: 14px;
    transition: border-color 0.2s;
}

.login-field input:focus {
    border-color: #1a1a2e;
    outline: none;
}

.login-btn {
    width: 100%;
    padding: 16px;
    background: #1a1a2e;
    color: #ffffff;
    border: none;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.login-btn:hover {
    background: #2a2a3e;
}

.login-hint {
    margin-top: 20px;
    text-align: center;
    font-size: 12px;
    color: #aaaaaa;
}

/* 대시보드 레이아웃 */
.admin-dashboard {
    display: flex;
    min-height: 100vh;
}

/* 사이드바 */
.admin-sidebar {
    width: 260px;
    background: #1a1a2e;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
}

.sidebar-header {
    padding: 30px 25px;
    border-bottom: 1px solid #2a2a3e;
}

.sidebar-header h2 {
    font-size: 22px;
    font-weight: 700;
}

.sidebar-header p {
    font-size: 12px;
    color: #888888;
    margin-top: 5px;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
}

.sidebar-nav .nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 25px;
    color: #aaaaaa;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
}

.sidebar-nav .nav-item:hover {
    background: #2a2a3e;
    color: #ffffff;
}

.sidebar-nav .nav-item.active {
    background: #2a2a3e;
    color: #ffffff;
    border-left: 3px solid #ffffff;
}

.sidebar-nav .nav-icon {
    font-size: 18px;
}

.sidebar-footer {
    padding: 20px 25px;
    border-top: 1px solid #2a2a3e;
}

.back-link {
    display: block;
    color: #888888;
    text-decoration: none;
    font-size: 13px;
    margin-bottom: 15px;
}

.back-link:hover {
    color: #ffffff;
}

.logout-btn {
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 1px solid #555555;
    color: #aaaaaa;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.logout-btn:hover {
    background: #333344;
    color: #ffffff;
    border-color: #666666;
}

/* 메인 영역 */
.admin-main {
    flex: 1;
    margin-left: 260px;
    min-height: 100vh;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    background: #ffffff;
    border-bottom: 1px solid #e0e0e0;
}

.admin-header h1 {
    font-size: 22px;
    color: #1a1a2e;
}

.admin-user {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #666666;
}

.user-badge {
    padding: 4px 10px;
    background: #1a1a2e;
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
}

/* 섹션 */
.admin-section {
    padding: 30px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.section-header h2 {
    font-size: 20px;
    color: #1a1a2e;
}

.add-btn {
    padding: 10px 20px;
    background: #1a1a2e;
    color: #ffffff;
    border: none;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.add-btn:hover {
    background: #2a2a3e;
}

/* 대시보드 통계 */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: #ffffff;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    border: 1px solid #e0e0e0;
}

.stat-icon {
    font-size: 36px;
}

.stat-num {
    display: block;
    font-size: 32px;
    font-weight: 700;
    color: #1a1a2e;
}

.stat-label {
    font-size: 13px;
    color: #888888;
}

.dashboard-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.dashboard-card {
    background: #ffffff;
    padding: 25px;
    border: 1px solid #e0e0e0;
}

.dashboard-card h3 {
    font-size: 16px;
    color: #1a1a2e;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eeeeee;
}

.recent-list {
    max-height: 300px;
    overflow-y: auto;
}

.recent-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.recent-item:last-child {
    border-bottom: none;
}

.recent-title {
    font-size: 13px;
    color: #333333;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 15px;
}

.recent-date {
    font-size: 12px;
    color: #aaaaaa;
}

.recent-badge {
    padding: 3px 8px;
    font-size: 10px;
    font-weight: 600;
    margin-left: 10px;
}

.recent-badge.notice {
    background: #1a1a2e;
    color: #ffffff;
}

.recent-badge.unanswered {
    background: #dc3545;
    color: #ffffff;
}

/* 테이블 */
.admin-table-wrap {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eeeeee;
}

.admin-table th {
    background: #f7f7f7;
    font-size: 13px;
    font-weight: 600;
    color: #333333;
}

.admin-table td {
    font-size: 13px;
    color: #555555;
}

.admin-table tbody tr:hover {
    background: #fafafa;
}

.table-title {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.table-badge {
    display: inline-block;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
}

.table-badge.answered {
    background: #28a745;
    color: #ffffff;
}

.table-badge.unanswered {
    background: #dc3545;
    color: #ffffff;
}

.table-actions {
    display: flex;
    gap: 8px;
}

.table-btn {
    padding: 6px 12px;
    font-size: 12px;
    border: 1px solid #dddddd;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.2s;
}

.table-btn:hover {
    background: #f0f0f0;
}

.table-btn.view {
    color: #1a1a2e;
}

.table-btn.edit {
    color: #0d6efd;
    border-color: #0d6efd;
}

.table-btn.reply {
    color: #28a745;
    border-color: #28a745;
}

.table-btn.delete {
    color: #dc3545;
    border-color: #dc3545;
}

.table-btn.delete:hover {
    background: #dc3545;
    color: #ffffff;
}

/* 설정 */
.settings-card {
    background: #ffffff;
    padding: 30px;
    border: 1px solid #e0e0e0;
    margin-bottom: 20px;
}

.settings-card h3 {
    font-size: 18px;
    color: #1a1a2e;
    margin-bottom: 20px;
}

.settings-form .form-group {
    margin-bottom: 20px;
    max-width: 400px;
}

.settings-form label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #333333;
    margin-bottom: 8px;
}

.settings-form input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #dddddd;
    font-size: 14px;
}

.settings-form input:focus {
    border-color: #1a1a2e;
    outline: none;
}

.save-btn {
    padding: 12px 30px;
    background: #1a1a2e;
    color: #ffffff;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.save-btn:hover {
    background: #2a2a3e;
}

.settings-desc {
    font-size: 14px;
    color: #666666;
    margin-bottom: 20px;
}

.settings-actions {
    display: flex;
    gap: 15px;
}

.action-btn {
    padding: 12px 25px;
    border: 1px solid #dddddd;
    background: #ffffff;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn:hover {
    background: #f5f5f5;
}

.action-btn.danger {
    color: #dc3545;
    border-color: #dc3545;
}

.action-btn.danger:hover {
    background: #dc3545;
    color: #ffffff;
}

/* 모달 */
.admin-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.admin-modal.active {
    display: flex;
}

.admin-modal .modal-content {
    background: #ffffff;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.admin-modal .modal-content.modal-lg {
    max-width: 800px;
}

.admin-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    background: #1a1a2e;
    color: #ffffff;
}

.admin-modal .modal-header h3 {
    font-size: 18px;
}

.admin-modal .modal-close {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 24px;
    cursor: pointer;
}

.modal-form {
    padding: 25px;
}

.modal-form .form-group {
    margin-bottom: 20px;
}

.modal-form label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #333333;
    margin-bottom: 8px;
}

.modal-form input,
.modal-form select,
.modal-form textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #dddddd;
    font-size: 14px;
    font-family: inherit;
}

.modal-form input:focus,
.modal-form select:focus,
.modal-form textarea:focus {
    border-color: #1a1a2e;
    outline: none;
}

.modal-form textarea {
    resize: vertical;
    min-height: 150px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 20px;
    border-top: 1px solid #eeeeee;
    margin-top: 10px;
}

.cancel-btn {
    padding: 12px 25px;
    background: #f5f5f5;
    border: 1px solid #dddddd;
    color: #666666;
    font-size: 14px;
    cursor: pointer;
}

.cancel-btn:hover {
    background: #eeeeee;
}

.submit-btn {
    padding: 12px 25px;
    background: #1a1a2e;
    border: none;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.submit-btn:hover {
    background: #2a2a3e;
}

/* 답변 모달 원글 */
.reply-original {
    padding: 20px 25px;
    background: #f7f7f7;
    border-bottom: 1px solid #eeeeee;
}

.reply-original h4 {
    font-size: 15px;
    color: #1a1a2e;
    margin-bottom: 10px;
}

.reply-original p {
    font-size: 13px;
    color: #555555;
    line-height: 1.6;
}

/* 상세보기 */
.view-content {
    padding: 25px;
}

.view-meta {
    display: flex;
    gap: 20px;
    padding-bottom: 15px;
    margin-bottom: 20px;
    border-bottom: 1px solid #eeeeee;
    font-size: 13px;
    color: #888888;
}

.view-body {
    font-size: 14px;
    color: #333333;
    line-height: 1.8;
    white-space: pre-wrap;
    margin-bottom: 30px;
}

.view-comments h4 {
    font-size: 15px;
    color: #1a1a2e;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eeeeee;
}

.comment-item {
    padding: 15px;
    background: #f9f9f9;
    margin-bottom: 10px;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 13px;
}

.comment-author {
    font-weight: 600;
    color: #333333;
}

.comment-date {
    color: #aaaaaa;
}

.comment-body {
    font-size: 13px;
    color: #555555;
    line-height: 1.6;
}

/* 반응형 */
@media (max-width: 1024px) {
    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .dashboard-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .admin-sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    
    .admin-main {
        margin-left: 0;
    }
    
    .sidebar-nav {
        display: flex;
        flex-wrap: wrap;
        padding: 10px;
    }
    
    .sidebar-nav .nav-item {
        flex: 1 1 50%;
        padding: 12px;
        justify-content: center;
        text-align: center;
        flex-direction: column;
        gap: 5px;
    }
    
    .sidebar-footer {
        display: flex;
        gap: 15px;
        align-items: center;
    }
    
    .back-link {
        margin-bottom: 0;
    }
    
    .logout-btn {
        width: auto;
        padding: 8px 20px;
    }
    
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
    
    .settings-actions {
        flex-direction: column;
    }
    
    .table-actions {
        flex-direction: column;
    }
}


