/* --- 기본 & 레이아웃 --- */
:root {
 --bg-gradient-start: #f4f0ff;
 --bg-gradient-mid: #eaf7ff;
 --bg-gradient-end: #fff0f5;
 --primary: #8ecae6;
--primary-strong: #219ebc;
 --accent: #ffc8dd;
 --card-bg: #ffffff;
 --card-border: #e5e7eb;
 --text-primary: #1f2937;
 --text-muted: #6b7280;
 --danger: #ef4444;
 --danger-bg: #fee2e2;
 --ring-color: rgba(33, 158, 188, 0.3);
 --font-main: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* {
 box-sizing: border-box;
}

body {
 margin: 0;
 font-family: var(--font-main);
 color: var(--text-primary);
 background: linear-gradient(180deg, var(--bg-gradient-start) 0%, var(--bg-gradient-mid) 50%, var(--bg-gradient-end) 100%);
 min-height: 100vh;
}

.container {
 max-width: 1200px;
 margin: 0 auto;
 padding: 1.5rem;
}

.hidden {
 display: none !important;
}

/* --- 헤더 & 툴바 --- */
.header {
 display: flex;
 justify-content: space-between;
 align-items: center;
 margin-bottom: 2rem;
 flex-wrap: wrap;
 gap: 1rem;
}

.brand {
 display: flex;
 align-items: center;
 gap: 0.75rem;
}

.logo {
 width: 32px;
 height: 32px;
 border-radius: 8px;
 background: linear-gradient(135deg, var(--primary), var(--accent));
 display: grid;
 place-items: center;
 color: var(--text-primary);
 font-weight: 900;
 font-size: 1rem;
}

.brand h1 {
 margin: 0;
 font-size: 1.5rem;
}

.toolbar {
 display: flex;
 align-items: center;
 gap: 1rem;
}

.search-wrapper {
 position: relative;
}

.search-icon {
 position: absolute;
 left: 12px;
 top: 50%;
 transform: translateY(-50%);
 color: var(--text-muted);
}

.search-input {
 border: 1px solid var(--card-border);
 border-radius: 999px;
 padding: 0.6rem 1rem 0.6rem 2.5rem;
 background-color: rgba(255, 255, 255, 0.7);
 transition: all 0.2s ease;
 min-width: 250px;
}

.search-input:focus {
 outline: none;
 border-color: var(--primary-strong);
 box-shadow: 0 0 0 3px var(--ring-color);
 background-color: white;
}

/* --- 관리자 컨트롤 & 업로드 --- */
.admin-controls {
 background-color: rgba(255, 255, 255, 0.6);
 border-radius: 1rem;
 padding: 1.5rem;
 margin-bottom: 2rem;
 border: 1px solid var(--card-border);
}

.admin-controls h2 {
 margin-top: 0;
}

.dropzone {
 display: flex;
 flex-direction: column;
 align-items: center;
 justify-content: center;
padding: 2rem;
 border: 2px dashed #cbd5e1;
 border-radius: 0.75rem;
 background: linear-gradient(180deg, #f9fbff, #ffffff);
 color: var(--text-muted);
 cursor: pointer;
 transition: all 0.2s ease;
 text-align: center;
}

.dropzone.dragover {
 border-color: var(--primary-strong);
 background: #f0fbff;
}

.drop-icon {
 color: var(--primary);
 margin-bottom: 1rem;
}

.upload-actions {
 display: flex;
 gap: 0.75rem;
 margin-top: 1rem;
 justify-content: center;
}

.sel-info-text {
 text-align: center;
 margin-top: 1rem;
 font-size: 0.9rem;
}

/* --- 메인 콘텐츠 & 파일 그리드 --- */
.info-bar {
 color: var(--text-muted);
 margin-bottom: 1rem;
}

.grid {
 display: grid;
 gap: 1.25rem;
 grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); 
}

.card {
 background: var(--card-bg);
border: 1px solid var(--card-border);
 border-radius: 1rem;
 padding: 1rem;
 display: flex;
 flex-direction: column;
gap: 0.75rem;
 transition: transform 0.2s ease, box-shadow 0.2s ease;
 cursor: pointer;
 overflow: hidden;
}

.card:hover {
 transform: translateY(-4px);
 box-shadow: 0 10px 20px -10px rgba(0, 0, 0, 0.15);
}

.thumb {
 height: 120px;
border-radius: 0.75rem;
 background: linear-gradient(135deg, #e6f3ff, #f5f9ff);
 display: grid;
 place-items: center;
 font-size: 2.5rem;
 border: 1px solid #e0e8f0;
}

.meta {
 display: flex;
 flex-direction: column;
 gap: 4px;
}

.name {
 font-weight: 700;
 white-space: nowrap;
 overflow: hidden;
 text-overflow: ellipsis;
}

.sub {
 font-size: 0.8rem;
 color: var(--text-muted);
}

.card-actions {
 display: flex;
 justify-content: flex-end;
 gap: 0.5rem;
 margin-top: auto;
 padding-top: 0.5rem;
}

/* --- 버튼 --- */
.btn {
 appearance: none;
 border: 1px solid #d1d5db;
 background-color: #fff;
 color: var(--text-primary);
 padding: 0.6rem 1rem;
 border-radius: 999px;
 cursor: pointer;
font-weight: 600;
 transition: all 0.15s ease;
 display: inline-flex;
 align-items: center;
 justify-content: center;
 gap: 0.5rem;
}

.btn:hover {
 transform: translateY(-1px);
 box-shadow: 0 4px 10px -4px rgba(0, 0, 0, 0.1);
}

.btn:active {
 transform: translateY(0);
}

.btn-primary {
 background: linear-gradient(135deg, var(--primary), var(--accent));
 border-color: transparent;
 color: #0b1320;
 box-shadow: 0 8px 20px -10px var(--ring-color);
}

.btn-danger {
 background-color: var(--danger-bg);
 border-color: #fca5a5;
 color: var(--danger);
}

.btn-danger:hover {
 background-color: #fecaca;
}

/* --- 모달 --- */
.modal-overlay {
 position: fixed;
 inset: 0;
 background-color: rgba(15, 23, 42, 0.4);
 display: flex;
 align-items: center;
 justify-content: center;
 z-index: 1000;
}

.modal-content {
 background-color: #fff;
 width: min(92vw, 500px);
 border-radius: 1rem;
 box-shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.3);
 display: flex;
 flex-direction: column;
}

.modal-sm {
    width: min(92vw, 400px);
}

.modal-header {
 padding: 1rem 1.5rem;
 border-bottom: 1px solid var(--card-border);
 display: flex;
 justify-content: space-between;
 align-items: center;
}

.modal-header h2 {
 margin: 0;
 font-size: 1.25rem;
}

.btn-close {
 background: none;
 border: none;
 font-size: 1.75rem;
 cursor: pointer;
 color: var(--text-muted);
 padding: 0 0.5rem;
}

.modal-body {
 padding: 1.5rem;
 overflow-y: auto;
 max-height: 70vh;
}

.modal-footer {
 padding: 1rem 1.5rem;
 border-top: 1px solid var(--card-border);
 display: flex;
 justify-content: flex-end;
 gap: 0.75rem;
}

.form-group {
 display: flex;
 flex-direction: column;
 gap: 0.5rem;
 margin-bottom: 1.25rem;
}

#file-short-id-status {
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.input {
 width: 100%;
 border: 1px solid #cbd5e1;
 border-radius: 0.5rem;
 padding: 0.75rem 1rem;
 font-size: 1rem;
 font-family: var(--font-main);
}
.input:focus {
 outline: none;
 border-color: var(--primary-strong);
 box-shadow: 0 0 0 3px var(--ring-color);
}

.error-text {
 color: var(--danger);
 font-size: 0.9rem;
 margin-top: 0.5rem;
}

.detail-description {
 background-color: #f9fafb;
 border-radius: 0.5rem;
 padding: 1rem;
 margin-top: 0;
 white-space: pre-wrap;
 word-break: break-word;
}
.detail-file-list {
 list-style: none;
 padding: 0;
 margin: 0;
}
.detail-file-list li {
 display: flex;
 align-items: center;
 justify-content: space-between;
 padding: 0.75rem 0;
 border-bottom: 1px solid var(--card-border);
}
.detail-file-list li:last-child {
 border-bottom: none;
}
.detail-file-list li.admin-clickable {
    cursor: pointer;
    border-radius: 0.5rem;
    padding: 0.75rem;
    margin: -0.75rem; /* 패딩으로 인한 간격 조절 */
    transition: background-color 0.2s ease;
}
.detail-file-list li.admin-clickable:hover {
    background-color: #f9fafb;
}


.file-item-info {
 display: flex;
 align-items: center;
 gap: 0.75rem;
}
.file-item-icon {
 font-size: 1.5rem;
}
.file-item-name {
 font-weight: 500;
}
.file-item-size {
 font-size: 0.85rem;
 color: var(--text-muted);
}
#zip-progress {
 display: flex;
 align-items: center;
 gap: 0.5rem;
 width: 100%;
}

