@font-face {
  font-family: 'SVN-Poppins';
  src: url('/assets/fonts/SVN-Poppins.woff2') format('woff2'),
       url('/assets/fonts/SVN-Poppins.woff') format('woff');
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: 'SVN-Poppins';
  src: url('/assets/fonts/SVN-PoppinsMedium.woff2') format('woff2'),
       url('/assets/fonts/SVN-PoppinsMedium.woff') format('woff');
  font-weight: 500;
  font-style: normal;
}
@font-face {
  font-family: 'SVN-Poppins';
  src: url('/assets/fonts/SVN-PoppinsSemiBold.woff2') format('woff2'),
       url('/assets/fonts/SVN-PoppinsSemiBold.woff') format('woff');
  font-weight: 600;
  font-style: normal;
}
@font-face {
  font-family: 'SVN-Poppins';
  src: url('/assets/fonts/SVN-PoppinsBold.woff2') format('woff2'),
       url('/assets/fonts/SVN-PoppinsBold.woff') format('woff');
  font-weight: 700;
  font-style: normal;
}

:root {
  --brand: #10b981;
  --brand-dark: #059669;
  --brand-soft: rgba(16, 185, 129, 0.14);
  --gold: #ffcc00;
  --bg-dark: #0b1120;
  --bg-panel: #111827;
  --bg-card: #1e293b;
  --border: rgba(148, 163, 184, 0.16);
  --text: #f8fafc;
  --text-muted: #94a3b8;
}

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

body {
  font-family: 'SVN-Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-dark);
  background-image:
    radial-gradient(circle at 12% 15%, rgba(16, 185, 129, 0.14), transparent 36%),
    radial-gradient(circle at 88% 80%, rgba(255, 204, 0, 0.08), transparent 40%),
    url('/assets/bg_kh.webp');
  background-size: cover;
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.lms-header {
  height: 70px;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-badge {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  color: #fff;
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.32);
}

.brand-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: #fff;
}

.brand-sub {
  font-size: 12px;
  color: var(--brand);
  font-weight: 500;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.student-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid var(--border);
  font-size: 13px;
}

.student-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 8px var(--brand);
}

.student-dot.dot-guest {
  background: #f59e0b;
  box-shadow: 0 0 8px #f59e0b;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 9px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-outline {
  background: rgba(30, 41, 59, 0.75);
  color: #e2e8f0;
  border-color: var(--border);
}
.btn-outline:hover:not(:disabled) {
  border-color: var(--brand);
  color: #fff;
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.45);
}

.btn-gold {
  background: var(--gold);
  color: #1e293b;
  font-weight: 700;
}
.btn-gold:hover:not(:disabled) {
  background: #f5bc00;
  transform: translateY(-1px);
}

/* Main workspace layout */
.lms-workspace {
  display: grid;
  grid-template-columns: 340px 1fr 370px;
  gap: 18px;
  padding: 18px 24px;
  flex: 1;
  max-width: 1780px;
  width: 100%;
  margin: 0 auto;
}

.panel {
  background: rgba(17, 24, 39, 0.9);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-header {
  padding: 15px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-title {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #e2e8f0;
}

/* Filter tabs */
.course-filter-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 10px 14px 0;
}

.filter-tab {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.65);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}

.filter-tab:hover {
  color: #fff;
  border-color: rgba(16, 185, 129, 0.35);
}

.filter-tab.active {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border-color: var(--brand);
}

/* Course Sidebar (25 courses) */
.course-search-wrap {
  padding: 10px 14px 12px;
  border-bottom: 1px solid var(--border);
}

.course-search {
  width: 100%;
  padding: 9px 12px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.8);
  color: #fff;
  font-family: inherit;
  font-size: 12.5px;
  outline: none;
}
.course-search:focus {
  border-color: var(--brand);
}

