/* =================================================================
   MediEdu - 공통 디자인 시스템 (Samsung Galaxy Tab S9 기준)
   기준: 1280×800px 가로 모드
   ================================================================= */

/* ── CSS 변수 ──────────────────────────────────────────────────── */
:root {
  /* Primary Palette (딥 네이비 - 기존 단색 파랑 탈피) */
  --color-primary: #1E3A5F;
  --color-primary-mid: #2E5C9E;
  --color-primary-light: #5B8FD4;

  /* Accent (티엘 그린 - 포인트) */
  --color-accent: #00897B;
  --color-accent-light: #4DB6AC;

  /* Background */
  --color-bg: #F4F6F9;
  --color-surface: #FFFFFF;
  --color-surface-alpha: rgba(255, 255, 255, 0.85);

  /* Text */
  --color-text-primary: #1A2332;
  --color-text-secondary: #5A6478;
  --color-text-muted: #8B96A5;

  /* Status */
  --color-success: #2E7D32;
  --color-warning: #E65100;
  --color-danger: #B71C1C;
  --color-info: #0277BD;

  /* Border */
  --color-border: #DDE3ED;
  --color-border-light: #EEF2F8;

  /* Shadow (네이비 기반 그림자) */
  --shadow-sm: 0 1px 3px rgba(30, 58, 95, 0.08), 0 1px 2px rgba(30, 58, 95, 0.06);
  --shadow-md: 0 4px 12px rgba(30, 58, 95, 0.10), 0 2px 4px rgba(30, 58, 95, 0.06);
  --shadow-lg: 0 8px 24px rgba(30, 58, 95, 0.14), 0 4px 8px rgba(30, 58, 95, 0.08);
  --shadow-xl: 0 16px 40px rgba(30, 58, 95, 0.16), 0 8px 16px rgba(30, 58, 95, 0.08);

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 50px;

  /* Layout */
  --header-height: 64px;
  --sidebar-width: 240px;
  --sidebar-admin-width: 260px;
  --footer-height: 56px;
  --content-padding: 28px;
}

/* ── 기본 리셋 & 바디 ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Noto Sans KR', sans-serif;
  background-color: var(--color-bg);
  color: var(--color-text-primary);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── 헤더 (메인 레이아웃용) ─────────────────────────────────────── */
.site-header {
  height: var(--header-height);
  background: linear-gradient(135deg, #1E3A5F 0%, #243F6B 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  padding: 0 24px;
  box-shadow: 0 2px 8px rgba(30, 58, 95, 0.20);
}

/* Bootstrap 네비바를 site-header로 재활용 */
.navbar {
  background: linear-gradient(135deg, #1E3A5F 0%, #243F6B 100%) !important;
  height: var(--header-height);
  box-shadow: 0 2px 8px rgba(30, 58, 95, 0.20);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
}

.navbar-brand i {
  color: var(--color-accent-light); /* 티엘 아이콘 */
}

/* 관리자 배지 */
.admin-badge {
  background: rgba(220, 53, 69, 0.15);
  color: #FF6B6B;
  border: 1px solid rgba(220, 53, 69, 0.25);
  border-radius: var(--radius-pill);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 10px;
  margin-left: 8px;
}

/* ── 사이드바 (일반 메인용) ─────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--color-surface);
  border-right: 1px solid var(--color-border-light);
  height: calc(100vh - var(--header-height) - var(--footer-height));
  position: sticky;
  top: var(--header-height);
  overflow-y: auto;
  padding: 16px 0;
}

.sidebar-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  padding: 8px 20px 4px;
  margin-top: 4px;
}

.sidebar .nav-link {
  color: var(--color-text-secondary);
  padding: 10px 20px;
  border-radius: 0;
  border-left: 3px solid transparent;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  transition: all 0.15s ease;
}

.sidebar .nav-link i {
  width: 18px;
  text-align: center;
  color: var(--color-text-muted);
  transition: color 0.15s;
}

.sidebar .nav-link:hover {
  background: rgba(30, 58, 95, 0.05);
  color: var(--color-primary);
}

.sidebar .nav-link:hover i {
  color: var(--color-primary);
}

.sidebar .nav-link.active {
  background: rgba(30, 58, 95, 0.08);
  color: var(--color-primary);
  border-left-color: var(--color-primary);
  font-weight: 600;
}

.sidebar .nav-link.active i {
  color: var(--color-primary);
}

/* ── 관리자 사이드바 (다크 테마) ───────────────────────────────── */
.admin-sidebar {
  width: var(--sidebar-admin-width);
  min-width: var(--sidebar-admin-width);
  background: var(--color-primary);
  height: calc(100vh - var(--header-height) - var(--footer-height));
  position: sticky;
  top: var(--header-height);
  overflow-y: auto;
  padding: 20px 0;
}

.admin-sidebar-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: rgba(255, 255, 255, 0.35);
  padding: 8px 20px 4px;
  margin-top: 8px;
}

.admin-sidebar-divider {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin: 8px 0;
}

.admin-sidebar .nav-link {
  color: rgba(255, 255, 255, 0.70);
  padding: 11px 20px;
  border-left: 3px solid transparent;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
  transition: all 0.15s ease;
}

.admin-sidebar .nav-link i {
  width: 18px;
  text-align: center;
}

.admin-sidebar .nav-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.90);
}

