/* =====================================================
   LMS Player - Game Changer 2026 Redesign
   ===================================================== */

/* ---------- CSS Variables ---------- */
:root {
  --lms-accent:         #6366f1;
  --lms-accent-hover:   #4f46e5;
  --lms-teal:           #06979d;
  --lms-gold:           #f9c32c;
  --lms-header-bg:      #0f172a;
  --lms-header-h:       58px;
  --lms-sidebar-bg:     #1e293b;
  --lms-sidebar-w:      320px;
  --lms-sidebar-text:   #cbd5e1;
  --lms-sidebar-muted:  #64748b;
  --lms-sidebar-hover:  rgba(99,102,241,0.12);
  --lms-sidebar-active-bg: rgba(99,102,241,0.18);
  --lms-sidebar-border: rgba(255,255,255,0.06);
  --lms-bg:             #0a0f1e;
  --lms-main-bg:        #f1f5f9;
  --lms-card-bg:        #ffffff;
  --lms-text:           #1e293b;
  --lms-text-muted:     #64748b;
  --lms-border:         #e2e8f0;
  --lms-success:        #22c55e;
  --lms-radius:         10px;
  --lms-radius-sm:      6px;
  --lms-shadow:         0 1px 3px rgba(0,0,0,.08), 0 4px 12px rgba(0,0,0,.06);
  --lms-transition:     0.25s ease;
}

[data-lms-dark="1"] {
  --lms-main-bg:  #0f172a;
  --lms-card-bg:  #1e293b;
  --lms-text:     #e2e8f0;
  --lms-text-muted: #94a3b8;
  --lms-border:   rgba(255,255,255,0.08);
  --lms-shadow:   0 1px 3px rgba(0,0,0,.3), 0 4px 12px rgba(0,0,0,.25);
}

/* ---------- Base Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  height: 100%;
  overflow: hidden;
}

body.lms-body {
  font-family: 'Inter', 'Lato', sans-serif;
  background: var(--lms-bg);
  color: var(--lms-text);
  margin: 0;
  padding: 0;
}

/* ---------- Header ---------- */
.lms-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--lms-header-h);
  background: var(--lms-header-bg);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  z-index: 1000;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.lms-header-logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  text-decoration: none;
}

.lms-header-logo img {
  height: 32px;
  width: auto;
  object-fit: contain;
}

.lms-header-divider {
  width: 1px;
  height: 24px;
  background: rgba(255,255,255,0.15);
  flex-shrink: 0;
}

.lms-course-name {
  flex: 1;
  min-width: 0;
  color: #e2e8f0;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lms-course-name a {
  color: inherit;
  text-decoration: none;
}

.lms-course-name a:hover { color: var(--lms-accent); }

.lms-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Progress pill in header */
.lms-progress-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 50px;
  padding: 4px 12px 4px 8px;
  cursor: default;
}

.lms-progress-pill .pill-bar {
  width: 60px;
  height: 4px;
  background: rgba(255,255,255,0.15);
  border-radius: 2px;
  overflow: hidden;
}

.lms-progress-pill .pill-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--lms-accent), var(--lms-teal));
  border-radius: 2px;
  transition: width 0.6s ease;
  width: 3%;
}

.lms-progress-pill .pill-label {
  font-size: 12px;
  font-weight: 700;
  color: #e2e8f0;
  white-space: nowrap;
}

/* Search in header */
.lms-search-wrap {
  position: relative;
}

.lms-search-wrap i {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  font-size: 12px;
  pointer-events: none;
}

#search {
  background: rgba(255,255,255,0.07) !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  border-radius: 50px !important;
  color: #e2e8f0 !important;
  font-size: 13px !important;
  padding: 6px 12px 6px 30px !important;
  width: 160px;
  transition: var(--lms-transition);
}

#search:focus {
  background: rgba(255,255,255,0.1) !important;
  border-color: var(--lms-accent) !important;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.2) !important;
  width: 200px;
  outline: none;
}

