/* 관리자 페이지 전용 스타일 */
:root {
    --admin-bg: #f0f2f5;
    --admin-sidebar: #2c3e50;
    --admin-primary: #FF8C00;
}

/* 모달이 화면 전체를 덮을 수 있도록 html/body 높이를 전체로 설정 */
html {
    height: 100%;
}

body {
    min-height: 100vh;
    background-color: var(--admin-bg);
    margin: 0;
    font-family: 'Noto Sans KR', sans-serif;
}


/* 로그인 섹션 */
.admin-login-container {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2c3e50, #000000);
}

.login-card {
    background: white;
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-card h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.login-card p {
    color: #666;
    font-size: 0.9rem;
}

/* 공통 컨테이너: 너비 제한 및 가운데 정렬 */
.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* 헤더: 상단 고정 */
.admin-header {
    background-color: #2c3e50;
    height: 60px;
    /* 고정 높이 */
    display: flex;
    align-items: center;
    color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 500;
}

.admin-header .admin-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

/* 탭 섹션: 헤더 바로 아래 고정 */
.admin-tabs-section {
    position: sticky;
    top: 60px;
    /* 헤더 높이(60px)와 동일하게 설정 */
    z-index: 400;
    background-color: var(--admin-bg);
    padding-top: 1.5rem;
    border-bottom: 1px solid #ddd;
}

.admin-tabs {
    display: flex;
    gap: 1rem;
    padding-bottom: 1rem;
}

.admin-tab {
    padding: 0.8rem 1.5rem;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: #666;
    border-radius: 8px;
    transition: all 0.3s;
}

.admin-tab.active {
    background-color: var(--admin-primary);
    color: white;
}

/* 서브 탭 (필터용) */
.admin-sub-tab {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    color: #555;
    border-radius: 20px;
    transition: all 0.2s;
    white-space: nowrap;
}

.admin-sub-tab:hover {
    background-color: #f8f9fa;
}

.admin-sub-tab.active {
    background-color: #34495e;
    border-color: #34495e;
    color: white;
}

/* 카드 */
.admin-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

/* 테이블 */
.admin-table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background-color: #f8f9fa;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #eee;
}

td {
    padding: 1rem;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.admin-img-preview {
    width: 50px;
    height: 50px;
    object-fit: contain;
    background: #f8f9fa;
    border-radius: 4px;
}

/* 모달 — position:fixed 로 항상 현재 화면(뷰포트) 기준 중앙에 표시 */
.modal {
    display: none;
    /* JS에서 style.display='flex'로 열림 */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    /* JS에서 display:'flex'로 열 때 → 현재 뷰포트 상단에 바로 표시 */
    align-items: flex-start;
    justify-content: center;
    padding: 2rem 1.5rem;
    box-sizing: border-box;
    overflow-y: auto;
}

.modal-content {
    background-color: white;
    padding: 2rem;
    width: 100%;
    max-width: 700px;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    /* 내용이 길면 모달 내부에서만 스크롤 */
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 1rem;
}

.close {
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 버튼 스타일 보완 */
.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

.btn-outline {
    background-color: transparent;
    color: #333;
    border: 1px solid #ddd;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-outline:hover {
    background-color: #f5f5f5;
    border-color: #ccc;
}

.btn-edit {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 0.5rem;
}

.btn-delete {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
}

textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    resize: none;
}

#imagePreview {
    border: 1px dashed #ccc;
    padding: 5px;
    background: #fdfdfd;
    margin-top: 10px;
}

#imagePreview img {
    display: block;
    max-width: 100%;
}

.status-badge {
    display: inline-block;
    font-weight: 500;
}