.admin-sidebar .nav-link.active {
  background: rgba(255, 255, 255, 0.12);
  color: white;
  border-left-color: var(--color-accent-light);
  font-weight: 600;
}

/* ── 푸터 ───────────────────────────────────────────────────────── */
.site-footer {
  height: var(--footer-height);
  background: var(--color-surface);
  border-top: 1px solid var(--color-border-light);
  display: flex;
  align-items: center;
  padding: 0 24px;
}

/* Bootstrap footer 오버라이드 */
footer.bg-light {
  background: var(--color-surface) !important;
  border-top: 1px solid var(--color-border-light);
  height: var(--footer-height);
}

/* ── 카드 시스템 ────────────────────────────────────────────────── */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

/* 강의 카드 */
.card-course {
  background: var(--color-surface);
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border-top: 3px solid var(--color-accent);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.card-course:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}

/* 통계 카드 */
.stat-card {
  background: var(--color-surface);
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
}

.stat-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: rgba(30, 58, 95, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-primary);
}

/* 글래스 카드 */
.glass-card {
  background: var(--color-surface-alpha);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.30);
  box-shadow: var(--shadow-lg);
}

/* ── 버튼 ────────────────────────────────────────────────────────── */
.btn-primary {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  border-radius: var(--radius-md);
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: background 0.2s, border-color 0.2s, transform 0.1s;
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--color-primary-mid);
  border-color: var(--color-primary-mid);
  transform: translateY(-1px);
}

.btn-outline-primary {
  color: var(--color-primary);
  border-color: var(--color-primary);
  border-radius: var(--radius-md);
  font-weight: 600;
}

.btn-outline-primary:hover {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn-accent {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: white;
  border-radius: var(--radius-md);
  font-weight: 600;
}

.btn-accent:hover {
  background: #00796B;
  border-color: #00796B;
  color: white;
}

/* ── 폼 입력 ─────────────────────────────────────────────────────── */
.form-control {
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--color-border);
  padding: 10px 14px;
  font-size: 0.95rem;
  color: var(--color-text-primary);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(0, 137, 123, 0.12);
}

.form-select {
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--color-border);
  color: var(--color-text-primary);
}

.form-select:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(0, 137, 123, 0.12);
}

.input-group-text {
  background: #F8FAFC;
  border: 1.5px solid var(--color-border);
  color: var(--color-primary);
}

