/* ============================================
   Stat Studio — Professional Research Tool
   SPSS/Mplus 스타일 전문가용 테마
============================================ */

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* 색상 — 연구 도구 느낌의 차분한 팔레트 */
  --bg-primary:    #f4f6f9;    /* 페이지 배경 — 아주 옅은 회색 */
  --bg-secondary:  #ffffff;    /* 카드 배경 */
  --bg-nav:        #263238;    /* 상단 네비게이션 — 진한 슬레이트 */
  --bg-sidebar:    #eceff1;    /* 사이드바 */
  --bg-hover:      #e8eaf6;    /* 호버 */
  --bg-active:     #bbdefb;    /* 활성 */
  
  --text-primary:   #212121;
  --text-secondary: #546e7a;
  --text-muted:     #90a4ae;
  --text-inverse:   #ffffff;
  
  --border-light:  #e0e0e0;
  --border-medium: #bdbdbd;
  
  --accent:        #1565c0;   /* 연구용 딥블루 */
  --accent-hover:  #0d47a1;
  --success:       #2e7d32;
  --warning:       #e65100;
  --danger:        #c62828;
  
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.10);
  
  --radius: 4px;          /* 전문가 도구는 둥근 모서리 최소 */
  --radius-lg: 6px;
  
  --nav-height: 52px;
  --sidebar-width: 260px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans KR', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}

/* ─── 상단 Navbar ─────────────────────── */
.navbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: var(--bg-nav);
  color: var(--text-inverse);
  display: flex;
  align-items: center;
  padding: 0 20px;
  z-index: 100;
  box-shadow: var(--shadow-md);
}

.navbar-brand {
  font-size: 18px;
  font-weight: 700;
  margin-right: 32px;
  display: flex; align-items: center; gap: 8px;
  color: var(--text-inverse);
  text-decoration: none;
  white-space: nowrap;
}
.navbar-brand .dot { color: #42a5f5; }

.navbar-menu {
  display: flex;
  gap: 2px;
  flex: 1;
}

.nav-item {
  padding: 0 14px;
  height: var(--nav-height);
  display: flex; align-items: center;
  cursor: pointer;
  color: #cfd8dc;
  font-size: 13px;
  font-weight: 500;
  border-bottom: 3px solid transparent;
  transition: all 0.15s;
  white-space: nowrap;
}
.nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-item.active { 
  background: rgba(255,255,255,0.08);
  color: #fff; 
  border-bottom-color: #42a5f5;
}
.nav-item .nav-icon { margin-right: 6px; font-size: 14px; }

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.navbar-actions a {
  color: #cfd8dc;
  font-size: 12px;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: var(--radius);
  border: 1px solid transparent;
}
.navbar-actions a:hover { background: rgba(255,255,255,0.06); color: #fff; border-color: rgba(255,255,255,0.1); }

/* ─── 메인 레이아웃 ─────────────────────── */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  margin-top: var(--nav-height);
  min-height: calc(100vh - var(--nav-height));
}

/* ─── 사이드바 ─────────────────────── */
.sidebar {
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-light);
  padding: 16px 10px;
  position: sticky;
  top: var(--nav-height);
  height: calc(100vh - var(--nav-height));
  overflow-y: auto;
}

.sidebar-header {
  padding: 0 10px 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}
.sidebar-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}
.sidebar-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.submenu-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.submenu-item {
  padding: 9px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: background 0.15s;
  border: 1px solid transparent;
  position: relative;
}
.submenu-item:hover { background: var(--bg-hover); }
.submenu-item.active {
  background: #fff;
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}
.submenu-item.active::before {
  content: '';
  position: absolute;
  left: -10px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}
.submenu-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}
.submenu-desc {
  font-size: 11px;
  color: var(--text-muted);
}
.submenu-item.active .submenu-label { color: var(--accent); }

/* 상태 배지 */
.badge {
  font-size: 9px;
  padding: 1px 6px;
  border-radius: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-ready { background: #c8e6c9; color: #1b5e20; }
.badge-wip   { background: #ffe0b2; color: #e65100; }
.badge-gpu   { background: #e1bee7; color: #4a148c; }

/* ─── 컨텐츠 영역 ─────────────────────── */
.content {
  padding: 20px 24px;
  max-width: 1400px;
}

.content-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 2px solid var(--border-light);
}
.content-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}
.content-title .cat {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-sidebar);
  padding: 2px 10px;
  border-radius: 10px;
}
.content-subtitle {
  color: var(--text-secondary);
  font-size: 13px;
  margin-top: 4px;
}

.breadcrumb {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 4px;
}
.breadcrumb span + span::before { content: '›'; margin-right: 6px; color: var(--border-medium); }

/* 카드 */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}
.card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}

/* 버튼 */
.btn {
  padding: 8px 16px;
  border: 1px solid var(--border-medium);
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.15s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn:hover { background: var(--bg-hover); border-color: var(--accent); }
.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

/* 준비중 빈 상태 */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--text-secondary);
}
.empty-state .icon {
  font-size: 72px;
  margin-bottom: 16px;
  opacity: 0.4;
}
.empty-state h3 {
  font-size: 18px;
  margin-bottom: 8px;
  color: var(--text-primary);
}
.empty-state p {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 500px;
  margin: 0 auto;
  line-height: 1.7;
}
.empty-state .soon {
  display: inline-block;
  margin-top: 20px;
  padding: 6px 14px;
  background: #fff3e0;
  color: #e65100;
  font-size: 12px;
  font-weight: 700;
  border-radius: 12px;
  border: 1px solid #ffccbc;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* 반응형 */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .navbar-menu { overflow-x: auto; }
  .navbar-menu::-webkit-scrollbar { height: 0; }
}

/* 스크롤바 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-medium); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* 드롭존 */
.dropzone {
  border: 2px dashed var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 36px 20px;
  text-align: center;
  background: var(--bg-primary);
  cursor: pointer;
  transition: all 0.2s;
}
.dropzone:hover {
  border-color: var(--accent);
  background: var(--bg-hover);
}

.progress {
  height: 4px;
  background: var(--border-light);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 14px;
}
.progress-bar {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 0.3s;
}

/* 파일 행 */
.file-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  margin-bottom: 6px;
  cursor: pointer;
  transition: all 0.15s;
  background: var(--bg-secondary);
}
.file-row:hover {
  border-color: var(--accent);
  background: var(--bg-hover);
}
.file-row:last-child { margin-bottom: 0; }

.del-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border-light);
  background: var(--bg-secondary);
  color: var(--text-muted);
  border-radius: 50%;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  z-index: 2;
}
.del-btn:hover {
  background: #ffebee;
  color: #c62828;
  border-color: #c62828;
}
