:root {
  --brand-dark: #0f172a;
  --brand-accent: #f5a623;
}

body {
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  background-color: #f7f8fa;
}

/* Navbar */
.main-navbar {
  background-color: var(--brand-dark);
}
.main-navbar .nav-link {
  color: #e2e8f0;
}
.main-navbar .nav-link:hover {
  color: var(--brand-accent);
}

/* Footer */
.main-footer {
  background-color: var(--brand-dark);
  color: #e2e8f0;
}
.main-footer a {
  color: #cbd5e1;
  text-decoration: none;
}
.main-footer a:hover {
  color: var(--brand-accent);
}

/* Hero */
.hero-section {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

/* Category tiles */
.category-tile {
  display: block;
  background: #fff;
  border-radius: 10px;
  padding: 1rem;
  text-align: center;
  text-decoration: none;
  color: #0f172a;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  transition: transform 0.15s ease;
}
.category-tile:hover {
  transform: translateY(-3px);
  color: var(--brand-accent);
}

/* Course card */
.course-card {
  position: relative;
  border: none;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.course-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}
.course-card .card-img-top {
  height: 150px;
  object-fit: cover;
}
.course-card .card-title a {
  color: #0f172a;
  text-decoration: none;
}
.course-card .card-title a:hover {
  color: var(--brand-accent);
}
.badge-level {
  background-color: #e2e8f0;
  color: #0f172a;
  font-weight: 500;
}
.wishlist-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
}
.wishlist-btn.active,
.wishlist-btn:hover {
  color: #e11d48;
}

.filter-bar {
  background: #fff;
  padding: 1rem;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

/* Course detail */
.course-detail-hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}
.purchase-sidebar-sticky {
  position: sticky;
  top: 90px;
}
.course-detail-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.7rem 0;
  border-bottom: 1px solid #e5e7eb;
  color: #475569;
}
.course-detail-info-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.course-detail-info-row i {
  color: #6366f1;
  margin-right: 0.4rem;
}

/* Status badges */
.status-badge.status-pending {
  background-color: #f59e0b;
}
.status-badge.status-confirmed {
  background-color: #16a34a;
}
.status-badge.status-cancelled {
  background-color: #dc2626;
}

.video-embed {
  border-radius: 6px;
  overflow: hidden;
}

/* Lesson page */
.lesson-type-label {
  font-size: 0.8rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.35rem;
}
.lesson-sidebar-card {
  position: sticky;
  top: 80px;
}
.lesson-sidebar {
  max-height: calc(100vh - 160px);
  overflow-y: auto;
}
.lesson-sidebar-section + .lesson-sidebar-section {
  border-top: 1px solid #e5e7eb;
}
.lesson-sidebar-section-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  background: #f8fafc;
  border: none;
  padding: 0.7rem 1rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: #1e293b;
  text-align: left;
}
.lesson-sidebar-section-header:hover {
  background: #f1f5f9;
}
.lesson-sidebar-section-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  color: #94a3b8;
}
.lesson-sidebar-progress {
  font-size: 0.75rem;
  font-weight: 600;
}
.lesson-sidebar-section-header i.bi-chevron-down {
  transition: transform 0.15s ease;
}
.lesson-sidebar-section-header[aria-expanded="true"] i.bi-chevron-down {
  transform: rotate(180deg);
}
.lesson-sidebar-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.6rem 1rem;
  border-left: 3px solid transparent;
  text-decoration: none;
  color: #334155;
  border-top: 1px solid #f1f5f9;
}
.lesson-sidebar-item:hover {
  background: #f8fafc;
}
.lesson-sidebar-item.active {
  background: #fff7ed;
  border-left-color: var(--brand-accent);
}
.lesson-sidebar-item-check {
  color: #cbd5e1;
  padding-top: 0.15rem;
  flex-shrink: 0;
}
.lesson-sidebar-item.active .lesson-sidebar-item-check {
  color: var(--brand-accent);
}
.lesson-sidebar-item-check .bi-check-circle-fill {
  color: #16a34a;
}
.lesson-sidebar-item-body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.lesson-sidebar-item-title {
  font-size: 0.85rem;
  font-weight: 600;
}
.lesson-sidebar-item.active .lesson-sidebar-item-title {
  color: var(--brand-accent);
}
.lesson-sidebar-item-meta {
  font-size: 0.75rem;
  color: #94a3b8;
}