/* ── 텍스트 유틸리티 ─────────────────────────────────────────────── */
.text-primary { color: var(--color-primary) !important; }
.text-accent { color: var(--color-accent) !important; }

/* ── 역할 배지 ───────────────────────────────────────────────────── */
.role-badge {
  border-radius: var(--radius-pill);
  font-size: 11px;
  padding: 3px 10px;
  font-weight: 600;
  display: inline-block;
}

.badge-role-admin { background-color: var(--color-danger); color: white; }
.badge-role-instructor { background-color: #E65100; color: white; }
.badge-role-doctor { background-color: #0277BD; color: white; }
.badge-role-user { background-color: var(--color-text-secondary); color: white; }

/* ── 히어로 섹션 (비로그인 홈) ──────────────────────────────────── */
.hero-section {
  background: linear-gradient(145deg, #1E3A5F 0%, #1A4A7A 50%, #0D3460 100%);
  padding: 80px 0;
  color: white;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  bottom: -80px; right: -80px;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
}

.hero-section::after {
  content: '';
  position: absolute;
  top: -40px; left: -40px;
  width: 250px; height: 250px;
  border-radius: 50%;
  background: rgba(77, 182, 172, 0.08);
}

/* ── 웰컴 배너 (로그인 후 홈) ───────────────────────────────────── */
.welcome-banner {
  background: linear-gradient(135deg, #1E3A5F 0%, #2A4F8F 60%, #1E4070 100%);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
  color: white;
}

.welcome-banner::after {
  content: '';
  position: absolute;
  right: -40px; top: -40px;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
}

/* ── 인증 레이아웃 (로그인/회원가입) ───────────────────────────── */
.auth-wrapper {
  display: flex;
  min-height: 100vh;
}

.auth-brand-panel {
  flex: 0 0 45%;
  background: linear-gradient(145deg, #1E3A5F 0%, #2E5C9E 50%, #1A4A6B 100%);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
}

.brand-deco-circle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.brand-deco-1 {
  width: 320px; height: 320px;
  bottom: -100px; right: -100px;
  background: rgba(255, 255, 255, 0.05);
}

.brand-deco-2 {
  width: 200px; height: 200px;
  top: -60px; left: -60px;
  background: rgba(255, 255, 255, 0.04);
}

.brand-deco-3 {
  width: 100px; height: 100px;
  top: 38%; right: 8%;
  background: rgba(77, 182, 172, 0.15);
}

.brand-content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 380px;
}

.brand-logo-icon {
  font-size: 2.5rem;
  color: var(--color-accent-light);
  margin-bottom: 12px;
}

.brand-logo-title {
  font-size: 2rem;
  font-weight: 700;
  color: white;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.brand-logo-subtitle {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 32px;
  line-height: 1.5;
}

.brand-feature-card {
  background: rgba(255, 255, 255, 0.10);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-feature-icon {
  color: var(--color-accent-light);
  font-size: 1.1rem;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

.brand-feature-text {
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.875rem;
  font-weight: 500;
}

.auth-form-panel {
  flex: 1;
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.auth-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: 40px;
  width: 100%;
  max-width: 460px;
}

.auth-card-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 4px;
}

.auth-card-subtitle {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  margin-bottom: 24px;
}

.btn-auth-primary {
  background: var(--color-primary);
  border: none;
  border-radius: var(--radius-md);
  padding: 12px;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: white;
  width: 100%;
  transition: background 0.2s, transform 0.1s;
}

.btn-auth-primary:hover {
  background: var(--color-primary-mid);
  color: white;
  transform: translateY(-1px);
}

.auth-link {
  color: var(--color-accent);
  font-weight: 600;
  text-decoration: none;
}

.auth-link:hover {
  color: var(--color-accent-light);
  text-decoration: underline;
}

/* 역할 선택 카드 (회원가입) */
.role-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.role-card {
  display: block;
  cursor: pointer;
}

.role-card input[type=radio] { display: none; }

.role-card-body {
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  text-align: center;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  transition: all 0.15s;
}

.role-card input[type=radio]:checked + .role-card-body {
  border-color: var(--color-accent);
  background: rgba(0, 137, 123, 0.06);
  color: var(--color-accent);
  font-weight: 600;
}

/* ── 강의 수강 레이아웃 ─────────────────────────────────────────── */
.course-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--color-bg);
}

.course-header-bar {
  height: 56px;
  background: var(--color-primary);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 2px 6px rgba(30, 58, 95, 0.20);
}

.course-header-back {
  color: rgba(255, 255, 255, 0.80);
  font-size: 0.875rem;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  padding: 5px 12px;
  text-decoration: none;
  transition: background 0.15s;
  white-space: nowrap;
}

.course-header-back:hover {
  background: rgba(255, 255, 255, 0.18);
  color: white;
}

.course-header-title {
  flex: 1;
  color: white;
  font-size: 0.975rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.course-progress-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.80);
  font-size: 0.8rem;
  flex-shrink: 0;
}

.course-progress-bar {
  width: 120px;
  height: 6px;
  background: rgba(255, 255, 255, 0.20);
  border-radius: 3px;
  overflow: hidden;
}

.course-progress-fill {
  height: 100%;
  background: var(--color-accent-light);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.course-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.course-main {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  height: calc(100vh - 56px);
}

.course-viewer-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  min-height: 380px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}

.course-tabs-nav {
  border-bottom: 2px solid var(--color-border-light);
  margin-bottom: 16px;
  display: flex;
  gap: 0;
}

.course-tab-btn {
  padding: 10px 20px;
  border: none;
  background: none;
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: all 0.15s;
}

.course-tab-btn:hover { color: var(--color-primary); }

.course-tab-btn.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  font-weight: 600;
}

.course-toc-panel {
  width: 360px;
  min-width: 320px;
  background: var(--color-surface);
  border-left: 1px solid var(--color-border-light);
  height: calc(100vh - 56px);
  overflow-y: auto;
  position: sticky;
  top: 56px;
  display: flex;
  flex-direction: column;
}

.course-toc-header {
  padding: 20px 20px 14px;
  border-bottom: 1px solid var(--color-border-light);
}

.course-toc-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-primary);
}

