/* ==========================================================================
   EduVerse LMS - Interactive E-Learning Platform CSS
   Design: Modern SaaS / LMS Dashboard with Video Player & Quiz Engine
   ========================================================================== */

:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eeefff;
  --primary-glow: rgba(79, 70, 229, 0.25);
  
  --cyan: #06b6d4;
  --cyan-light: #e0f2fe;
  --emerald: #10b981;
  --emerald-light: #d1fae5;
  --amber: #f59e0b;
  --amber-light: #fef3c7;
  --rose: #f43f5e;
  --rose-light: #ffe4e6;

  --bg-app: #f8fafc;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'Fira Code', monospace;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 14px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 12px 28px rgba(15, 23, 42, 0.1);
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
}

/* Dark Mode Support */
body.dark-mode {
  --bg-app: #0b0f19;
  --bg-card: #161e2e;
  --bg-subtle: #1e293b;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border-color: #334155;
  --primary-light: rgba(79, 70, 229, 0.2);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
}

/* Main Layout Wrapper */
.lms-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar Navigation */
.lms-sidebar {
  width: 260px;
  background: var(--bg-card);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  z-index: 100;
  transition: all 0.3s ease;
}

.sidebar-header {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-color);
}

.brand-logo {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
  color: #ffffff;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.2rem;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.brand-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.sidebar-menu {
  padding: 20px 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.menu-label {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.8px;
  padding: 8px 12px 4px 12px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}

.menu-item:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
}

.menu-item.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
}

.menu-icon {
  font-size: 1.2rem;
}

/* Main Content Area */
.lms-main {
  flex: 1;
  margin-left: 260px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Top Navbar */
.lms-navbar {
  height: 70px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
}

.search-box {
  position: relative;
  width: 340px;
}

.search-input {
  width: 100%;
  padding: 9px 16px 9px 40px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: var(--bg-subtle);
  color: var(--text-main);
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.search-input:focus {
  border-color: var(--primary);
  background: var(--bg-card);
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.9rem;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.badge-streak {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fef3c7;
  color: #b45309;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
}

.badge-xp {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #e0e7ff;
  color: #4338ca;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
}

.user-profile-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.user-avatar-img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary);
}

/* Page Workspace */
.page-container {
  padding: 28px 32px 48px 32px;
}

.tab-panel {
  display: none;
  animation: fadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.tab-panel.active {
  display: block;
}

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

/* Hero Banner Card */
.hero-banner {
  background: linear-gradient(135deg, #1e1b4b 0%, #4338ca 50%, #0284c7 100%);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 36px 40px;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.hero-banner::after {
  content: '';
  position: absolute;
  right: -40px;
  bottom: -40px;
  width: 220px;
  height: 220px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  pointer-events: none;
}

.banner-pill {
  display: inline-block;
  background: rgba(255, 255, 255, 0.2);
  padding: 4px 14px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.banner-title {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.banner-desc {
  font-size: 0.95rem;
  opacity: 0.9;
  max-width: 620px;
  margin-bottom: 20px;
}

/* Metric Cards */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.m-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.m-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 12px;
}

.m-value {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 2px;
}

.m-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Course Grid */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.section-title {
  font-size: 1.2rem;
  font-weight: 800;
}

.course-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-bottom: 32px;
}

.course-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
}

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

.course-thumb {
  width: 100%;
  height: 160px;
  object-fit: cover;
  position: relative;
}

.course-body {
  padding: 18px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.course-category {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--primary);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.course-name {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.3;
}

.course-instructor {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.progress-bar-bg {
  width: 100%;
  height: 6px;
  background: var(--bg-subtle);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
}

.course-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

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

/* Interactive Video Player Component */
.video-player-container {
  background: #000000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  position: relative;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-screen {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  position: relative;
}

.video-play-btn {
  width: 68px;
  height: 68px;
  background: var(--primary);
  border: none;
  border-radius: 50%;
  color: #ffffff;
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 0 24px rgba(79, 70, 229, 0.6);
  transition: transform 0.2s ease;
}

.video-play-btn:hover {
  transform: scale(1.1);
}

.video-controls {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 14px 20px;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
  display: flex;
  align-items: center;
  gap: 14px;
  color: #ffffff;
}

.video-scrubber {
  flex: 1;
  height: 5px;
  background: rgba(255,255,255,0.3);
  border-radius: 3px;
  position: relative;
  cursor: pointer;
}

.scrubber-fill {
  width: 45%;
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
}

/* Quiz Engine Component */
.quiz-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-md);
}

.quiz-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.quiz-question-title {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 16px;
}

.quiz-options-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.quiz-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 600;
}

.quiz-option:hover {
  border-color: var(--primary);
  background: var(--bg-subtle);
}

.quiz-option.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

.quiz-option.correct {
  border-color: var(--emerald);
  background: var(--emerald-light);
  color: #047857;
}

.quiz-option.wrong {
  border-color: var(--rose);
  background: var(--rose-light);
  color: #be123c;
}

.option-letter {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
}

/* Leaderboard Ranking Table */
.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
}

.leaderboard-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
}

.leaderboard-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
}

.rank-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
}

.rank-1 { background: #fef3c7; color: #b45309; }
.rank-2 { background: #e2e8f0; color: #475569; }
.rank-3 { background: #ffedd5; color: #c2410c; }

@media (max-width: 900px) {
  .lms-sidebar { width: 80px; }
  .lms-sidebar .brand-title, .lms-sidebar .brand-subtitle, .lms-sidebar .menu-text, .lms-sidebar .menu-label { display: none; }
  .lms-main { margin-left: 80px; }
  .course-grid, .metrics-grid { grid-template-columns: 1fr; }
}
