/* === 기본 설정: 폰트 및 전체 배경 === */
body, html {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #121212; /* 전체 배경은 어둡게 */
    color: #f0f0f0;           /* 기본 글자색은 밝게 */
    font-size: 16px;
}

/* === 레이아웃 === */
.admin-container {
    display: flex;
}

.main-content {
    margin-left: 240px; /* 사이드바 너비만큼 왼쪽 여백 */
    width: calc(100% - 240px); /* 사이드바 너비를 뺀 나머지 너비 */
    flex-grow: 1;
    padding: 2rem 3rem;
    height: 100vh;
    overflow-y: auto;
    box-sizing: border-box;
}

/* === 사이드바 === */
.sidebar {
    width: 240px;
    background-color: #000000; /* 사이드바는 더 진한 검은색 */
    height: 100vh;
    position: fixed; /* 화면에 고정 */
    border-right: 1px solid #282828;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    box-sizing: border-box;
}

.sidebar .logo {
    font-size: 1.5rem;
    font-weight: 700;
    text-decoration: none;
    color: #ffffff;
    margin-bottom: 2rem;
}

.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar ul li a {
    display: block;
    padding: 0.8rem 1.2rem;
    text-decoration: none;
    color: #b3b3b3;
    font-weight: 500;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.sidebar ul li a:hover {
    background-color: #282828;
    color: #ffffff;
}

.sidebar ul li a.active {
    background-color: #0d6efd; /* 활성화된 메뉴는 파란색으로 강조 */
    color: #ffffff;
}

.sidebar .footer-nav {
    margin-top: auto; /* 하단 메뉴를 아래로 밀어냄 */
}


/* === 메인 콘텐츠 헤더 === */
.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #333;
    margin-bottom: 2rem;
}

.content-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
}

.header-actions {
    display: flex;
    gap: 1rem;
}

input[type="search"] {
    padding: 0.5rem 0.8rem;
    background-color: #2a2a2e;
    border: 1px solid #555;
    border-radius: 6px;
    color: #f0f0f0;
    min-width: 250px;
}

.content-body {
    background-color: #1c1c1c;
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid #333;
}


/* === 테이블 === */
.data-table, .article-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th, .data-table td,
.article-table th, .article-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #333;
    vertical-align: middle;
}

.data-table thead, .article-table thead {
    background-color: #2a2a2e;
}

.data-table th, .article-table th {
    font-weight: 600;
    color: #aaa;
}

.data-table tbody tr:hover,
.article-table tbody tr:hover {
    background-color: #2a2a2e;
}

.profile-img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.thumbnail-img {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
}

.no-data {
    text-align: center;
    padding: 3rem;
    color: #777;
}