.toc-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 20px;
  border-left: 3px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
}

.toc-item:hover { background: rgba(30, 58, 95, 0.04); }

.toc-item.toc-active {
  background: rgba(0, 137, 123, 0.06);
  border-left-color: var(--color-accent);
}

.toc-item.toc-done { opacity: 0.65; }

.toc-icon { width: 20px; flex-shrink: 0; font-size: 0.8rem; margin-top: 2px; }
.toc-icon.done { color: var(--color-accent); }
.toc-icon.current { color: var(--color-primary); }
.toc-icon.pending { color: var(--color-text-muted); }

.toc-text { font-size: 0.875rem; color: var(--color-text-primary); line-height: 1.4; }

.course-note-area {
  padding: 16px 20px;
  border-top: 1px solid var(--color-border-light);
  margin-top: auto;
}

.course-note-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: 8px;
}

.note-textarea {
  width: 100%;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 10px;
  font-size: 0.85rem;
  resize: none;
  height: 100px;
  color: var(--color-text-primary);
  font-family: inherit;
}

.note-textarea:focus {
  border-color: var(--color-accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 137, 123, 0.10);
}

/* ── 시험 레이아웃 ───────────────────────────────────────────────── */
.exam-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--color-bg);
}

.exam-header {
  height: 64px;
  background: var(--color-primary);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(30, 58, 95, 0.22);
}

.exam-title {
  font-size: 1rem;
  font-weight: 700;
  color: white;
  flex: 0 0 auto;
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.exam-progress-dots {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
}

.exam-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  transition: background 0.2s;
  cursor: pointer;
}

