/* Soop CMS - Custom Styles */
/* Bootstrap 5로 처리할 수 없는 커스텀 스타일만 작성 */
/* 디자인 가이드: docs/design-guide.md 참조 */

/* ========================================
   1. Brand Colors (CSS Variables)
   ======================================== */
:root {
  --brand: #F0EDCC;
  --brand-dark: #02343F;
  --brand-accent: #3B5249;
  --sidebar-width: 260px;
  --header-height: 56px;
  --bg-page: #F8F9FA;
  --bg-card: #FFFFFF;
  --bg-table-header: #F1F3F5;
  --border-color: #DEE2E6;
  --text-primary: #212529;
  --text-secondary: #6C757D;
}

/* ========================================
   2. Brand Buttons
   ======================================== */
.btn-brand {
  background-color: var(--brand-accent);
  border-color: var(--brand-accent);
  color: #FFFFFF;
}
.btn-brand:hover,
.btn-brand:focus {
  background-color: var(--brand-dark);
  border-color: var(--brand-dark);
  color: #FFFFFF;
}
.btn-brand:active {
  background-color: var(--brand-dark);
}

.btn-outline-brand {
  border-color: var(--brand-accent);
  color: var(--brand-accent);
}
.btn-outline-brand:hover {
  background-color: var(--brand-accent);
  color: #FFFFFF;
}

/* ========================================
   3. Brand Badge
   ======================================== */
.badge-brand {
  background-color: var(--brand-accent);
  color: #FFFFFF;
}

/* ========================================
   4. Sidebar
   ======================================== */
.layout-sidebar {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  background-color: var(--brand-dark);
  color: rgba(255, 255, 255, 0.7);
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  padding: 20px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-user {
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--brand-accent);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
}

.sidebar-menu {
  list-style: none;
  padding: 8px 0;
  margin: 0;
  flex: 1;
  overflow-y: auto;
}

.menu-item {
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: background-color 0.15s;
  font-size: 0.9rem;
  border-radius: 0 8px 8px 0;
  margin-right: 8px;
}

.menu-item:hover {
  background-color: rgba(240, 237, 204, 0.1);
}

.menu-item.active {
  background-color: var(--brand);
  color: var(--brand-dark);
  font-weight: 600;
}

.menu-item i {
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
}

.menu-group-label {
  padding: 16px 16px 6px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.4);
}

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

.submenu .menu-item {
  padding-left: 46px;
  font-size: 0.85rem;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-logout {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 6px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn-logout:hover {
  color: rgba(255, 255, 255, 0.9);
}

/* ========================================
   5. Main Content
   ======================================== */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  background-color: var(--bg-page);
}

/* ========================================
   6. Page Header
   ======================================== */
.page-header {
  margin-bottom: 24px;
}
.page-header h2 {
  font-weight: 700;
  margin-bottom: 4px;
}
.page-header .page-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* ========================================
   7. Table
   ======================================== */
.table-header th {
  background-color: var(--bg-table-header);
  font-size: 0.85rem;
  font-weight: 600;
  color: #495057;
  white-space: nowrap;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
}

.table td {
  padding: 12px 16px;
  vertical-align: middle;
  font-size: 0.9rem;
}

.table tbody tr:last-child td {
  border-bottom: none;
}

/* ========================================
   8. Summary Cards (Dashboard)
   ======================================== */
.card-summary .card-body {
  padding: 1.25rem;
}

.card-summary .display-value {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}

.card-accent-bar {
  height: 3px;
  border-radius: 4px 4px 0 0;
}

/* ========================================
   9. Search Area
   ======================================== */
.search-card .form-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0;
  white-space: nowrap;
}

.total-count {
  font-size: 0.9rem;
  color: var(--text-secondary);
}
.total-count strong {
  color: var(--text-primary);
}

/* ========================================
   10. Pagination (Custom Active)
   ======================================== */
.pagination .page-item.active .page-link {
  background-color: var(--brand-accent);
  border-color: var(--brand-accent);
}

/* ========================================
   11. D-day Badge
   ======================================== */
.badge-dday {
  font-size: 0.75rem;
  font-weight: 600;
}

/* ========================================
   12. Modal
   ======================================== */
.modal-header {
  padding: 16px 24px;
}
.modal-body {
  padding: 24px;
}
.modal-footer {
  padding: 16px 24px;
}
.modal-title {
  font-weight: 700;
}

/* ========================================
   13. Form Section Grouping
   ======================================== */
.form-section {
  margin-bottom: 24px;
}
.form-section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  padding-bottom: 8px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

/* ========================================
   14. Responsive
   ======================================== */
@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  .sidebar.show {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
  }

  .sidebar-overlay.show {
    display: block;
  }
}

/* ========================================
   15. Utility Classes (inline style 대체)
   ======================================== */
.bg-page {
  background-color: var(--bg-page);
}

.cursor-pointer {
  cursor: pointer;
}

.text-brand-accent {
  color: var(--brand-accent);
}

.text-brand-dark {
  color: var(--brand-dark);
}

.bg-brand {
  background-color: var(--brand);
}

.bg-brand-accent {
  background-color: var(--brand-accent);
}

.icon-lg {
  font-size: 2.5rem;
}

.icon-md {
  font-size: 1.8rem;
}

.badge-sm {
  font-size: 0.7rem;
}

.badge-xs {
  font-size: 0.65rem;
}

/* 테이블 컬럼 너비 */
.col-w-70 { width: 70px; }
.col-w-75 { width: 75px; }
.col-w-80 { width: 80px; }
.col-w-90 { width: 90px; }
.col-w-100 { width: 100px; }
.col-w-110 { width: 110px; }
.col-w-120 { width: 120px; }
.col-w-130 { width: 130px; }

/* 추가 배경색 유틸리티 */
.bg-purple { background-color: #6f42c1; }
.bg-orange { background-color: #fd7e14; }

/* 카드 클릭 가능 호버 효과 */
.card-clickable {
  cursor: pointer;
  transition: box-shadow 0.15s;
}
.card-clickable:hover {
  box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.1) !important;
}

/* 지도 컨테이너 */
.map-container {
  width: 100%;
  height: 500px;
  border-radius: 8px;
}

/* 로그인 카드 */
.login-card {
  width: 100%;
  max-width: 420px;
}

.login-logo {
  width: 64px;
  height: 64px;
}

.sidebar-logo {
  width: 32px;
  height: 32px;
}

/* 사이드바 로고 원형 아이콘 */
.sidebar-logo-circle {
  width: 32px;
  height: 32px;
  background-color: var(--brand);
}

.sidebar-logo-circle i {
  font-size: 0.9rem;
  color: var(--brand-dark);
}

/* 스피너 브랜드 색상 */
.spinner-brand {
  color: var(--brand-accent);
}

/* 역할 라벨 (사이드바) */
.text-white-muted {
  color: rgba(255, 255, 255, 0.5);
}

/* 단위 텍스트 (건, 원 등) */
.fs-unit {
  font-size: 1rem;
}

/* 아이콘 크기 */
.icon-hamburger {
  font-size: 1.5rem;
}

/* ========================================
   Skeleton Loading
   ======================================== */
@keyframes skeleton-pulse {
  0%, 100% { opacity: 0.15; }
  50% { opacity: 0.3; }
}

.skeleton-line {
  background-color: var(--text-secondary);
  border-radius: 4px;
  animation: skeleton-pulse 1.2s ease-in-out infinite;
}

.skeleton-sm {
  height: 12px;
  width: 60%;
}

.skeleton-lg {
  height: 28px;
  width: 40%;
}