.course-list {
  overflow-y: auto;
  max-height: calc(100vh - 245px);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.empty-course-state {
  padding: 24px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

.course-item {
  padding: 12px;
  border-radius: 11px;
  background: rgba(30, 41, 59, 0.55);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.18s ease;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.course-item:hover {
  background: rgba(30, 41, 59, 0.95);
  border-color: rgba(16, 185, 129, 0.35);
}

.course-item.is-unlocked {
  border-color: rgba(16, 185, 129, 0.22);
}

.course-item.active {
  background: rgba(16, 185, 129, 0.16);
  border-color: var(--brand);
}

.course-num {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
  color: var(--brand);
}

.course-item.active .course-num {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.course-info {
  flex: 1;
  min-width: 0;
}

.course-cat-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
}

.course-sku-label {
  font-size: 10px;
  font-weight: 700;
  color: #34d399;
  background: rgba(16, 185, 129, 0.14);
  padding: 1px 6px;
  border-radius: 4px;
}

.course-cat-label {
  font-size: 10.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.course-name {
  font-size: 13px;
  font-weight: 600;
  color: #f1f5f9;
  line-height: 1.4;
  margin-bottom: 6px;
}

.course-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
}

.badge-status {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
}
.badge-unlocked {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}
.badge-pending {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}
.badge-locked {
  background: rgba(148, 163, 184, 0.14);
  color: #94a3b8;
}

/* Center Cinema Player */
.player-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.video-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.55);
}

.video-stage video {
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
}

/* Dynamic Anti-Piracy Watermark Overlay */
.watermark-overlay {
  position: absolute;
  pointer-events: none;
  z-index: 25;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.28);
  color: rgba(255, 255, 255, 0.36);
  font-size: 12px;
  font-weight: 600;
  user-select: none;
  transition: top 1.5s ease, left 1.5s ease;
  top: 12%;
  left: 8%;
}

/* Locked Overlay */
.locked-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.94) 0%, rgba(11, 17, 32, 0.98) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px;
  z-index: 30;
}

.lock-icon-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255, 204, 0, 0.14);
  border: 2px solid rgba(255, 204, 0, 0.4);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin-bottom: 14px;
}

.locked-sku-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: #34d399;
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 10px;
}

.locked-title {
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 10px;
  color: #fff;
  max-width: 640px;
  line-height: 1.4;
}

.locked-desc {
  max-width: 580px;
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 22px;
}

.locked-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

/* Video details bar */
.video-meta-card {
  padding: 18px 22px;
  background: rgba(17, 24, 39, 0.9);
  border: 1px solid var(--border);
  border-radius: 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.video-meta-info {
  flex: 1;
  min-width: 280px;
}

.current-course-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: var(--brand);
  margin-bottom: 5px;
}

.current-lesson-title {
  font-size: 16.5px;
  font-weight: 700;
  color: #fff;
  line-height: 1.4;
  margin-bottom: 4px;
}

.current-course-subtitle {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.5;
}

.player-controls-bar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.speed-select {
  background: rgba(30, 41, 59, 0.9);
  color: #fff;
  border: 1px solid var(--border);
  padding: 8px 12px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
}

/* Right Column: Lesson Playlist */
.lesson-list {
  overflow-y: auto;
  max-height: calc(100vh - 220px);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lesson-card {
  padding: 12px 14px;
  border-radius: 11px;
  background: rgba(30, 41, 59, 0.55);
  border: 1px solid transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.18s ease;
}

.lesson-card:hover {
  background: rgba(30, 41, 59, 0.95);
  border-color: rgba(16, 185, 129, 0.35);
}

.lesson-card.active {
  background: rgba(16, 185, 129, 0.18);
  border-color: var(--brand);
}

.lesson-card.is-locked {
  opacity: 0.82;
}

.lesson-status-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  color: #cbd5e1;
}

.lesson-card.active .lesson-status-icon {
  background: var(--brand);
  color: #fff;
}

.lesson-card.completed .lesson-status-icon {
  background: rgba(16, 185, 129, 0.25);
  color: #34d399;
}

.lesson-card-body {
  flex: 1;
  min-width: 0;
}

.lesson-card-title {
  font-size: 13px;
  font-weight: 600;
  color: #f1f5f9;
  margin-bottom: 3px;
  line-height: 1.4;
}

.lesson-card-sub {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.security-banner {
  margin: 0 12px 12px;
  padding: 12px;
  border-radius: 10px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px dashed rgba(16, 185, 129, 0.35);
  font-size: 11.5px;
  color: #a7f3d0;
  line-height: 1.5;
}

@media (max-width: 1200px) {
  .lms-workspace {
    grid-template-columns: 1fr;
  }
  .course-list, .lesson-list {
    max-height: 360px;
  }
}