.exam-dot.answered { background: var(--color-accent-light); }
.exam-dot.current {
  background: white;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.30);
}

.exam-timer {
  font-size: 1.05rem;
  font-weight: 700;
  color: white;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.exam-timer.warning { color: #FF6B6B; }

.exam-main {
  flex: 1;
  background: var(--color-bg);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 36px 28px;
  overflow-y: auto;
  min-height: calc(100vh - 64px - 60px);
}

.question-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 36px 44px;
  width: 100%;
  max-width: 860px;
}

.question-number {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-accent);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.question-progress {
  height: 4px;
  background: var(--color-border-light);
  border-radius: 2px;
  margin-bottom: 24px;
  overflow: hidden;
}

.question-progress-fill {
  height: 100%;
  background: var(--color-accent);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.question-text {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--color-text-primary);
  font-weight: 500;
  margin-bottom: 28px;
}

.exam-options { display: flex; flex-direction: column; gap: 10px; }

.option-item {
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all 0.15s ease;
  background: white;
  user-select: none;
}

.option-item:hover {
  border-color: var(--color-primary-mid);
  background: rgba(30, 58, 95, 0.03);
}

.option-item.selected {
  border-color: var(--color-primary);
  background: rgba(30, 58, 95, 0.06);
}

.option-marker {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
}

.option-item.selected .option-marker {
  border-color: var(--color-primary);
  background: var(--color-primary);
}

.option-item.selected .option-marker::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: white;
}

.option-text {
  font-size: 0.95rem;
  color: var(--color-text-primary);
  line-height: 1.5;
}

.exam-nav-bar {
  height: 60px;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border-light);
  box-shadow: 0 -2px 12px rgba(30, 58, 95, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  bottom: 0;
  z-index: 100;
}

.exam-nav-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  border: 1.5px solid var(--color-border);
  background: white;
  color: var(--color-primary);
  cursor: pointer;
  transition: all 0.15s;
}

.exam-nav-btn:hover { background: rgba(30, 58, 95, 0.06); }

.exam-jump-btns { display: flex; gap: 6px; overflow-x: auto; max-width: 60%; flex-shrink: 1; }

.exam-jump-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1.5px solid var(--color-border);
  background: white;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.exam-jump-btn.answered {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: white;
}

.exam-jump-btn.current {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
}

.btn-submit-exam {
  background: var(--color-primary);
  color: white;
  border: none;
  padding: 8px 24px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-submit-exam:hover { background: var(--color-primary-mid); }

/* 기존 호환 (exam-take) */
.question-card-legacy { border-left: 4px solid var(--color-primary); }
.option-label { cursor: pointer; transition: background 0.15s; width: 100%; display: block; padding: 0.5rem 1rem; }
.option-label:hover { background: rgba(30, 58, 95, 0.05); }
input[type=radio]:checked + .option-label { background: rgba(30, 58, 95, 0.08); font-weight: 600; color: var(--color-primary); }

/* ── 관리자 컨텐츠 스타일 ───────────────────────────────────────── */
.admin-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
}

.admin-page-breadcrumb {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}

.admin-page-title {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--color-primary);
  margin: 0;
}

