/* marketing/assets/css/style.css */

:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --text-main: #1e293b;
    --text-sub: #64748b;
    --bg-body: #f8fafc;
    --bg-white: #ffffff;
    --border: #e2e8f0;
    --sidebar-width: 250px;
}

/* 초기화 */
* { box-sizing: border-box; }
body { margin: 0; padding: 0; font-family: "Pretendard", sans-serif; background: var(--bg-body); color: var(--text-main); font-size: 15px; line-height: 1.5; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; padding: 0; margin: 0; }

/* 레이아웃 */
.sidebar { position: fixed; top: 0; left: 0; width: var(--sidebar-width); height: 100vh; background: var(--bg-white); border-right: 1px solid var(--border); padding: 25px; z-index: 1000; display: flex; flex-direction: column; }
.main-content { margin-left: var(--sidebar-width); padding: 40px; min-height: 100vh; }
.container { max-width: 1400px; margin: 0 auto; }

/* 사이드바 요소 */
.brand { font-size: 20px; font-weight: 800; color: var(--primary); margin-bottom: 30px; }
.menu { display: flex; flex-direction: column; gap: 5px; }
.menu a { padding: 12px 15px; border-radius: 8px; color: var(--text-sub); font-weight: 600; }
.menu a:hover { background: #f1f5f9; color: var(--text-main); }
.menu a.active { background: var(--primary); color: white; }
.menu hr { border: 0; border-top: 1px solid var(--border); margin: 15px 0; width: 100%; }

/* 헤더 & 검색 */
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.page-title { font-size: 24px; font-weight: 700; display: flex; align-items: center; gap: 10px; margin: 0; }
.view-select { padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; background: white; font-size: 14px; cursor: pointer; outline: none; }
.search-box { background: white; padding: 15px; border-radius: 12px; border: 1px solid var(--border); margin-bottom: 15px; }
.search-form { display: flex; gap: 10px; }
.search-select { width: 150px; }
.search-input { flex: 1; }

/* 버튼 그룹 */
.action-bar { display: flex; gap: 10px; margin-bottom: 15px; flex-wrap: wrap; align-items: center; }
.action-left { display: flex; gap: 8px; flex-wrap: wrap; }
.action-right { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }

/* 공통 UI */
.btn { display: inline-flex; align-items: center; justify-content: center; height: 40px; padding: 0 18px; border-radius: 8px; font-weight: 600; font-size: 14px; cursor: pointer; border: none; transition: 0.2s; white-space: nowrap; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: #10b981; color: white; }
.btn-secondary { background: #64748b; color: white; }
.btn-purple { background: #8b5cf6; color: white; }
.btn-dark { background: #0f172a; color: white; }
.btn-danger { background: white; border: 1px solid #fee2e2; color: #ef4444; }
.btn-info { background: #0ea5e9; color: white; }
.btn-sm { height: 32px; padding: 0 10px; font-size: 12px; }
.input { height: 40px; padding: 0 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; outline: none; background: white; }

/* 테이블 */
.table-container { background: white; border-radius: 12px; border: 1px solid var(--border); overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; font-size: 14px; }
th { background: #f8fafc; padding: 14px; text-align: left; border-bottom: 1px solid var(--border); color: var(--text-sub); font-weight: 600; }
td { padding: 14px; border-bottom: 1px solid var(--border); color: var(--text-main); vertical-align: middle; }
tr:last-child td { border-bottom: none; }

/* ★ 모달 (PC/모바일 공통 중앙 정렬) ★ */
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 9999; justify-content: center; align-items: center; padding: 20px; }
.modal-content { background: white; width: 500px; max-width: 100%; padding: 30px; border-radius: 16px; box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1); max-height: 90vh; overflow-y: auto; position: relative; }
.modal-input { width: 100%; margin-bottom: 10px; }
.modal-btn { width: 100%; margin-top: 5px; }

/* ★ 달력 전용 스타일 (예쁘게 수정됨) ★ */
.cal-header { display: flex; align-items: center; justify-content: center; gap: 20px; margin-bottom: 20px; }
.cal-title { font-size: 20px; font-weight: 800; color: var(--text-main); width: 120px; text-align: center; }
.cal-btn { width: 32px; height: 32px; border-radius: 50%; background: white; border: 1px solid var(--border); color: var(--text-sub); display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 12px; transition: 0.2s; padding: 0; }
.cal-btn:hover { border-color: var(--primary); color: var(--primary); background: #eff6ff; }

.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; text-align: center; }
.cal-day { border: 1px solid #f1f5f9; border-radius: 8px; padding: 5px; height: 60px; display: flex; flex-direction: column; justify-content: space-between; background: #fff; }
.cal-day.has-rank { background: #f0f9ff; border-color: #bae6fd; color: #0284c7; font-weight: bold; }
.cal-date { font-size: 12px; color: #94a3b8; text-align: left; }
.cal-rank { font-size: 14px; font-weight: 800; }

/* 모바일 반응형 */
@media (max-width: 768px) {
    .sidebar { width: 100%; height: auto; position: sticky; top: 0; border-right: none; border-bottom: 1px solid var(--border); padding: 10px 15px; flex-direction: row; justify-content: space-between; align-items: center; }
    .brand { margin: 0; font-size: 18px; margin-right: 15px; white-space: nowrap; }
    .menu { flex-direction: row; gap: 8px; overflow-x: auto; flex: 1; -ms-overflow-style: none; scrollbar-width: none; }
    .menu::-webkit-scrollbar { display: none; }
    .menu a { padding: 8px 12px; font-size: 13px; white-space: nowrap; background: #f1f5f9; border-radius: 20px; }
    .menu a.active { background: var(--primary); }
    .menu hr { display: none; }
    .main-content { margin-left: 0; padding: 20px 15px; width: 100%; }
    .page-header { flex-direction: row; align-items: center; justify-content: space-between; }
    .page-title { font-size: 18px; }
    .view-select { font-size: 13px; padding: 6px 10px; }
    .search-form { flex-direction: column; }
    .search-select, .search-input, .search-form button { width: 100% !important; }
    .action-bar { flex-direction: column; gap: 10px; align-items: stretch; }
    .action-left, .action-right { display: grid; grid-template-columns: 1fr 1fr; width: 100%; gap: 8px; margin: 0; }
    .btn { width: 100%; }
    th, td { padding: 12px 10px; font-size: 13px; }
    
    /* ★ 모바일 모달 및 달력 최적화 */
    .modal { padding: 20px; align-items: center; } /* 중앙 정렬 강제 */
    .modal-content { width: 95%; max-width: 400px; padding: 25px 20px; border-radius: 16px; margin: 0; }
    .cal-day { height: 50px; font-size: 11px; }
    .cal-title { font-size: 18px; }
}