/* Admin layout */
.admin-layout {
  display: flex;
  min-height: 100vh;
}
.admin-sidebar {
  width: 240px;
  background: var(--brand-dark);
  color: #e2e8f0;
  padding: 1.5rem 1rem;
  flex-shrink: 0;
}
.admin-brand {
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: #fff;
}
.admin-sidebar .nav-link {
  color: #cbd5e1;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
}
.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
  background: rgba(245, 166, 35, 0.15);
  color: var(--brand-accent);
}
.admin-content {
  flex: 1;
  padding: 2rem;
}
.stat-card {
  border: none;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

/* Nội dung bài giảng dạng Markdown */
.lesson-content h1,
.lesson-content h2,
.lesson-content h3,
.lesson-content h4 {
  font-weight: 700;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}
.lesson-content h1:first-child,
.lesson-content h2:first-child,
.lesson-content h3:first-child {
  margin-top: 0;
}
.lesson-content p {
  line-height: 1.7;
}
.lesson-content ul,
.lesson-content ol {
  padding-left: 1.5rem;
  line-height: 1.7;
}
.lesson-content code:not(.hljs code) {
  background: #f1f5f9;
  color: #db2777;
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
}
.lesson-content blockquote {
  border-left: 4px solid var(--brand-accent);
  padding: 0.5rem 1rem;
  color: #475569;
  background: #f8fafc;
  border-radius: 0 6px 6px 0;
}
.lesson-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}
.lesson-content th,
.lesson-content td {
  border: 1px solid #e2e8f0;
  padding: 0.5rem 0.75rem;
  text-align: left;
  vertical-align: top;
}
.lesson-content th {
  background: #f8fafc;
  font-weight: 600;
}
.lesson-content table > tbody > tr:nth-child(even) {
  background: #fafafa;
}

/* Khối code có đánh số dòng */
.code-block {
  position: relative;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1rem 1rem 1rem 0;
  margin: 1rem 0;
  overflow-x: auto;
  background: #f8fafc !important;
  counter-reset: code-line;
}
.code-block[data-lang]::after {
  content: attr(data-lang);
  position: absolute;
  top: 0.4rem;
  right: 0.75rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #94a3b8;
}
.code-block code {
  display: block;
  font-family: "Consolas", "SFMono-Regular", Menlo, monospace;
  font-size: 0.9rem;
}
.code-line {
  display: block;
  padding-left: 3em;
  position: relative;
  white-space: pre;
}
.code-line::before {
  counter-increment: code-line;
  content: counter(code-line) ".";
  position: absolute;
  left: 0;
  width: 2.3em;
  text-align: right;
  padding-right: 0.7em;
  color: #94a3b8;
  user-select: none;
}

/* Nội dung khóa học: accordion Phần học -> Bài giảng */
.curriculum-section {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin-bottom: 0.75rem;
  overflow: hidden;
}
.curriculum-section-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  background: #eef2ff;
  color: #4338ca;
  border: none;
  padding: 0.85rem 1.25rem;
  font-weight: 600;
  text-align: left;
}
.curriculum-section-header:hover {
  background: #e0e7ff;
}
.curriculum-section-header i {
  transition: transform 0.15s ease;
}
.curriculum-section-header[aria-expanded="false"] i {
  transform: rotate(180deg);
}
.curriculum-lesson {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 1.25rem;
  border-top: 1px solid #f1f5f9;
}

/* Admin: header phần học (tiêu đề + nút sửa/xóa/thu gọn nằm chung 1 hàng) */
.admin-section-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.admin-section-title-btn {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  border: none;
  text-align: left;
  padding: 0;
  font-weight: 600;
  min-width: 0;
}
.admin-section-actions {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  flex-shrink: 0;
}
.admin-section-icon-btn {
  color: #64748b;
  padding: 0.25rem 0.5rem;
  line-height: 1;
  border: none;
  background: transparent;
}
.admin-section-icon-btn:hover {
  color: #0f172a;
  background: #f1f5f9;
  border-radius: 6px;
}
.admin-section-chevron i {
  transition: transform 0.15s ease;
}
.admin-section-chevron[aria-expanded="false"] i {
  transform: rotate(180deg);
}

/* Tab Trực quan / Văn bản cho trình soạn thảo nội dung bài giảng (kiểu WordPress) */
.editor-tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: -1px;
  position: relative;
  z-index: 1;
}
.editor-tab {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-bottom: none;
  padding: 0.35rem 0.9rem;
  font-size: 0.85rem;
  border-radius: 6px 6px 0 0;
  color: #475569;
}
.editor-tab:hover {
  color: #0f172a;
}
.editor-tab.active {
  background: #fff;
  color: #0f172a;
  font-weight: 600;
  border-color: #cbd5e1;
}
.curriculum-lesson-icon {
  color: #94a3b8;
  flex-shrink: 0;
}
.curriculum-lesson-title {
  flex: 1;
}
.curriculum-lesson-duration {
  color: #94a3b8;
  font-size: 0.85rem;
}
.curriculum-lesson-action {
  color: var(--brand-accent);
  font-size: 1.1rem;
}
.curriculum-lock {
  color: #cbd5e1;
  font-size: 1.05rem;
}