#search::placeholder { color: #475569 !important; }

/* Dark mode toggle */
.lms-dark-toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.lms-dark-toggle input { display: none; }

.lms-dark-toggle .lms-slider {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 50px;
  cursor: pointer;
  transition: var(--lms-transition);
  display: flex;
  align-items: center;
  padding: 0 3px;
}

.lms-dark-toggle .lms-slider::before {
  content: '☀️';
  font-size: 11px;
  width: 18px;
  height: 18px;
  background: #f9c32c;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s ease;
  flex-shrink: 0;
}

.lms-dark-toggle input:checked + .lms-slider {
  background: rgba(99,102,241,0.3);
  border-color: var(--lms-accent);
}

.lms-dark-toggle input:checked + .lms-slider::before {
  transform: translateX(20px);
  content: '🌙';
  background: var(--lms-accent);
}

/* Language dropdown */
.lms-lang-btn {
  background: rgba(255,255,255,0.07) !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  color: #e2e8f0 !important;
  font-size: 12px !important;
  padding: 4px 10px !important;
  border-radius: 6px !important;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.lms-lang-btn:hover {
  background: rgba(255,255,255,0.12) !important;
  border-color: rgba(255,255,255,0.2) !important;
}

/* Logout */
.lms-logout-btn {
  width: 34px;
  height: 34px;
  background: rgba(239,68,68,0.12);
  border: 1px solid rgba(239,68,68,0.25);
  border-radius: 8px;
  color: #f87171;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  text-decoration: none;
  transition: var(--lms-transition);
  flex-shrink: 0;
}

.lms-logout-btn:hover {
  background: rgba(239,68,68,0.25);
  color: #fca5a5;
  border-color: rgba(239,68,68,0.4);
}

/* Sidebar toggle button (mobile) */
.lms-sidebar-toggle {
  display: none;
  width: 34px;
  height: 34px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: #e2e8f0;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  flex-shrink: 0;
}

/* ---------- Main Wrapper ---------- */
.lms-wrapper {
  display: flex;
  height: 100vh;
  padding-top: var(--lms-header-h);
  overflow: hidden;
}

/* ---------- Sidebar ---------- */
.lms-sidebar {
  width: var(--lms-sidebar-w);
  min-width: var(--lms-sidebar-w);
  background: var(--lms-sidebar-bg);
  height: 100%;
  overflow-y: auto;
  overflow-x: visible;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--lms-sidebar-border);
  transition: transform 0.3s ease, width 0.3s ease;
  scrollbar-width: thin;
  scrollbar-color: rgba(99,102,241,0.4) transparent;
}

.lms-sidebar::-webkit-scrollbar { width: 4px; }
.lms-sidebar::-webkit-scrollbar-track { background: transparent; }
.lms-sidebar::-webkit-scrollbar-thumb {
  background: rgba(99,102,241,0.4);
  border-radius: 2px;
}

/* Sidebar collapsed state */
.lms-sidebar.collapsed {
  transform: translateX(-100%);
  width: 0;
  min-width: 0;
}

/* Sidebar header */
.lms-sidebar-head {
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--lms-sidebar-border);
  flex-shrink: 0;
}

.lms-sidebar-head-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--lms-sidebar-muted);
  margin-bottom: 10px;
}

/* Course progress in sidebar */
.lms-course-progress {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--lms-sidebar-border);
  border-radius: var(--lms-radius-sm);
  padding: 10px 12px;
}

.lms-course-progress .cp-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.lms-course-progress .cp-label {
  font-size: 12px;
  color: var(--lms-sidebar-text);
}

.lms-course-progress .cp-pct {
  font-size: 13px;
  font-weight: 700;
  color: var(--lms-accent);
}

.lms-progress-track {
  height: 5px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  overflow: hidden;
}

/* This IS the element JS updates */
.progress-bar-inner {
  height: 100%;
  background: linear-gradient(90deg, var(--lms-accent), var(--lms-teal));
  border-radius: 3px;
  width: 3%;
  transition: width 0.6s ease;
  display: block;
  position: relative;
}

