/* ── 변수 설정 (대시보드와 동일) ── */
: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; }

/* ── 사이드바 ── */
.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; }

/* 본문 영역 */
.page-body { padding: 40px; flex-grow: 1; max-width: 1400px; margin: 0 auto; width: 100%; }

/* 탭 필터 */
.filter-tabs { display: flex; gap: 10px; margin-bottom: 30px; border-bottom: 2px solid var(--border); padding-bottom: 15px; }
.tab-btn { background: transparent; border: none; font-size: 1.05rem; font-weight: 600; color: var(--text-muted); padding: 5px 10px; cursor: pointer; position: relative; transition: 0.2s; }
.tab-btn:hover { color: var(--text-main); }
.tab-btn.active { color: var(--accent); }
.tab-btn.active::after { content: ''; position: absolute; bottom: -17px; left: 0; width: 100%; height: 3px; background: var(--accent); border-radius: 3px 3px 0 0; }
.tab-count { background: #e2e8f0; color: var(--text-muted); font-size: 0.75rem; padding: 2px 8px; border-radius: 20px; margin-left: 5px; vertical-align: middle; }
.tab-btn.active .tab-count { background: rgba(37,99,235,0.1); color: var(--accent); }

/* 강의 그리드 */
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; }
.course-card { background: var(--card-bg); border-radius: 12px; border: 1px solid var(--border); overflow: hidden; box-shadow: 0 4px 6px rgba(0,0,0,0.02); transition: 0.3s; display: flex; flex-direction: column; }
.course-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.05); border-color: rgba(37,99,235,0.3); }

/* 썸네일 영역 */
.course-thumb { height: 180px; position: relative; background: #e2e8f0; }
.course-thumb img { width: 100%; height: 100%; object-fit: cover; }
.status-badge { position: absolute; top: 15px; left: 15px; font-size: 0.75rem; font-weight: 700; padding: 4px 10px; border-radius: 4px; color: #fff; }
.status-badge.ing { background: var(--accent); }
.status-badge.done { background: var(--text-muted); }
.d-day { position: absolute; bottom: 15px; right: 15px; font-size: 0.75rem; font-weight: 700; padding: 4px 10px; border-radius: 4px; background: rgba(0,0,0,0.7); color: #fff; }
.d-day.urgent { background: #ef4444; }

/* 정보 영역 */
.course-info { padding: 20px; flex-grow: 1; display: flex; flex-direction: column; }
.course-cat { font-size: 0.8rem; color: var(--accent); font-weight: 600; margin-bottom: 8px; }
.course-title { font-size: 1.15rem; font-weight: 700; color: var(--text-main); margin-bottom: 10px; line-height: 1.4; word-break: keep-all; }
.course-meta { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 20px; }

/* 프로그레스 바 */
.progress-wrap { margin-bottom: 20px; margin-top: auto; }
.progress-header { display: flex; justify-content: space-between; font-size: 0.85rem; margin-bottom: 8px; font-weight: 600; }
.percent { color: var(--accent); font-size: 1rem; }
.progress-track { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--accent); border-radius: 4px; width: 0; transition: width 1s ease-out; }
.course-card[data-status="done"] .progress-bar { background: var(--success); }
.course-card[data-status="done"] .percent { color: var(--success); }

/* 하단 버튼 영역 */
.course-actions { display: grid; grid-template-columns: 1fr; gap: 10px; border-top: 1px solid var(--border); padding: 15px 20px; background: #f8fafc; }
.course-actions.two-col { grid-template-columns: 1fr 1fr; }
.btn { text-align: center; padding: 10px 0; border-radius: 6px; font-weight: 600; font-size: 0.95rem; cursor: pointer; transition: 0.2s; border: 1px solid transparent; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-outline { background: #fff; color: var(--text-main); border-color: var(--border); }
.btn-outline:hover { background: var(--border); }

/* ── 모바일 반응형 ── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.active { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .menu-toggle { display: block; }
  .page-body { padding: 20px; }
  .topbar { padding: 0 20px; }
}