.admin-filter-card {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 16px 20px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-table-card {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.admin-table-card .table { margin-bottom: 0; }

.admin-table-card thead th {
  background: #F0F4FA;
  color: var(--color-primary);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 2px solid var(--color-border);
  padding: 12px 16px;
  white-space: nowrap;
}

.admin-table-card tbody tr:hover { background: rgba(30, 58, 95, 0.025); }
.admin-table-card tbody td { padding: 12px 16px; vertical-align: middle; font-size: 0.9rem; }

.admin-action-btn {
  padding: 4px 12px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
  border-width: 1px;
  font-weight: 500;
}

/* ── 프로필 아바타 ───────────────────────────────────────────────── */
.avatar-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(30, 58, 95, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--color-primary);
  border: 3px solid var(--color-border-light);
}

/* ── 점수 원 (시험 결과) ─────────────────────────────────────────── */
.score-circle {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: rgba(30, 58, 95, 0.06);
  border: 5px solid var(--color-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

/* ── 강의 상세 헤더 (상세 페이지 top banner) ────────────────────── */
.course-header {
  background: linear-gradient(135deg, #1E3A5F 0%, #2A4F8F 60%, #1A3F75 100%);
  padding: 40px 0;
  color: white;
}

/* ── Samsung Galaxy Tab S9 최적화 (기준: 1280×800 가로 모드) ─────── */
/* viewport: width=1280, CSS픽셀 1280×800 고정 */

@media (min-width: 1024px) {
  /* 사이드바: 1024px 이상에서 항상 표시 (Bootstrap d-md-flex 보완) */
  .sidebar { display: flex !important; }
  .admin-sidebar { display: flex !important; }
}

/* 1280px 이상: Tab S9 landscape 기준 레이아웃 확정 */
@media (min-width: 1280px) {
  :root {
    --content-padding: 28px;
    --sidebar-width: 240px;
    --sidebar-admin-width: 260px;
  }
  /* 메인 레이아웃 컨텐츠 영역: 1280 - 240 - 56 = 984px */
  .sidebar ~ main,
  .admin-sidebar ~ main {
    max-width: calc(100vw - var(--sidebar-width));
  }
}

/* 1400px 이상 (Tab S9 Ultra 등): 사이드바 약간 확장 */
@media (min-width: 1400px) {
  :root {
    --sidebar-width: 260px;
  }
}

/* ── Bootstrap 오버라이드 ────────────────────────────────────────── */
.navbar-dark .navbar-nav .nav-link { color: rgba(255,255,255,0.85); }
.navbar-dark .navbar-brand { color: white; }
.dropdown-menu { border-radius: var(--radius-md); box-shadow: var(--shadow-lg); border: 1px solid var(--color-border-light); }
.dropdown-item:hover { background: rgba(30, 58, 95, 0.06); color: var(--color-primary); }
.alert { border-radius: var(--radius-sm); }
.badge { border-radius: var(--radius-pill); }
.progress { border-radius: var(--radius-pill); }
.progress-bar { background-color: var(--color-accent); }
.table-hover tbody tr:hover { background-color: rgba(30, 58, 95, 0.03); }
.page-link { color: var(--color-primary); }
.page-item.active .page-link { background-color: var(--color-primary); border-color: var(--color-primary); }

/* ── 관리자 사이드바 하위 메뉴 ────────────────────────────────────── */
.admin-sidebar .sub-nav-link {
  padding: 8px 20px 8px 14px;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.60);
  border-left: 2px solid transparent;
  gap: 8px;
}
.admin-sidebar .sub-nav-link:hover {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.85);
}
.admin-sidebar .sub-nav-link.active {
  color: var(--color-accent-light);
  border-left-color: var(--color-accent-light);
  background: rgba(255,255,255,0.06);
}
.admin-sidebar .nav-link .rotated {
  transform: rotate(-90deg);
}

/* ── 관리자 페이지 공통 ───────────────────────────────────────────── */
.admin-page-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-text-primary);
  margin: 0;
}
.admin-filter-card {
  background: white;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.admin-table-card {
  background: white;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.admin-table-card .table th {
  background: #f8fafc;
  color: var(--color-text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border-bottom: 2px solid var(--color-border);
  padding: 12px 16px;
}
.admin-table-card .table td {
  padding: 14px 16px;
  vertical-align: middle;
  border-bottom: 1px solid var(--color-border-light);
}
.admin-table-card .table tr:last-child td {
  border-bottom: none;
}
.admin-action-btn {
  height: 32px;
  padding: 0 14px;
  font-size: 0.8rem;
}