/* Stats row */
.lms-sidebar-stats {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.lms-sidebar-stats .stat-chip {
  flex: 1;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--lms-sidebar-border);
  border-radius: var(--lms-radius-sm);
  padding: 6px 8px;
  text-align: center;
}

.lms-sidebar-stats .stat-chip .sv {
  font-size: 15px;
  font-weight: 700;
  color: var(--lms-sidebar-text);
  line-height: 1.2;
}

.lms-sidebar-stats .stat-chip .sl {
  font-size: 10px;
  color: var(--lms-sidebar-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ---------- Curriculum Accordion ---------- */
.lms-curriculum {
  flex: 1;
  padding: 8px 0;
  overflow-y: auto;
}

.sidebar-accordian .accordion-item {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--lms-sidebar-border);
}

.sidebar-accordian .accordion-item:last-child {
  border-bottom: none;
}

.sidebar-accordian .accordion-button {
  background: transparent !important;
  color: var(--lms-sidebar-text) !important;
  font-size: 13px !important;
  font-weight: 600;
  padding: 12px 16px !important;
  border-radius: 0 !important;
  border: none !important;
  box-shadow: none !important;
  gap: 8px;
}

.sidebar-accordian .accordion-button:hover {
  background: var(--lms-sidebar-hover) !important;
}

.sidebar-accordian .accordion-button:not(.collapsed) {
  color: #ffffff !important;
  background: rgba(99,102,241,0.15) !important;
  border-left: 3px solid var(--lms-accent) !important;
}

.sidebar-accordian .accordion-button::after {
  display: block !important;
  filter: invert(1);
  opacity: 0.5;
}

.sidebar-accordian .accordion-button:not(.collapsed)::after {
  opacity: 0.9;
}

.sidebar-accordian .accordion-collapse .checkbody {
  padding: 0;
  margin: 0;
}

/* Course list item */
.course-list-item {
  display: flex !important;
  align-items: flex-start;
  padding: 8px 16px 8px 12px !important;
  cursor: pointer;
  transition: background var(--lms-transition);
  border-left: 3px solid transparent;
  gap: 10px;
}

.course-list-item:hover {
  background: var(--lms-sidebar-hover) !important;
}

.course-list-item:hover .list-group-item {
  background: transparent !important;
}

.course-list-item.active-lesson {
  background: var(--lms-sidebar-active-bg) !important;
  border-left-color: var(--lms-accent) !important;
}

.course-list-item.active-lesson .list-group-item {
  background: transparent !important;
}

/* Checkbox */
.classleft {
  flex-shrink: 0;
  padding-top: 2px;
}

.videocheck {
  width: 16px !important;
  height: 16px !important;
  border-radius: 50% !important;
  border: 2px solid rgba(255,255,255,0.25) !important;
  background: transparent !important;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: var(--lms-transition);
  position: relative;
  margin: 0 !important;
}

.videocheck:checked {
  background: var(--lms-success) !important;
  border-color: var(--lms-success) !important;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round' d='M3 8l3.5 3.5L13 4'/%3e%3c/svg%3e") !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: 10px !important;
}

/* Lesson content right */
.contentright.playvideo {
  flex: 1;
  min-width: 0;
}

.chk {
  display: block !important;
}

.chk .list-group-item {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  color: var(--lms-sidebar-text);
  font-size: 13px;
  line-height: 1.4;
  white-space: normal;
}

.chk .list-group-item span { display: block; }

.chk .list-group-item .text-muted {
  color: var(--lms-sidebar-muted) !important;
  font-size: 11px;
  margin-top: 2px;
}

/* Duration badge */
.time-minutes {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}

.time-minutes .time {
  display: flex;
  align-items: center;
  gap: 3px;
}

.time-minutes .time i {
  font-size: 10px;
  color: var(--lms-sidebar-muted);
  width: auto;
  height: auto;
  border-radius: 0;
}

.time-minutes span {
  font-size: 11px !important;
  color: var(--lms-sidebar-muted);
}

/* Resources button */
.btn-group.vedio-detail {
  margin-top: 6px;
  position: relative;
}

.lms-res-toggle {
  font-size: 11px !important;
  padding: 3px 10px !important;
  border-radius: 4px !important;
  background: rgba(6,151,157,0.2) !important;
  border: 1px solid rgba(6,151,157,0.4) !important;
  color: #5eead4 !important;
}

.lms-res-toggle:hover {
  background: rgba(6,151,157,0.35) !important;
  color: #fff !important;
}

.lms-res-menu {
  position: absolute;
  left: 0;
  top: calc(100% + 4px);
  background: #1e293b;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  padding: 4px;
  min-width: 200px;
  z-index: 200;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  list-style: none;
  margin: 0;
}

.lms-res-menu .list-group-item {
  color: #cbd5e1 !important;
  background: transparent !important;
  font-size: 12px;
  padding: 7px 10px !important;
  border: none !important;
  cursor: pointer;
  border-radius: 4px;
  display: block;
  transition: background 0.15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lms-res-menu .list-group-item:hover {
  background: rgba(99,102,241,0.2) !important;
  color: #fff !important;
}

/* ---------- Main Content Area ---------- */
.lms-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: var(--lms-main-bg);
  transition: background var(--lms-transition);
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.15) transparent;
}