/* === 버튼 === */
.btn {
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: opacity 0.2s ease;
}
.btn:hover { opacity: 0.8; }
.btn-primary { background-color: #0d6efd; color: white; }
.btn-secondary { background-color: #6c757d; color: white; }
.btn-danger { background-color: #dc3545; color: white; }
.btn-success { background-color: #198754; color: white; }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.85rem; }


/* === 모달 === */
.modal-overlay {
    position: fixed; inset: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex; justify-content: center; align-items: center;
    z-index: 1000;
    opacity: 0; visibility: hidden;
    transition: opacity 0.3s ease;
}
.modal-overlay.active {
    opacity: 1; visibility: visible;
}
.modal-content {
    background-color: #282828;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}
.modal-overlay.active .modal-content {
    transform: translateY(0);
}
.modal-content.large { max-width: 800px; }
.modal-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #444; padding: 1.5rem; }
.modal-header h2 { margin: 0; }
.close-btn { background: none; border: none; font-size: 2rem; cursor: pointer; color: #999; line-height: 1; }
.modal-body { max-height: 70vh; overflow-y: auto; padding: 1.5rem; }
.modal-footer { display: flex; justify-content: flex-end; gap: 1rem; border-top: 1px solid #444; padding: 1.5rem; }

/* === 폼 요소 === */
.form-group { margin-bottom: 1.5rem; }
.form-group label { display: block; margin-bottom: 0.5rem; font-weight: 500; }
.form-group input[type="text"],
.form-group input[type="url"],
.form-group input[type="datetime-local"],
.form-group select {
    width: 100%; padding: 0.75rem;
    background-color: #1c1c1c; border: 1px solid #555;
    border-radius: 6px; color: #f0f0f0;
    box-sizing: border-box; font-size: 1rem;
}
.form-group input:focus, .form-group select:focus {
    outline: none; border-color: #0d6efd;
}

/* === 상태 배지 === */
.status-badge {
    padding: 5px 10px; border-radius: 15px;
    font-size: 0.8em; font-weight: bold; color: white;
}
.status-unprocessed { background-color: #6c757d; }
.status-processed { background-color: #198754; }

/* === 착장 만들기 페이지 === */
.creator-layout { display: flex; gap: 30px; align-items: flex-start; }
.image-picker-panel { flex: 1; border: 1px solid #444; border-radius: 8px; padding: 20px; }
.image-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 15px; max-height: 80vh; overflow-y: auto; }
.selectable-image { width: 100%; aspect-ratio: 1 / 1.2; object-fit: cover; border-radius: 4px; border: 3px solid transparent; cursor: pointer; transition: all 0.2s; }
.selectable-image:hover { opacity: 0.8; }
.selectable-image.selected { border-color: #0d6efd; }
.form-panel { flex: 1; }
.disabled-form { opacity: 0.4; pointer-events: none; }

.sidebar-header {
    /* 헤더 아래쪽에 20px 정도의 여백을 줍니다 */
    margin-bottom: 20px;
}

/* --- admin-style.css 파일 수정 --- */

/* 아이템 폼들을 담는 컨테이너 */
#items-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem; /* 각 아이템 카드 사이의 간격 */
    margin-top: 1rem;
}

/* 개별 아이템 폼 그룹 (카드 디자인) */
.item-form-group {
    background-color: #333; /* 카드 배경색 */
    border: 1px solid #444;
    border-radius: 8px;
    padding: 1.5rem;
    position: relative; /* 삭제 버튼을 위한 기준점 */
}

/* '아이템 #1' 제목 스타일 */
.item-form-group h5 {
    margin: 0 0 1.5rem 0;
    padding-bottom: 1rem;
    border-bottom: 1px solid #444;
    color: #f0f0f0;
}

/* 폼 입력 필드를 2열 그리드로 배치 */
.item-form-group .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* 2열 */
    gap: 1rem; /* 필드 사이 간격 */
}

/* 각 입력 필드 그룹 */
.item-form-group .form-group {
    margin-bottom: 0; /* 기존 여백 제거 */
}

/* 이제 라벨을 숨기지 않고 보여줍니다. */
.item-form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: #b3b3b3;
}

/* 삭제 버튼을 카드 오른쪽 상단으로 이동 */
.item-form-group .remove-item-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
}

/* 아이템 추가 버튼과 제목을 한 줄에 배치 */
.items-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
}

.article-summary {
    background-color: #2a2a2e;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 1.5rem;
}

/* 'AI 요약 (수정 가능)' 라벨 스타일 */
.article-summary label {
    display: block;
    margin-bottom: 1rem;
    font-weight: 500;
    font-size: 1.1rem; /* 살짝 크게 */
    color: #f0f0f0;
}

/* [핵심] textarea 스타일 수정 */
.article-summary textarea {
    width: 100%; /* 부모 요소 너비에 꽉 채움 */
    min-height: 150px; /* 최소 높이를 150px로 지정 (더 길어지면 스크롤 생성) */
    resize: vertical; /* 사용자가 높이만 조절할 수 있도록 설정 */

    /* 기존 input 스타일과 통일 */
    padding: 0.75rem;
    background-color: #1c1c1c;
    border: 1px solid #555;
    border-radius: 6px;
    color: #f0f0f0;
    box-sizing: border-box;
    font-size: 1rem;
    line-height: 1.6; /* 줄 간격 */
}

/* textarea에 포커스 시 테두리 색상 변경 */
.article-summary textarea:focus {
    outline: none;
    border-color: #0d6efd;
}