/* ── 변수 설정 ── */
:root {
  --primary-bg: #f4f7f9;
  --sidebar-bg: #0a1628;
  --card-bg: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --success: #059669;
  --warning: #f59e0b;
  --border: #e2e8f0;
  --sidebar-width: 260px;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Noto Sans KR', sans-serif; }
body { background: var(--primary-bg); color: var(--text-main); display: flex; overflow-x: hidden; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* ── 사이드바 (LNB) ── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: #fff;
  height: 100vh;
  position: fixed;
  top: 0; left: 0;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
  z-index: 1000;
}

/* ── 로고 스타일 변경 영역 ── */
.sidebar-logo {
  padding: 30px 20px;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sidebar-logo a {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  text-decoration: none;
}
.logo-en-one {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2.4rem;
  color: #00c8ff;
  letter-spacing: 1px;
}
.logo-en-edu {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2.4rem;
  color: #00ff9d;
  letter-spacing: 1px;
}
.logo-ko-text {
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #94a3b8;
  margin-left: 8px;
  letter-spacing: -0.5px;
}

.user-profile-sm { padding: 30px 20px; text-align: center; border-bottom: 1px solid rgba(255,255,255,0.1); }
.user-avatar { width: 80px; height: 80px; border-radius: 50%; background: #334155; margin: 0 auto 15px; display: flex; align-items: center; justify-content: center; font-size: 2rem; color: #fff; border: 3px solid #1e293b; }
.user-name { font-size: 1.1rem; font-weight: 700; margin-bottom: 5px; }
.user-level { font-size: 0.85rem; color: #94a3b8; background: rgba(255,255,255,0.1); padding: 3px 10px; border-radius: 20px; display: inline-block; }

.sidebar-menu { padding: 20px 0; flex-grow: 1; }
.sidebar-menu li a { display: block; padding: 15px 30px; color: #cbd5e1; font-weight: 500; transition: 0.2s; border-left: 4px solid transparent; }
.sidebar-menu li a:hover, .sidebar-menu li a.active { background: rgba(255,255,255,0.05); color: #fff; border-left-color: #00c8ff; }

/* ── 메인 컨텐츠 영역 ── */
.main-content {
  margin-left: var(--sidebar-width);
  flex-grow: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 탑바 */
.topbar {
  height: 70px;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
}
.topbar-left { display: flex; align-items: center; gap: 15px; }
.menu-toggle { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text-main); }
.page-title { font-size: 1.25rem; font-weight: 700; }
.topbar-right { display: flex; align-items: center; gap: 20px; }
.btn-logout { font-size: 0.9rem; font-weight: 600; color: var(--text-muted); transition: 0.2s; }
.btn-logout:hover { color: #ef4444; }

/* 대시보드 컨텐츠 */
.dashboard-body { padding: 40px; flex-grow: 1; }

/* 요약 카드 그리드 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; margin-bottom: 40px; }
.stat-card { background: var(--card-bg); padding: 24px; border-radius: 12px; box-shadow: 0 4px 6px rgba(0,0,0,0.02); border: 1px solid var(--border); display: flex; align-items: center; gap: 20px; }
.stat-icon { width: 60px; height: 60px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.8rem; }
.stat-icon.blue { background: rgba(37,99,235,0.1); color: var(--accent); }
.stat-icon.green { background: rgba(5,150,105,0.1); color: var(--success); }
.stat-icon.yellow { background: rgba(245,158,11,0.1); color: var(--warning); }
.stat-info h4 { font-size: 0.9rem; color: var(--text-muted); font-weight: 500; margin-bottom: 5px; }
.stat-info p { font-size: 1.5rem; font-weight: 700; color: var(--text-main); }

/* 하단 컨텐츠 레이아웃 (강의 목록 + 게시판) */
.content-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; }

/* 섹션 공통 */
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.section-title { font-size: 1.15rem; font-weight: 700; }
.btn-more { font-size: 0.85rem; color: var(--accent); font-weight: 600; }

/* 진행 중인 강의 카드 */
.course-list { display: flex; flex-direction: column; gap: 16px; }
.course-card { background: var(--card-bg); padding: 20px; border-radius: 12px; border: 1px solid var(--border); box-shadow: 0 2px 4px rgba(0,0,0,0.01); display: flex; gap: 20px; align-items: center; }
.course-thumb { width: 140px; height: 90px; border-radius: 8px; background: #e2e8f0; overflow: hidden; flex-shrink: 0; }
.course-thumb img { width: 100%; height: 100%; object-fit: cover; }
.course-details { flex-grow: 1; }
.course-category { font-size: 0.75rem; color: var(--accent); font-weight: 700; margin-bottom: 6px; display: inline-block; background: rgba(37,99,235,0.1); padding: 3px 8px; border-radius: 4px; }
.course-name { font-size: 1.05rem; font-weight: 700; margin-bottom: 8px; }
.course-meta { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 12px; }

/* 프로그레스 바 */
.progress-container { width: 100%; display: flex; align-items: center; gap: 15px; }
.progress-track { flex-grow: 1; height: 8px; background: #e2e8f0; border-radius: 4px; overflow: hidden; position: relative; }
.progress-bar { height: 100%; background: var(--accent); border-radius: 4px; width: 0; transition: width 1s ease-out; }
.progress-text { font-size: 0.9rem; font-weight: 700; color: var(--accent); width: 40px; text-align: right; }

.btn-play { padding: 10px 24px; background: var(--accent); color: #fff; border-radius: 8px; font-weight: 600; transition: 0.2s; text-align: center; white-space: nowrap; }
.btn-play:hover { background: var(--accent-hover); }

/* 게시판 (공지사항/문의) 영역 */
.board-card { background: var(--card-bg); padding: 24px; border-radius: 12px; border: 1px solid var(--border); box-shadow: 0 2px 4px rgba(0,0,0,0.01); }
.board-list li { border-bottom: 1px solid var(--border); padding: 12px 0; }
.board-list li:last-child { border-bottom: none; padding-bottom: 0; }
.board-list a { display: flex; justify-content: space-between; gap: 10px; transition: 0.2s; }
.board-list a:hover .board-title { color: var(--accent); text-decoration: underline; }
.board-title { font-size: 0.9rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-grow: 1; }
.board-date { font-size: 0.8rem; color: var(--text-muted); flex-shrink: 0; }
.badge-new { font-size: 0.7rem; background: #ef4444; color: #fff; padding: 2px 6px; border-radius: 4px; margin-left: 5px; font-weight: bold; }

/* ── 모바일 반응형 ── */
@media (max-width: 1024px) {
  .content-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.active { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .menu-toggle { display: block; }
  .dashboard-body { padding: 20px; }
  .course-card { flex-direction: column; align-items: stretch; text-align: center; }
  .course-thumb { width: 100%; height: 160px; }
  .progress-container { flex-direction: column; align-items: stretch; gap: 5px; margin-bottom: 15px; }
  .progress-text { text-align: left; width: auto; margin-bottom: 5px; }
}