.lms-main::-webkit-scrollbar { width: 6px; }
.lms-main::-webkit-scrollbar-track { background: transparent; }
.lms-main::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.15);
  border-radius: 3px;
}

/* Video player container */
.lms-player-container {
  background: #000;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: calc(100vh - var(--lms-header-h) - 56px);
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}

#video_div {
  width: 100%;
  height: 100%;
}

#video_div iframe,
#video_div video {
  width: 100%;
  height: 100%;
  display: block;
  border: none;
}

/* Lesson meta bar */
.lms-lesson-meta {
  background: var(--lms-card-bg);
  border-bottom: 1px solid var(--lms-border);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.lms-lesson-title-area {
  flex: 1;
  min-width: 0;
}

.lms-lesson-title-area h5 {
  font-size: 15px;
  font-weight: 700;
  color: var(--lms-text);
  margin: 0 0 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lms-rating-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.lms-rating-row i {
  font-size: 12px;
  color: var(--lms-gold);
}

.lms-rating-row span {
  font-size: 12px;
  color: var(--lms-text-muted);
  margin-left: 4px;
}

/* Interactive rating - clickable stars */
.lms-rating-row.lms-rating-interactive .lms-rating-star {
  cursor: pointer;
  transition: color 0.15s ease, transform 0.15s ease;
}
.lms-rating-row.lms-rating-interactive .lms-rating-star:hover,
.lms-rating-row.lms-rating-interactive .lms-rating-star:focus {
  color: var(--lms-gold) !important;
  transform: scale(1.15);
  outline: none;
}
.lms-rating-row.lms-rating-interactive .lms-rating-star.fa-star-o {
  opacity: 0.5;
}
.lms-rating-row.lms-rating-interactive .lms-rating-star.fa-star-o:hover,
.lms-rating-row.lms-rating-interactive .lms-rating-star.fa-star-o:focus {
  opacity: 1;
}

.lms-share-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--lms-accent);
  border: 1.5px solid var(--lms-accent);
  border-radius: 50px;
  padding: 6px 16px;
  text-decoration: none;
  transition: var(--lms-transition);
  white-space: nowrap;
  flex-shrink: 0;
}

.lms-share-btn:hover {
  background: var(--lms-accent);
  color: #fff;
}

/* ---------- Content Tabs ---------- */
.lms-content-tabs {
  flex: 1;
  background: var(--lms-card-bg);
  margin: 0;
}

.lms-tabs-nav {
  display: flex;
  border-bottom: 2px solid var(--lms-border);
  padding: 0 20px;
  gap: 0;
}