/* ⭐️ 관리자 설정 및 신규 모달 스타일 */
.divider {
    border: none;
    border-top: 1px solid var(--card-border);
    margin: 1.5rem 0;
}

.short-id-wrapper {
    display: flex;
    gap: 0.5rem;
}

/* ⭐️ 개별 파일 모달 스타일 추가 */
.file-preview-in-modal {
    background-color: #f9fafb;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.75rem;
    border: 1px solid var(--card-border);
}
.file-preview-in-modal .file-item-icon {
    font-size: 3rem;
}
.file-preview-in-modal .file-item-name {
    font-size: 1.1rem;
    font-weight: 700;
    word-break: break-all;
}

/* ==============================================
   IP Log Page Styles (style.css 맨 아래)
   (이 전체 섹션을 덮어쓰세요)
  ==============================================
*/

/* 로그 내용을 감싸는 컨테이너 */
.log-container {
    padding: 0 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* 주간 로그 섹션 (제목 + 테이블) */
.week-log {
    margin-bottom: 2.5rem; /* 각 주간 섹션 사이의 여백 */
}

/* 주간 제목 (index.html의 admin-controls h2 스타일 참고) */
.week-log h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e2e8f0; /* 구분선 */
    color: #334155;
}

/* 로그 테이블 스타일 */
.log-table {
    width: 100%;
    border-collapse: collapse; /* 테두리 겹침 방지 */
    font-size: 0.9rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border-radius: 8px; /* 모서리 둥글게 (옵션) */
    overflow: hidden; /* 모서리 둥글게 적용을 위해 */
}