.lms-tab-btn {
  font-size: 13px;
  font-weight: 600;
  color: var(--lms-text-muted);
  padding: 12px 16px;
  border: none;
  background: transparent;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: var(--lms-transition);
  white-space: nowrap;
}

.lms-tab-btn:hover { color: var(--lms-text); }

.lms-tab-btn.active {
  color: var(--lms-accent);
  border-bottom-color: var(--lms-accent);
}

.lms-tab-pane {
  display: none;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.lms-tab-pane.active { display: block; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.lms-tab-pane p {
  font-size: 14px;
  line-height: 1.75;
  color: var(--lms-text);
  margin: 0;
}

/* ---------- Footer ---------- */
.lms-footer {
  background: var(--lms-card-bg);
  border-top: 1px solid var(--lms-border);
  padding: 12px 20px;
  text-align: center;
  flex-shrink: 0;
}

.lms-footer p {
  font-size: 12px;
  color: var(--lms-text-muted);
  margin: 0;
}

/* ---------- Sidebar Collapse Toggle (desktop) ---------- */
.lms-collapse-btn {
  position: fixed;
  left: var(--lms-sidebar-w);
  top: 50%;
  transform: translateY(-50%) translateX(-50%);
  width: 24px;
  height: 48px;
  background: var(--lms-sidebar-bg);
  border: 1px solid var(--lms-sidebar-border);
  border-left: none;
  border-radius: 0 8px 8px 0;
  color: var(--lms-sidebar-text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 100;
  transition: left 0.3s ease, background 0.2s;
  font-size: 11px;
}

.lms-collapse-btn:hover {
  background: rgba(99,102,241,0.2);
  color: #fff;
}

.lms-collapse-btn.collapsed { left: 12px; }

/* ---------- Mobile Overlay ---------- */
.lms-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 90;
  backdrop-filter: blur(2px);
}

/* ---------- Responsive ---------- */
@media (max-width: 991px) {
  .lms-sidebar {
    position: fixed;
    top: var(--lms-header-h);
    left: 0;
    bottom: 0;
    z-index: 95;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    width: 300px !important;
    min-width: 300px !important;
  }

  .lms-sidebar.mobile-open {
    transform: translateX(0);
  }

  .lms-sidebar-overlay.active { display: block; }
  .lms-sidebar-toggle { display: flex; }
  .lms-collapse-btn { display: none; }
  .lms-course-name { display: none; }
  .lms-search-wrap { display: none; }

  .lms-wrapper {
    display: block;
    height: auto;
    overflow: auto;
  }

  .lms-main {
    height: calc(100vh - var(--lms-header-h));
    overflow-y: auto;
  }

  .lms-player-container {
    max-height: 56vw;
  }
}

@media (max-width: 575px) {
  .lms-header { padding: 0 10px; gap: 8px; }
  .lms-progress-pill { display: none; }
  .lms-player-container { max-height: 60vw; }
  .lms-lesson-meta { padding: 10px 14px; }
  .lms-lesson-meta h5 { font-size: 13px; }
  .lms-share-btn { display: none; }
}

/* ---------- Dark Mode Overrides ---------- */
[data-lms-dark="1"] .lms-main {
  background: var(--lms-main-bg);
}

[data-lms-dark="1"] .lms-lesson-meta,
[data-lms-dark="1"] .lms-content-tabs,
[data-lms-dark="1"] .lms-footer {
  background: var(--lms-card-bg);
  border-color: var(--lms-border);
}

[data-lms-dark="1"] .lms-tabs-nav {
  border-color: var(--lms-border);
}

[data-lms-dark="1"] .lms-lesson-title-area h5,
[data-lms-dark="1"] .lms-tab-pane p {
  color: var(--lms-text);
}

[data-lms-dark="1"] .lms-rating-row span,
[data-lms-dark="1"] .lms-footer p {
  color: var(--lms-text-muted);
}