.log-table th,
.log-table td {
    padding: 0.75rem 1rem; /* 셀 내부 여백 */
    text-align: left;
    border-bottom: 1px solid #f1f5f9; /* 행 구분선 */
}

/* 테이블 헤더 (제목 행) */
.log-table th {
    background-color: #f8fafc; /* 헤더 배경색 */
    font-weight: 600;
    color: #475569;
}

/* 테이블 본문 행 */
.log-table tbody tr:last-child td {
    border-bottom: none; /* 마지막 행의 하단 테두리 제거 */
}

.log-table tbody tr:hover {
    background-color: #f8fafc; /* 마우스 오버 시 배경색 */
}

/* 👇 [수정] 각 열의 너비가 변경되었습니다 */
.log-table .col-type {
    width: 20%;
}
.log-table .col-date {
    width: 20%;
}
.log-table .col-time {
    width: 20%;
}
.log-table .col-ip {
    width: 40%;
}

/* style.css 파일 맨 아래 (덮어쓰기) */
.thumb-icon {
  width: 100%;
  height: 100%;
  object-fit: cover; /* contain 대신 cover 사용 */
  display: block;
}

.thumb {
  /* height: 120px; 등 기존 스타일 유지 */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-sizing: border-box;
  overflow: hidden; /* cover 사용 시 잘리는 부분을 확실히 숨김 */
}