/* =========================================
   THIQLA LMS – MAIN STYLESHEET
   Corporate Modern & Clean Theme
   Deep Blue + Teal/Emerald Palette
   ========================================= */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* --- CSS Variables --- */
:root {
  --primary: #1A3C6E;
  --primary-light: #2557A7;
  --primary-dark: #0F2445;
  --secondary: #00A98F;
  --secondary-light: #00C4A7;
  --secondary-dark: #007F6C;
  --accent: #F59E0B;
  --accent-light: #FCD34D;

  --bg-main: #F0F4F8;
  --bg-card: #FFFFFF;
  --bg-sidebar: #0F2445;
  --bg-sidebar-hover: #1A3C6E;
  --bg-topbar: #FFFFFF;

  --text-primary: #1A202C;
  --text-secondary: #4A5568;
  --text-muted: #718096;
  --text-sidebar: #A0AEC0;
  --text-sidebar-active: #FFFFFF;

  --border: #E2E8F0;
  --border-light: #EDF2F7;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.1), 0 4px 10px rgba(0,0,0,0.06);
  --shadow-xl: 0 20px 50px rgba(0,0,0,0.12);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --sidebar-width: 260px;
  --sidebar-collapsed: 70px;
  --topbar-height: 70px;

  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);

  --gradient-primary: linear-gradient(135deg, #1A3C6E 0%, #2557A7 100%);
  --gradient-secondary: linear-gradient(135deg, #00A98F 0%, #00C4A7 100%);
  --gradient-accent: linear-gradient(135deg, #F59E0B 0%, #FCD34D 100%);
  --gradient-hero: linear-gradient(135deg, #1A3C6E 0%, #2557A7 50%, #00A98F 100%);
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 15px; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.6;
  /* overflow-x: hidden removed — allow horizontal scroll when needed */
}

/* Prevent horizontal overflow at app level, not body */
.app-layout {
  min-width: 0;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; outline: none; font-family: inherit; }
input, select, textarea { font-family: inherit; outline: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* =========================================
   LAYOUT
   ========================================= */
.app-layout {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* =========================================
   SIDEBAR
   ========================================= */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transition: var(--transition-slow);
  overflow: hidden;
  box-shadow: 4px 0 20px rgba(0,0,0,0.15);
}

.sidebar.collapsed { width: var(--sidebar-collapsed); }

/* Sidebar Logo */
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  min-height: var(--topbar-height);
}

.logo-icon {
  width: 38px; height: 38px;
  background: transparent;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 18px; font-weight: 800; color: white;
  box-shadow: none;
}

.logo-text {
  display: flex; flex-direction: column;
  transition: var(--transition);
}
.logo-text .brand { font-size: 1rem; font-weight: 700; color: white; line-height: 1.2; }
.logo-text .tagline { font-size: 0.68rem; color: var(--text-sidebar); font-weight: 400; }

/* Sidebar Profile */
.sidebar-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  margin: 12px 12px 0;
  background: rgba(255,255,255,0.05);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255,255,255,0.08);
  cursor: pointer;
  transition: var(--transition);
  overflow: hidden;
}
.sidebar-profile:hover { background: rgba(255,255,255,0.1); }

.profile-avatar {
  width: 38px; height: 38px;
  border-radius: var(--radius-full);
  background: var(--gradient-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem; font-weight: 700; color: white;
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.2);
  overflow: hidden;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-info { flex: 1; min-width: 0; }
.profile-name { font-size: 0.82rem; font-weight: 600; color: white; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-role { font-size: 0.7rem; color: var(--text-sidebar); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-badge {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--secondary-light);
  flex-shrink: 0;
  box-shadow: 0 0 6px rgba(0,196,167,0.6);
}

/* Sidebar Navigation */
.sidebar-nav {
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.nav-section-label {
  font-size: 0.65rem;
  font-weight: 600;
  color: rgba(160,174,192,0.5);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 16px 20px 6px;
  white-space: nowrap;
  transition: var(--transition);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 20px;
  margin: 2px 8px;
  border-radius: var(--radius-sm);
  color: var(--text-sidebar);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.nav-item::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 0;
  background: var(--secondary-light);
  border-radius: 0 2px 2px 0;
  transition: var(--transition);
}

.nav-item:hover {
  background: rgba(255,255,255,0.07);
  color: white;
}
.nav-item.active {
  background: rgba(42,87,167,0.5);
  color: white;
  font-weight: 600;
}
.nav-item.active::before { height: 60%; }

.nav-icon {
  width: 20px; height: 20px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
}

.nav-badge {
  margin-left: auto;
  background: var(--secondary);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid rgba(255,255,255,0.07);
}

.sidebar-toggle {
  width: 100%;
  display: flex; align-items: center; justify-content: center;
  gap: 10px;
  padding: 10px;
  background: rgba(255,255,255,0.05);
  border-radius: var(--radius-sm);
  color: var(--text-sidebar);
  font-size: 0.8rem;
  transition: var(--transition);
  cursor: pointer;
}
.sidebar-toggle:hover { background: rgba(255,255,255,0.1); color: white; }

/* =========================================
   MAIN CONTENT
   ========================================= */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
  overflow-x: hidden;
  transition: var(--transition-slow);
}
.main-content.expanded { margin-left: var(--sidebar-collapsed); }

/* =========================================
   TOPBAR
   ========================================= */
.topbar {
  height: var(--topbar-height);
  background: var(--bg-topbar);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 20px;
  position: sticky;
  top: 0; z-index: 900;
  box-shadow: var(--shadow-sm);
}

.topbar-left {
  display: flex; align-items: center; gap: 16px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.mobile-menu-btn {
  display: none;
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  background: transparent;
  align-items: center; justify-content: center;
  font-size: 1.1rem; color: var(--text-secondary);
  transition: var(--transition);
}
.mobile-menu-btn:hover { background: var(--bg-main); color: var(--primary); }

.page-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

.search-wrapper {
  flex: 1;
  max-width: 420px;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 9px 16px 9px 42px;
  background: var(--bg-main);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  color: var(--text-primary);
  transition: var(--transition);
}
.search-input:focus {
  border-color: var(--primary-light);
  background: white;
  box-shadow: 0 0 0 3px rgba(42,87,167,0.1);
}
.search-icon {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.9rem;
  pointer-events: none;
}

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

.topbar-btn {
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; color: var(--text-secondary);
  position: relative;
  transition: var(--transition);
}
.topbar-btn:hover { background: var(--bg-main); color: var(--primary); }

.notif-dot {
  position: absolute;
  top: 7px; right: 7px;
  width: 8px; height: 8px;
  background: #EF4444;
  border-radius: 50%;
  border: 2px solid white;
}

.lang-selector {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 12px;
  background: var(--bg-main);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}
.lang-selector:hover { border-color: var(--primary-light); color: var(--primary); }

/* =========================================
   PAGE CONTAINER
   ========================================= */
.page-container {
  flex: 1;
  padding: 28px;
  display: none;
  animation: fadeInUp 0.35s ease;
  width: 100%;
  min-width: 0;
  overflow-x: hidden;
}
.page-container.active { display: block; }

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

/* =========================================
   UTILITY CLASSES
   ========================================= */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}
.section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex; align-items: center; gap: 8px;
}
.section-title span { font-size: 1.1rem; }
.section-link {
  font-size: 0.82rem;
  color: var(--primary-light);
  font-weight: 600;
  display: flex; align-items: center; gap: 4px;
  transition: var(--transition);
  cursor: pointer;
}
.section-link:hover { color: var(--secondary); }

.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); }

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 20px;
  border-radius: var(--radius-full);
  font-size: 0.83rem;
  font-weight: 600;
  transition: var(--transition);
  cursor: pointer;
  white-space: nowrap;
}
.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 4px 12px rgba(26,60,110,0.3);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(26,60,110,0.4); }
.btn-secondary {
  background: var(--gradient-secondary);
  color: white;
  box-shadow: 0 4px 12px rgba(0,169,143,0.3);
}
.btn-secondary:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,169,143,0.4); }
.btn-outline {
  background: transparent;
  color: var(--primary-light);
  border: 1.5px solid var(--primary-light);
}
.btn-outline:hover { background: var(--primary-light); color: white; }
.btn-ghost {
  background: var(--bg-main);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--border); color: var(--text-primary); }
.btn-sm { padding: 6px 14px; font-size: 0.78rem; }
.btn-xs { padding: 4px 10px; font-size: 0.73rem; }
.btn-lg { padding: 12px 28px; font-size: 0.9rem; }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem; font-weight: 600;
}
.badge-primary { background: rgba(26,60,110,0.1); color: var(--primary); }
.badge-secondary { background: rgba(0,169,143,0.12); color: var(--secondary-dark); }
.badge-accent { background: rgba(245,158,11,0.12); color: #B45309; }
.badge-success { background: rgba(34,197,94,0.12); color: #15803D; }
.badge-danger { background: rgba(239,68,68,0.12); color: #B91C1C; }
.badge-purple { background: rgba(139,92,246,0.12); color: #6D28D9; }

/* Progress Bar */
.progress-wrap { width: 100%; }
.progress-label {
  display: flex; justify-content: space-between;
  font-size: 0.75rem; color: var(--text-muted); margin-bottom: 5px;
}
.progress-bar {
  width: 100%;
  height: 7px;
  background: var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--gradient-secondary);
  border-radius: var(--radius-full);
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}
.progress-fill::after {
  content: '';
  position: absolute;
  top: 0; left: -100%; width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: shimmer 2s infinite;
}
@keyframes shimmer { to { left: 100%; } }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }

/* =========================================
   STAR RATING
   ========================================= */
.stars { display: flex; align-items: center; gap: 2px; }
.star { color: #E2E8F0; font-size: 0.85rem; }
.star.filled { color: #F59E0B; }
.star.half { color: #F59E0B; }

/* =========================================
   DASHBOARD PAGE
   ========================================= */

/* Hero Banner */
.hero-banner {
  background: var(--gradient-hero);
  border-radius: var(--radius-xl);
  padding: 36px 40px;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.hero-banner::before {
  content: '';
  position: absolute;
  top: -40px; right: -20px;
  width: 200px; height: 200px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
  pointer-events: none;
}
.hero-banner::after {
  content: '';
  position: absolute;
  bottom: -50px; left: 40%;
  width: 140px; height: 140px;
  background: rgba(0,196,167,0.12);
  border-radius: 50%;
  pointer-events: none;
}

.hero-content { position: relative; z-index: 1; flex: 1; min-width: 0; }
.hero-greeting { font-size: 0.85rem; color: rgba(255,255,255,0.7); font-weight: 500; margin-bottom: 6px; }
.hero-title {
  font-size: 1.7rem; font-weight: 800; color: white;
  line-height: 1.3; margin-bottom: 10px;
}
.hero-title .highlight {
  color: var(--secondary-light);
  position: relative;
}
.hero-subtitle { font-size: 0.9rem; color: rgba(255,255,255,0.75); margin-bottom: 24px; max-width: 480px; word-break: break-word; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn-hero-primary {
  background: white;
  color: var(--primary);
  padding: 11px 24px;
  border-radius: var(--radius-full);
  font-size: 0.87rem; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
  transition: var(--transition);
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}
.btn-hero-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,0.2); }
.btn-hero-secondary {
  background: rgba(255,255,255,0.15);
  color: white;
  padding: 11px 24px;
  border-radius: var(--radius-full);
  font-size: 0.87rem; font-weight: 600;
  display: flex; align-items: center; gap: 8px;
  transition: var(--transition);
  border: 1px solid rgba(255,255,255,0.25);
  backdrop-filter: blur(4px);
}
.btn-hero-secondary:hover { background: rgba(255,255,255,0.25); }

.hero-stats {
  display: flex; gap: 12px;
  z-index: 1;
  flex-shrink: 0;
  position: relative;
}
.hero-stat-item {
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  text-align: center;
  min-width: 90px;
}
.hero-stat-number { font-size: 1.5rem; font-weight: 800; color: white; line-height: 1; }
.hero-stat-label { font-size: 0.7rem; color: rgba(255,255,255,0.65); margin-top: 4px; }

/* Stats Grid */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 28px; }

/* Responsive grid helpers used in dashboard inline styles */
.dash-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 22px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex; align-items: flex-start; gap: 16px;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.stat-card:nth-child(1)::after { background: var(--gradient-primary); }
.stat-card:nth-child(2)::after { background: var(--gradient-secondary); }
.stat-card:nth-child(3)::after { background: var(--gradient-accent); }
.stat-card:nth-child(4)::after { background: linear-gradient(135deg, #8B5CF6, #A78BFA); }

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

.stat-icon {
  width: 50px; height: 50px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.stat-icon.blue { background: rgba(26,60,110,0.1); color: var(--primary); }
.stat-icon.green { background: rgba(0,169,143,0.1); color: var(--secondary); }
.stat-icon.amber { background: rgba(245,158,11,0.1); color: var(--accent); }
.stat-icon.purple { background: rgba(139,92,246,0.1); color: #7C3AED; }

.stat-info { flex: 1; }
.stat-number { font-size: 1.7rem; font-weight: 800; color: var(--text-primary); line-height: 1; }
.stat-label { font-size: 0.78rem; color: var(--text-muted); margin-top: 3px; font-weight: 500; }
.stat-change {
  font-size: 0.72rem; font-weight: 600; margin-top: 8px;
  display: flex; align-items: center; gap: 3px;
}
.stat-change.up { color: #16A34A; }
.stat-change.down { color: #DC2626; }

/* Course Carousel */
.courses-scroll {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.courses-scroll::-webkit-scrollbar { height: 5px; }
.courses-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.course-card {
  min-width: 280px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  scroll-snap-align: start;
  cursor: pointer;
}
.course-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--border); }

.course-thumbnail {
  width: 100%; height: 150px;
  position: relative;
  overflow: hidden;
  background: var(--bg-main);
}
.course-thumbnail img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.course-card:hover .course-thumbnail img { transform: scale(1.05); }

.course-thumb-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 40%, rgba(0,0,0,0.5));
  display: flex; align-items: flex-end; justify-content: space-between;
  padding: 10px 12px;
  opacity: 0;
  transition: var(--transition);
}
.course-card:hover .course-thumb-overlay { opacity: 1; }

.play-btn {
  width: 44px; height: 44px;
  background: white;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  color: var(--primary);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  transition: var(--transition);
  opacity: 0;
}
.course-card:hover .play-btn { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }

.course-category-tag {
  position: absolute;
  top: 10px; left: 10px;
}

.course-body { padding: 16px; }
.course-title { font-size: 0.9rem; font-weight: 700; color: var(--text-primary); margin-bottom: 6px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.course-instructor { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 10px; display: flex; align-items: center; gap: 4px; }
.course-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.course-meta-item { display: flex; align-items: center; gap: 4px; font-size: 0.73rem; color: var(--text-muted); }
.course-meta-item i { font-size: 0.75rem; }
.course-rating { display: flex; align-items: center; gap: 4px; font-size: 0.73rem; font-weight: 600; color: #B45309; }
.course-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }

/* Recommended Grid */
.recommended-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }

/* =========================================
   COURSE CATALOG PAGE
   ========================================= */
.filter-bar {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 18px 22px;
  margin-bottom: 24px;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}
.filter-label { font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); white-space: nowrap; }
.filter-select {
  padding: 8px 32px 8px 14px;
  background: var(--bg-main);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.82rem; color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23718096' d='M8 10.5l-5-5h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px;
}
.filter-select:focus { border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(42,87,167,0.1); }

.filter-divider { width: 1px; height: 26px; background: var(--border); flex-shrink: 0; }
.filter-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-chip {
  padding: 5px 14px;
  border-radius: var(--radius-full);
  font-size: 0.78rem; font-weight: 500;
  cursor: pointer;
  border: 1.5px solid var(--border);
  background: white;
  color: var(--text-secondary);
  transition: var(--transition);
}
.filter-chip:hover, .filter-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 22px;
}
/* List view override */
.catalog-grid.list-view {
  grid-template-columns: 1fr;
}
.catalog-grid.list-view .catalog-card {
  flex-direction: row;
}
.catalog-grid.list-view .catalog-thumb {
  width: 160px; height: auto; min-height: 120px;
  flex-shrink: 0; border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}
.catalog-grid.list-view .catalog-thumb .thumb-icon { font-size: 2.5rem; }
@media (max-width: 600px) {
  .catalog-grid.list-view .catalog-card { flex-direction: column; }
  .catalog-grid.list-view .catalog-thumb { width: 100%; height: 120px; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
}

.catalog-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  cursor: pointer;
  display: flex; flex-direction: column;
}
.catalog-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-xl); border-color: transparent; }

.catalog-thumb {
  width: 100%; height: 170px;
  position: relative;
  background: linear-gradient(135deg, #1A3C6E, #2557A7);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.catalog-thumb .thumb-icon { font-size: 3.5rem; opacity: 0.3; }
.catalog-thumb img { width: 100%; height: 100%; object-fit: cover; }

.catalog-level-badge {
  position: absolute;
  top: 12px; right: 12px;
}

.catalog-body { padding: 18px; flex: 1; display: flex; flex-direction: column; }
.catalog-category { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--secondary); margin-bottom: 6px; }
.catalog-title { font-size: 0.93rem; font-weight: 700; color: var(--text-primary); line-height: 1.4; margin-bottom: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.catalog-instructor { font-size: 0.76rem; color: var(--text-muted); margin-bottom: 12px; display: flex; align-items: center; gap: 5px; }

.catalog-meta { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.catalog-meta-item { display: flex; align-items: center; gap: 5px; font-size: 0.75rem; color: var(--text-muted); font-weight: 500; }
.catalog-meta-item i { color: var(--primary-light); }

.catalog-rating-row { display: flex; align-items: center; gap: 6px; margin-bottom: 14px; }
.rating-num { font-size: 0.8rem; font-weight: 700; color: #B45309; }
.rating-count { font-size: 0.73rem; color: var(--text-muted); }

.catalog-footer { margin-top: auto; display: flex; align-items: center; justify-content: space-between; padding-top: 12px; border-top: 1px solid var(--border-light); }
.catalog-price { font-size: 0.8rem; color: var(--text-muted); font-weight: 500; }
.catalog-price .free { color: var(--secondary); font-weight: 700; }

/* =========================================
   COURSE PLAYER PAGE
   ========================================= */
.player-layout {
  display: flex;
  gap: 0;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  min-height: calc(100vh - var(--topbar-height) - 56px);
}

.syllabus-panel {
  width: 280px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  background: var(--bg-main);
}

.syllabus-header {
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--border);
  background: white;
}
.syllabus-course-title { font-size: 0.85rem; font-weight: 700; color: var(--text-primary); margin-bottom: 8px; line-height: 1.3; }
.syllabus-progress { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 6px; }

.syllabus-list { flex: 1; overflow-y: auto; padding: 12px 0; }
.syllabus-list::-webkit-scrollbar { width: 4px; }
.syllabus-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.chapter-item { margin-bottom: 4px; }
.chapter-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px;
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}
.chapter-header:hover { background: rgba(0,0,0,0.03); }
.chapter-title-wrap { display: flex; align-items: center; gap: 8px; flex: 1; }
.chapter-num {
  width: 22px; height: 22px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.68rem; font-weight: 700;
  flex-shrink: 0;
}
.chapter-name { font-size: 0.82rem; font-weight: 600; color: var(--text-primary); }
.chapter-toggle { font-size: 0.75rem; color: var(--text-muted); transition: transform 0.2s; }
.chapter-item.open .chapter-toggle { transform: rotate(180deg); }

.lesson-list { padding: 0 8px 8px 16px; }
.lesson-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 2px;
}
.lesson-item:hover { background: rgba(0,0,0,0.04); }
.lesson-item.active { background: rgba(26,60,110,0.08); }
.lesson-check {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: var(--transition);
  cursor: pointer;
}
.lesson-check.done {
  background: var(--secondary);
  border-color: var(--secondary);
  color: white;
  font-size: 0.65rem;
}
.lesson-check.active-lesson {
  border-color: var(--primary-light);
  background: rgba(42,87,167,0.1);
}
.lesson-title { font-size: 0.79rem; color: var(--text-secondary); flex: 1; line-height: 1.3; }
.lesson-title.active-text { color: var(--primary); font-weight: 600; }
.lesson-duration { font-size: 0.7rem; color: var(--text-muted); flex-shrink: 0; }

/* Video Player Area */
.player-main { flex: 1; display: flex; flex-direction: column; }

.video-area {
  background: #0a0f1a;
  aspect-ratio: 16/9;
  position: relative;
  display: flex; align-items: center; justify-content: center;
  max-height: 420px;
  overflow: hidden;
}
/* Embedded iframe (YouTube / Vimeo) */
.video-area iframe.lesson-iframe {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  border: none;
  z-index: 2;
}
/* Direct video element */
.video-area video.lesson-video {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  object-fit: contain;
  z-index: 2;
}
/* When real video is loaded, hide the placeholder overlay + simulated controls */
.video-area.has-video .video-placeholder,
.video-area.has-video .video-play-btn,
.video-area.has-video .video-controls { display: none; }

/* ── YouTube thumbnail click-to-play ── */
.lesson-yt-thumb {
  position: absolute;
  inset: 0;
  cursor: pointer;
  z-index: 2;
  overflow: hidden;
  background: #000;
}
.yt-thumb-img {
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0.7;
  display: block;
  transition: opacity 0.2s;
}
.lesson-yt-thumb:hover .yt-thumb-img { opacity: 0.5; }
.yt-play-overlay {
  position: absolute;
  inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 10px;
  pointer-events: none;
}
.yt-play-btn {
  width: 72px; height: 72px;
  background: rgba(255,0,0,0.85);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; color: white;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  transition: transform 0.15s, background 0.15s;
}
.lesson-yt-thumb:hover .yt-play-btn {
  transform: scale(1.12);
  background: rgba(255,0,0,1);
}
.yt-play-label {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.85);
  background: rgba(0,0,0,0.45);
  padding: 4px 12px;
  border-radius: 20px;
}
.yt-ext-link {
  position: absolute;
  bottom: 12px; right: 14px;
  background: rgba(255,0,0,0.8);
  color: white !important;
  font-size: 0.72rem; font-weight: 600;
  padding: 5px 12px;
  border-radius: 6px;
  text-decoration: none !important;
  display: flex; align-items: center; gap: 5px;
  z-index: 3;
  transition: background 0.15s;
}
.yt-ext-link:hover { background: rgba(200,0,0,0.95); }
.yt-ext-link i { font-size: 0.88rem; }

/* ── External link card (unknown URL type) ── */
.lesson-ext-link {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: rgba(10,15,26,0.95);
}

.video-placeholder {
  text-align: center;
  color: rgba(255,255,255,0.6);
  z-index: 1;
}
.video-placeholder i { font-size: 4rem; margin-bottom: 12px; color: rgba(255,255,255,0.2); }
.video-placeholder p { font-size: 0.85rem; }
.video-play-btn {
  position: absolute;
  width: 70px; height: 70px;
  background: rgba(255,255,255,0.15);
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; color: white;
  cursor: pointer;
  transition: var(--transition);
  backdrop-filter: blur(4px);
  z-index: 1;
}
.video-play-btn:hover { background: var(--secondary); border-color: var(--secondary); transform: scale(1.1); }

.video-controls {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
  padding: 20px 16px 12px;
}
.video-progress { height: 4px; background: rgba(255,255,255,0.2); border-radius: 2px; margin-bottom: 10px; cursor: pointer; }
.video-progress-fill { height: 100%; width: 35%; background: var(--secondary); border-radius: 2px; position: relative; }
.video-progress-fill::after { content: ''; position: absolute; right: -5px; top: -3px; width: 10px; height: 10px; background: white; border-radius: 50%; }
.video-ctrl-row { display: flex; align-items: center; gap: 10px; }
.v-ctrl-btn { background: none; color: rgba(255,255,255,0.8); font-size: 0.9rem; padding: 4px; transition: var(--transition); border-radius: 4px; }
.v-ctrl-btn:hover { color: white; background: rgba(255,255,255,0.1); }
.v-time { font-size: 0.75rem; color: rgba(255,255,255,0.7); margin-left: 4px; }
.v-vol { display: flex; align-items: center; gap: 6px; }
.v-vol-bar { width: 70px; height: 4px; background: rgba(255,255,255,0.2); border-radius: 2px; cursor: pointer; }
.v-vol-fill { height: 100%; width: 75%; background: white; border-radius: 2px; }
.v-ctrl-right { margin-left: auto; display: flex; gap: 6px; }

/* Tabs */
.player-tabs { border-bottom: 1px solid var(--border); background: white; }
.tab-list { display: flex; padding: 0 20px; }
.tab-item {
  padding: 14px 18px;
  font-size: 0.83rem; font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  transition: var(--transition);
  white-space: nowrap;
}
.tab-item:hover { color: var(--primary); }
.tab-item.active { color: var(--primary); }
.tab-item.active::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: var(--primary);
  border-radius: 2px 2px 0 0;
}

.tab-content { padding: 24px; }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeInUp 0.2s ease; }

/* About Course Tab */
.about-course-title { font-size: 1rem; font-weight: 700; margin-bottom: 8px; }
.about-course-desc { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.7; margin-bottom: 16px; }
.learning-objectives h4 { font-size: 0.85rem; font-weight: 700; margin-bottom: 10px; }
.objective-item { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 7px; font-size: 0.82rem; color: var(--text-secondary); }
.objective-icon { color: var(--secondary); margin-top: 2px; flex-shrink: 0; }

/* Resources Tab */
.resource-list { display: flex; flex-direction: column; gap: 10px; }
.resource-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  background: var(--bg-main);
  border-radius: var(--radius-md);
  transition: var(--transition);
  cursor: pointer;
}
.resource-item:hover { background: rgba(26,60,110,0.06); }
.resource-icon { width: 38px; height: 38px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0; }
.resource-icon.pdf { background: rgba(239,68,68,0.1); color: #DC2626; }
.resource-icon.ppt { background: rgba(245,158,11,0.1); color: #D97706; }
.resource-icon.xls { background: rgba(34,197,94,0.1); color: #16A34A; }
.resource-icon.zip { background: rgba(139,92,246,0.1); color: #7C3AED; }
.resource-info { flex: 1; }
.resource-name { font-size: 0.82rem; font-weight: 600; color: var(--text-primary); }
.resource-size { font-size: 0.73rem; color: var(--text-muted); }

/* =========================================
   CATALOG CARDS — TAG BADGES & LEVEL BADGES
   ========================================= */

/* Tag / Category badges on course thumbnail */
.cat-badge {
  position: absolute;
  bottom: 10px; left: 10px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 0.68rem; font-weight: 700;
  letter-spacing: 0.03em;
  backdrop-filter: blur(4px);
  pointer-events: none;
}
.cat-badge.mandatory { background: rgba(239,68,68,0.88); color: white; }
.cat-badge.popular   { background: rgba(245,158,11,0.88); color: white; }
.cat-badge.new-tag   { background: rgba(16,185,129,0.88); color: white; }
.cat-badge.featured  { background: rgba(99,102,241,0.88);  color: white; }

/* Level badges */
.level-badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.7rem; font-weight: 700;
  background: rgba(255,255,255,0.92);
}
.level-badge.pemula   { color: #16A34A; }
.level-badge.menengah { color: #D97706; }
.level-badge.mahir    { color: #DC2626; }

/* Admin hover overlay on course cards */
.admin-card { position: relative; }
.course-admin-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  align-items: center;
  justify-items: center;
  gap: 8px;
  padding: 14px;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 5;
}
.admin-card:hover .course-admin-overlay { opacity: 1; }

.coa-btn {
  width: 100%; padding: 8px 6px;
  border-radius: var(--radius-md);
  border: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font-size: 0.9rem;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.coa-btn:hover { transform: scale(1.05); }
.coa-label { font-size: 0.6rem; font-weight: 700; letter-spacing: 0.03em; }
.coa-btn.edit  { background: var(--primary);          color: white; }
.coa-btn.info  { background: rgba(255,255,255,0.92);  color: var(--primary); }
.coa-btn.quiz  { background: rgba(255,255,255,0.92);  color: var(--secondary); }
.coa-btn.del   { background: rgba(239,68,68,0.88);    color: white; }

/* Skeleton loader */
.skeleton-card { pointer-events: none; animation: shimmer 1.6s infinite; }
.skeleton-card .catalog-thumb { background: #E2E8F0 !important; }
.skel-line {
  height: 12px; border-radius: 6px;
  background: linear-gradient(90deg,#E2E8F0 25%,#F0F4F8 50%,#E2E8F0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.6s infinite;
  margin-bottom: 10px;
}
.skel-w60 { width: 60%; }
.skel-w90 { width: 90%; }
.skel-w40 { width: 40%; }
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Gradient swatches (course form) */
.grad-swatches {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px;
}
.grad-swatch {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 3px solid transparent;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.15s ease, border-color 0.15s ease;
  flex-shrink: 0;
}
.grad-swatch:hover { transform: scale(1.1); }
.grad-swatch.selected { border-color: white; box-shadow: 0 0 0 2px var(--primary); }

/* Course form responsive grid */
.course-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width:580px) { .course-form-grid { grid-template-columns: 1fr; } }

/* Quiz admin question blocks */
.qa-block {
  background: var(--bg-main);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 14px;
  border: 1.5px solid var(--border);
}
.qa-block-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.qa-num {
  font-size: 0.78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--primary);
}

/* =========================================
   PLAYER PAGE — TOPBAR & LESSON INFO BAR
   ========================================= */
.player-topbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 10px 20px;
  display: flex; align-items: center; gap: 14px;
  flex-wrap: wrap;
  /* NOT sticky — app .topbar already sticks at top:0 inside main-content */
}
.lesson-info-bar {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  background: white;
  flex-wrap: wrap; gap: 10px;
}

/* =========================================
   QUIZ UI — FULL INTERACTIVE ENGINE
   ========================================= */

/* Quiz Tab */
.quiz-container { max-width: 640px; }

/* Progress bar in quiz header */
.quiz-progress-wrap {
  display: flex; align-items: center; gap: 10px;
  flex: 1;
}
.quiz-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px; gap: 12px; flex-wrap: wrap;
}
.quiz-progress { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; color: var(--text-muted); }
.quiz-timer-display {
  display: flex; align-items: center; gap: 5px;
  font-size: 0.85rem; font-weight: 700;
  color: var(--primary);
  background: rgba(26,60,110,0.06);
  padding: 4px 12px; border-radius: 20px;
  white-space: nowrap;
}
.quiz-timer-display.warning {
  color: #DC2626;
  background: rgba(239,68,68,0.1);
  animation: pulse-warn 1s ease-in-out infinite;
}
@keyframes pulse-warn {
  0%,100% { opacity: 1; } 50% { opacity: 0.6; }
}

/* Question navigator dots */
.quiz-navigator {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 20px;
}
.qnav-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: white;
  cursor: pointer;
  font-size: 0.75rem; font-weight: 700;
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.qnav-btn:hover { border-color: var(--primary-light); color: var(--primary); }
.qnav-btn.current  { border-color: var(--primary); background: var(--primary); color: white; }
.qnav-btn.answered { border-color: var(--secondary); background: rgba(0,169,143,0.1); color: var(--secondary); }
.qnav-btn.correct  { border-color: #16A34A; background: rgba(34,197,94,0.12); color: #16A34A; }
.qnav-btn.wrong    { border-color: #DC2626; background: rgba(239,68,68,0.1);  color: #DC2626; }

/* Question card */
.question-card { background: var(--bg-main); border-radius: var(--radius-lg); padding: 20px; margin-bottom: 18px; }
.question-num { font-size: 0.73rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--secondary); margin-bottom: 8px; }
.question-text { font-size: 0.92rem; font-weight: 600; color: var(--text-primary); line-height: 1.55; }

/* Answer options */
.answer-options { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.answer-option {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  background: white;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.85rem; color: var(--text-primary);
}
.answer-option:hover { border-color: var(--primary-light); background: rgba(42,87,167,0.04); }
.answer-option.selected { border-color: var(--primary); background: rgba(26,60,110,0.06); color: var(--primary); font-weight: 600; }
.answer-option.correct { border-color: #16A34A; background: rgba(34,197,94,0.08); color: #15803D; }
.answer-option.wrong { border-color: #DC2626; background: rgba(239,68,68,0.08); color: #B91C1C; }
.option-letter {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--bg-main);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.78rem; font-weight: 700;
  flex-shrink: 0;
  border: 1.5px solid var(--border);
}
.answer-option.selected .option-letter { background: var(--primary); color: white; border-color: var(--primary); }
.answer-option.correct  .option-letter { background: #16A34A; color: white; border-color: #16A34A; }
.answer-option.wrong    .option-letter { background: #DC2626; color: white; border-color: #DC2626; }

/* Feedback box */
.quiz-feedback {
  margin-top: 14px; padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 0.85rem; line-height: 1.5;
}
.quiz-feedback.correct {
  background: rgba(34,197,94,0.09);
  border: 1.5px solid #86EFAC;
  color: #15803D;
}
.quiz-feedback.wrong {
  background: rgba(239,68,68,0.08);
  border: 1.5px solid #FCA5A5;
  color: #B91C1C;
}

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

/* Intro screen */
.quiz-intro {
  max-width: 520px; margin: 0 auto;
  text-align: center; padding: 24px 16px;
}
.quiz-intro-icon { font-size: 3rem; margin-bottom: 10px; }
.quiz-intro-title { font-size: 1.15rem; font-weight: 800; color: var(--text-primary); margin-bottom: 6px; }
.quiz-intro-sub { font-size: 0.83rem; color: var(--text-muted); margin-bottom: 22px; }

.quiz-info-grid {
  display: grid; grid-template-columns: repeat(4,1fr);
  gap: 12px; margin-bottom: 22px;
}
.quiz-info-item {
  background: var(--bg-main);
  border-radius: var(--radius-md);
  padding: 14px 10px;
  text-align: center;
}
.qii-icon { font-size: 1.4rem; margin-bottom: 5px; }
.qii-val  { font-size: 1.05rem; font-weight: 800; color: var(--text-primary); }
.qii-label{ font-size: 0.7rem; color: var(--text-muted); margin-top: 2px; }

.quiz-rules {
  background: var(--bg-main); border-radius: var(--radius-md);
  padding: 14px 18px; text-align: left;
  font-size: 0.82rem; color: var(--text-secondary);
  line-height: 1.7; margin-bottom: 20px;
}
.quiz-rules li { margin-bottom: 4px; }

/* ── Quiz History Block (shown in intro when user has past attempts) ── */
.qh-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin: 0 0 20px;
  text-align: left;
}
.qh-header { display: flex; flex-direction: column; gap: 12px; }
.qh-title-row {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px;
}
.qh-title { font-size: 0.88rem; font-weight: 700; color: var(--text-primary); }
.qh-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.72rem; font-weight: 700; padding: 4px 10px;
  border-radius: 999px;
}
.qh-badge.pass  { background: rgba(22,163,74,0.12); color: #16A34A; }
.qh-badge.fail  { background: rgba(220,38,38,0.1);  color: #DC2626; }
.qh-badge.cert  { background: rgba(42,87,167,0.12); color: var(--primary); }
.qh-stats-row {
  display: flex; gap: 16px; flex-wrap: wrap;
}
.qh-stat { display: flex; flex-direction: column; align-items: center; min-width: 70px; }
.qh-stat-val { font-size: 1.25rem; font-weight: 800; color: var(--text-primary); line-height: 1; }
.qh-stat-lbl { font-size: 0.68rem; color: var(--text-muted); margin-top: 3px; text-align: center; }

/* Result screen */
/* ══════════════════════════════════════════
   QUIZ RESULT SCREEN — full redesign
   ══════════════════════════════════════════ */
.quiz-result {
  max-width: 580px;
  margin: 0 auto;
  padding: 24px 16px 32px;
  display: flex; flex-direction: column; gap: 20px;
}

/* Header */
.qr-header { text-align: center; }
.qr-icon   { font-size: 3rem; line-height: 1; margin-bottom: 8px; }
.qr-title  { font-size: 1.3rem; font-weight: 800; margin: 0 0 6px; }
.qr-message{ font-size: 0.83rem; color: var(--text-muted); margin: 0; line-height: 1.5; }

/* Score row: donut + stat cards */
.qr-score-row {
  display: flex; align-items: center; gap: 18px;
  background: var(--bg-main);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  border: 1px solid var(--border);
}

/* SVG Donut */
.qr-donut {
  position: relative;
  width: 110px; height: 110px;
  flex-shrink: 0;
}
.qr-donut-svg {
  width: 100%; height: 100%;
  transform: rotate(-90deg);
}
.qr-donut-inner {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 1px;
}
.qr-donut-pct  { font-size: 1.35rem; font-weight: 800; line-height: 1; }
.qr-donut-sub  { font-size: 0.75rem; font-weight: 700; color: var(--text-secondary); line-height: 1.2; }
.qr-donut-sub2 { font-size: 0.65rem; color: var(--text-muted); line-height: 1; }

/* Stat cards grid — 2×2 */
.qr-stats {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.qr-stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  text-align: center;
  border: 1.5px solid var(--border);
}
.qr-stat-card.correct { border-color: #86EFAC; background: #F0FFF4; }
.qr-stat-card.wrong   { border-color: #FCA5A5; background: #FFF5F5; }
.qr-stat-card.score   { border-color: #BAD0FD; background: #EFF5FF; }
.qr-stat-card.passing { border-color: var(--border); background: var(--bg-main); }
.qr-stat-num {
  font-size: 1.3rem; font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}
.qr-stat-card.correct .qr-stat-num { color: #16A34A; }
.qr-stat-card.wrong   .qr-stat-num { color: #DC2626; }
.qr-stat-lbl {
  font-size: 0.68rem; color: var(--text-muted);
  margin-top: 3px;
  display: flex; align-items: center; justify-content: center; gap: 4px;
}
.qr-stat-card.correct .qr-stat-lbl { color: #15803D; }
.qr-stat-card.wrong   .qr-stat-lbl { color: #B91C1C; }

/* Result banner */
.qr-banner {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px;
  border-radius: var(--radius-md);
  font-size: 0.85rem; font-weight: 600;
}
.qr-banner.pass { background: #DCFCE7; color: #15803D; border: 1px solid #86EFAC; }
.qr-banner.fail { background: #FEF2F2; color: #B91C1C; border: 1px solid #FCA5A5; }

/* Review section */
.qr-review { width: 100%; }
.qr-review-title {
  font-size: 0.92rem; font-weight: 700;
  margin: 0 0 12px;
  color: var(--text-primary);
}
.qr-item {
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  overflow: hidden;
  margin-bottom: 10px;
}
.qr-item.ok   { border-color: #86EFAC; }
.qr-item.fail { border-color: #FCA5A5; }

.qr-item-head {
  display: flex; align-items: baseline; gap: 10px;
  padding: 10px 14px;
  flex-wrap: wrap;
}
.qr-item.ok   .qr-item-head { background: rgba(22,163,74,0.06); }
.qr-item.fail .qr-item-head { background: rgba(220,38,38,0.06); }
.qr-item-badge {
  font-size: 0.72rem; font-weight: 700;
  white-space: nowrap; flex-shrink: 0;
}
.qr-item-badge.ok   { color: #15803D; }
.qr-item-badge.fail { color: #B91C1C; }
.qr-item-q {
  font-size: 0.82rem; color: var(--text-primary);
  font-weight: 600; line-height: 1.4;
}

.qr-item-opts {
  padding: 10px 14px 12px;
  display: flex; flex-direction: column; gap: 6px;
}
.qr-opt {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: var(--bg-main);
}
.qr-opt.correct {
  background: rgba(22,163,74,0.1);
  color: #15803D;
  font-weight: 600;
  border: 1px solid #86EFAC;
}
.qr-opt.wrong {
  background: rgba(220,38,38,0.07);
  color: #B91C1C;
  text-decoration: line-through;
  border: 1px solid #FCA5A5;
}
.qr-opt-letter {
  font-weight: 700; flex-shrink: 0;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: rgba(0,0,0,0.07);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem;
}
.qr-opt.correct .qr-opt-letter { background: rgba(22,163,74,0.2); }
.qr-opt.wrong   .qr-opt-letter { background: rgba(220,38,38,0.15); }
.qr-opt-text { flex: 1; }
.qr-opt-icon { margin-left: auto; flex-shrink: 0; font-size: 0.78rem; color: #16A34A; }
.qr-opt-icon.wrong { color: #DC2626; }

/* Action buttons */
.qr-actions {
  display: flex; gap: 10px; justify-content: center;
  flex-wrap: wrap;
  padding-top: 4px;
}

/* Empty quiz state */
.quiz-empty {
  text-align: center; padding: 48px 24px;
  color: var(--text-muted);
}
.quiz-empty h3 { font-size: 1rem; font-weight: 700; margin-bottom: 6px; color: var(--text-primary); }
.quiz-empty p  { font-size: 0.83rem; }

/* Discussion Tab */
.discussion-input-wrap { display: flex; gap: 10px; margin-bottom: 20px; }
.disc-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--gradient-primary); display: flex; align-items: center; justify-content: center; font-size: 0.8rem; font-weight: 700; color: white; flex-shrink: 0; }
.disc-input { flex: 1; padding: 10px 14px; background: var(--bg-main); border: 1.5px solid var(--border); border-radius: var(--radius-lg); font-size: 0.83rem; resize: none; transition: var(--transition); }
.disc-input:focus { border-color: var(--primary-light); background: white; }
.discussion-list { display: flex; flex-direction: column; gap: 16px; }
.disc-item { display: flex; gap: 12px; }
.disc-content { flex: 1; }
.disc-header { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.disc-name { font-size: 0.82rem; font-weight: 700; color: var(--text-primary); }
.disc-time { font-size: 0.72rem; color: var(--text-muted); }
.disc-text { font-size: 0.82rem; color: var(--text-secondary); line-height: 1.5; margin-bottom: 8px; }
.disc-actions { display: flex; gap: 14px; }
.disc-action { font-size: 0.75rem; color: var(--text-muted); display: flex; align-items: center; gap: 4px; cursor: pointer; transition: var(--transition); }
.disc-action:hover { color: var(--primary); }

/* =========================================
   COURSE EDITOR PAGE (Admin Only)
   ========================================= */

/* Page container override — no padding, full-height editor */
#page-courseeditor { padding: 0 !important; background: var(--bg-main); }

/* Top bar — scrolls with content (not sticky), keeps tab nav always visible */
.ce-topbar {
  background: var(--bg-card);
  border-bottom: 2px solid var(--primary);
  padding: 10px 20px;
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap;
}
.ce-course-identity {
  display: flex; align-items: center; gap: 12px;
  flex: 1; min-width: 0;
}
.ce-thumb-mini {
  width: 42px; height: 42px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; flex-shrink: 0;
}
.ce-course-name {
  font-size: 0.95rem; font-weight: 800; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ce-course-meta {
  font-size: 0.72rem; color: var(--text-muted);
}
.ce-dirty-dot {
  color: #F59E0B; font-size: 1.1rem; animation: pulse-warn 1s infinite;
}
.status-badge-aktif  { padding:3px 10px;border-radius:20px;font-size:0.72rem;font-weight:700;background:rgba(0,169,143,0.12);color:var(--secondary); }
.status-badge-draft  { padding:3px 10px;border-radius:20px;font-size:0.72rem;font-weight:700;background:rgba(245,158,11,0.12);color:#D97706; }
.status-badge-arsip  { padding:3px 10px;border-radius:20px;font-size:0.72rem;font-weight:700;background:rgba(107,114,128,0.12);color:#6B7280; }

/* Tab Nav — sticky just below the app topbar */
.ce-tab-nav {
  display: flex; gap: 0;
  background: var(--bg-card);
  border-bottom: 2px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  position: sticky;
  top: var(--topbar-height);
  z-index: 55;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.ce-tab-nav::-webkit-scrollbar { display: none; }
.ce-tab-btn {
  padding: 13px 20px;
  font-size: 0.82rem; font-weight: 600;
  color: var(--text-muted);
  background: transparent; border: none;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  transition: color 0.2s ease, border-color 0.2s ease;
  display: flex; align-items: center; gap: 6px;
}
.ce-tab-btn:hover { color: var(--primary); }
.ce-tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: rgba(26,60,110,0.03);
}

/* Tab Content area */
.ce-tab-content {
  padding: 24px 28px;
  max-width: 1080px;
  margin: 0 auto;
}
@media (max-width: 680px) { .ce-tab-content { padding: 16px 14px; } }

/* Section card */
.ce-section {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  padding: 22px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.ce-section-title {
  font-size: 0.95rem; font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 18px;
  display: flex; align-items: center; gap: 8px;
}
.ce-section-title i { color: var(--primary); }

/* Form grid */
.ce-form-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}
.ce-field { display: flex; flex-direction: column; gap: 5px; }
.ce-field.span2 { grid-column: 1 / -1; }
.ce-label {
  font-size: 0.78rem; font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.ce-input {
  padding: 9px 12px;
  background: var(--bg-main);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.85rem; font-family: inherit;
  color: var(--text-primary);
  transition: border-color 0.2s ease, background 0.2s ease;
  width: 100%; box-sizing: border-box;
}
.ce-input:focus { outline: none; border-color: var(--primary-light); background: white; }
textarea.ce-input { resize: vertical; }
@media (max-width: 600px) { .ce-form-grid { grid-template-columns: 1fr; } }

/* Thumbnail preview */
.ce-thumb-preview {
  width: 160px; height: 120px; border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  font-size: 3.5rem;
  flex-shrink: 0;
  box-shadow: var(--shadow-md);
  transition: background 0.3s ease;
}

/* Action bar */
.ce-actions {
  display: flex; align-items: center; gap: 12px;
  justify-content: flex-end; flex-wrap: wrap;
  padding-top: 4px;
}
.ce-error-msg {
  flex: 1; padding: 9px 14px; border-radius: var(--radius-md);
  background: rgba(239,68,68,0.08); border: 1px solid #FCA5A5;
  color: #B91C1C; font-size: 0.82rem;
}

/* Empty state */
.ce-empty-state {
  text-align: center; padding: 36px 20px;
  color: var(--text-muted);
  background: var(--bg-main); border-radius: var(--radius-md);
}
.ce-empty-state p { font-size: 0.85rem; margin-top: 8px; }

/* ── SYLLABUS ── */
.ce-chapter-block {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 12px;
  overflow: hidden;
  background: var(--bg-card);
}
.ce-chapter-header {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  background: var(--bg-main);
  border-bottom: 1px solid var(--border);
}
.ce-chapter-drag, .ce-lesson-drag {
  color: var(--text-muted); cursor: grab; font-size: 0.9rem; flex-shrink: 0;
}
.ce-chapter-num {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--primary); color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 800; flex-shrink: 0;
}
.ce-chapter-title-inp {
  flex: 1; font-weight: 700; font-size: 0.9rem;
  background: transparent; border: none; border-bottom: 2px solid transparent;
  padding: 4px 6px;
}
.ce-chapter-title-inp:focus { outline: none; border-bottom-color: var(--primary-light); background: white; border-radius: 4px; }

.ce-lesson-list { padding: 0; }
/* Lesson wrap — contains the main row + optional video-url sub-row */
.ce-lesson-wrap {
  border-bottom: 1px solid var(--border-light);
}
.ce-lesson-wrap:last-child { border-bottom: none; }
.ce-lesson-wrap:hover > .ce-lesson-row { background: rgba(26,60,110,0.02); }

.ce-lesson-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px 8px 48px;
  transition: background 0.15s ease;
}
.ce-lesson-type-icon { font-size: 1rem; flex-shrink: 0; width: 22px; text-align: center; }
.ce-lesson-title-inp {
  flex: 1; font-size: 0.82rem;
  background: transparent; border: none; border-bottom: 1.5px solid transparent;
  padding: 4px 6px;
}
.ce-lesson-title-inp:focus { outline:none; border-bottom-color:var(--primary-light); background:white; border-radius:4px; }
.ce-lesson-dur-inp { font-size: 0.78rem; }
.ce-lesson-type-sel { font-size: 0.78rem; }
.ce-lesson-done-wrap { display: flex; align-items: center; gap: 4px; cursor: pointer; flex-shrink: 0; }

/* Video URL sub-row — shown only when lesson type = video */
.ce-lesson-video-row {
  display: flex; align-items: center; gap: 8px;
  padding: 0 14px 8px 72px;
  background: rgba(26,60,110,0.025);
  border-top: 1px dashed var(--border-light);
  animation: slideDown 0.15s ease;
}
@keyframes slideDown {
  from { opacity:0; transform:translateY(-4px); }
  to   { opacity:1; transform:translateY(0);    }
}
/* Video type icon — changes color based on platform */
.ce-video-icon {
  font-size: 0.95rem;
  flex-shrink: 0;
  margin-top: 8px;
  color: var(--text-muted);
  transition: color 0.2s;
}
.ce-video-icon.yt { color: #FF0000; }
.ce-video-icon.gd { color: #4285F4; }
.ce-video-icon.vm { color: #1AB7EA; }
.ce-video-icon.dr { color: var(--secondary); }
.ce-video-icon.uk { color: var(--text-muted); }

.ce-lesson-video-inp {
  flex: 1;
  font-size: 0.78rem;
  padding: 5px 10px;
  margin-top: 6px;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  background: var(--bg-page);
  color: var(--text);
  transition: border-color 0.2s;
}
.ce-lesson-video-inp:focus {
  outline: none;
  border-color: var(--primary-light);
  background: white;
}
.ce-lesson-video-inp::placeholder { color: var(--text-muted); }

/* Video type hint badge */
.ce-video-hint { flex-shrink: 0; margin-top: 6px; }
.ce-video-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.68rem; font-weight: 600;
  padding: 3px 8px; border-radius: 12px;
  white-space: nowrap;
}
.ce-video-badge.yt { background: #FFF0F0; color: #CC0000; border: 1px solid #FFCCCC; }
.ce-video-badge.gd { background: #EBF3FF; color: #2A5EBF; border: 1px solid #BDD4F5; }
.ce-video-badge.vm { background: #E8F8FF; color: #0B7BAB; border: 1px solid #B3E5FA; }
.ce-video-badge.dr { background: #ECFDF5; color: #047857; border: 1px solid #A7F3D0; }
.ce-video-badge.uk { background: #F5F5F5; color: #666;    border: 1px solid #DDD; }

.ce-video-preview-btn {
  margin-top: 6px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--primary);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  font-size: 0.8rem;
}
.ce-video-preview-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* Video URL format guide bar in Silabus tab */
.ce-video-url-guide {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: #F0F5FF;
  border: 1px solid #C7D9F5;
  border-radius: var(--radius);
  padding: 8px 14px;
  margin-bottom: 18px;
  font-size: 0.77rem;
}
.ce-guide-title { font-weight: 600; color: var(--text-secondary); flex-shrink: 0; }
.ce-guide-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 10px; border-radius: 12px; font-size: 0.72rem; font-weight: 600;
}
.ce-guide-chip.yt { background: #FFF0F0; color: #CC0000; border: 1px solid #FFCCCC; }
.ce-guide-chip.gd { background: #EBF3FF; color: #2A5EBF; border: 1px solid #BDD4F5; }
.ce-guide-chip.vm { background: #E8F8FF; color: #0B7BAB; border: 1px solid #B3E5FA; }
.ce-guide-chip.dr { background: #ECFDF5; color: #047857; border: 1px solid #A7F3D0; }
.ce-guide-help {
  margin-left: auto; color: var(--primary); font-size: 0.72rem; text-decoration: none;
  display: flex; align-items: center; gap: 4px;
}
.ce-guide-help:hover { text-decoration: underline; }

/* ── MATERIALS ── */
.ce-upload-zone {
  border: 2.5px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
  margin-bottom: 14px;
}
.ce-upload-zone:hover {
  border-color: var(--primary-light);
  background: rgba(26,60,110,0.02);
}
.ce-upload-icon { font-size: 2.2rem; margin-bottom: 8px; }
.ce-upload-title { font-size: 0.9rem; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.ce-upload-hint { font-size: 0.75rem; color: var(--text-muted); }

.ce-add-url-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 12px 14px;
  background: var(--bg-main); border-radius: var(--radius-md);
  margin-bottom: 4px;
}
.ce-add-url-icon { font-size: 1.2rem; flex-shrink: 0; }

.ce-mat-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  margin-bottom: 8px;
  transition: border-color 0.15s ease;
}
.ce-mat-row:hover { border-color: var(--primary-light); }
.ce-mat-icon { font-size: 1.6rem; flex-shrink: 0; width: 32px; text-align: center; }
.ce-mat-info { flex: 1; min-width: 0; }
.ce-mat-name { font-size: 0.85rem; font-weight: 700; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ce-mat-meta { display: flex; gap: 10px; align-items: center; margin-top: 2px; font-size: 0.72rem; color: var(--text-muted); flex-wrap: wrap; }
.ce-mat-type-badge {
  padding: 1px 7px; border-radius: 20px;
  background: var(--bg-main); color: var(--text-muted);
  font-size: 0.68rem; font-weight: 700;
}

/* ── QUIZ BUILDER ── */
.ce-quiz-meta-card {
  background: var(--bg-main); border-radius: var(--radius-md);
  padding: 16px 18px; margin-bottom: 18px;
}
.ce-quiz-stats-bar {
  display: flex; gap: 20px; flex-wrap: wrap;
  padding: 10px 14px; border-radius: var(--radius-md);
  background: rgba(26,60,110,0.04);
  font-size: 0.8rem; color: var(--text-muted);
  margin-bottom: 18px;
}
.ce-quiz-stats-bar strong { color: var(--text-primary); }

.ce-question-block {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin-bottom: 14px;
  background: var(--bg-card);
  transition: border-color 0.15s ease;
}
.ce-question-block:hover { border-color: var(--primary-light); }
.ce-qblock-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.ce-qblock-num {
  font-size: 0.78rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--primary);
  display: flex; align-items: center; gap: 5px;
}
.ce-option-row {
  display: flex; align-items: center; gap: 8px;
}
.ce-option-dot {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--bg-main); border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem; font-weight: 800; color: var(--text-muted);
  cursor: pointer; flex-shrink: 0;
  transition: all 0.15s ease;
}
.ce-option-dot:hover { border-color: var(--secondary); color: var(--secondary); }
.ce-option-dot.correct {
  background: var(--secondary); border-color: var(--secondary); color: white;
}

/* ── CERTIFICATE ── */
.ce-cert-layout {
  display: grid; grid-template-columns: 340px 1fr; gap: 24px; align-items: start;
}
@media (max-width: 900px) { .ce-cert-layout { grid-template-columns: 1fr; } }

.ce-cert-settings { display: flex; flex-direction: column; }

.ce-cert-bg-opts {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px;
}
.ce-cert-bg-opt {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 6px 8px; border-radius: var(--radius-sm);
  cursor: pointer; border: 2px solid transparent;
  transition: border-color 0.2s ease;
  font-size: 0.68rem; color: var(--text-muted);
}
.ce-cert-bg-opt.active  { border-color: var(--primary); color: var(--primary); font-weight: 700; }
.ce-cert-bg-opt:hover   { border-color: var(--border); }

/* Certificate preview */
.ce-cert-preview-wrap { position: sticky; top: calc(var(--topbar-height) + 120px); }
.ce-cert-preview-label {
  font-size: 0.78rem; color: var(--text-muted); font-weight: 600;
  margin-bottom: 10px; text-align: center;
}
.ce-cert-preview {
  border-radius: var(--radius-xl);
  padding: 28px 24px 20px;
  color: white;
  text-align: center;
  box-shadow: var(--shadow-xl);
  transition: background 0.4s ease;
  position: relative; overflow: hidden;
}
.ce-cert-preview::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}
.cert-prev-org { font-size: 0.65rem; font-weight: 700; letter-spacing: 0.15em; text-transform: uppercase; opacity: 0.8; margin-bottom: 10px; }
.cert-prev-badge { font-size: 2.2rem; margin-bottom: 6px; }
.cert-prev-headline { font-size: 0.7rem; font-weight: 800; letter-spacing: 0.2em; text-transform: uppercase; opacity: 0.9; margin-bottom: 12px; border-top: 1px solid rgba(255,255,255,0.3); border-bottom: 1px solid rgba(255,255,255,0.3); padding: 6px 0; }
.cert-prev-text { font-size: 0.68rem; opacity: 0.75; margin-bottom: 4px; }
.cert-prev-name { font-size: 1.2rem; font-weight: 800; margin-bottom: 6px; font-style: italic; }
.cert-prev-course { font-size: 0.82rem; font-weight: 800; margin-bottom: 8px; line-height: 1.3; }
.cert-prev-extra { font-size: 0.65rem; opacity: 0.7; margin-bottom: 16px; line-height: 1.5; max-width: 240px; margin-left: auto; margin-right: auto; }
.cert-prev-footer { display: flex; align-items: flex-end; justify-content: space-between; margin-top: 12px; border-top: 1px solid rgba(255,255,255,0.2); padding-top: 12px; }
.cert-prev-sig { text-align: center; }
.cert-prev-sig-line { width: 80px; height: 1px; background: rgba(255,255,255,0.5); margin: 0 auto 4px; }
.cert-prev-sig-name { font-size: 0.68rem; font-weight: 700; }
.cert-prev-sig-title { font-size: 0.6rem; opacity: 0.7; }
.cert-prev-date { font-size: 0.6rem; opacity: 0.6; }

/* Shared: icon button */
.ce-icon-btn {
  width: 30px; height: 30px; border-radius: 50%;
  border: 1.5px solid var(--border); background: var(--bg-card);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; color: var(--text-muted);
  cursor: pointer; transition: all 0.15s ease;
  flex-shrink: 0;
}
.ce-icon-btn:hover { border-color: var(--primary-light); color: var(--primary); background: rgba(26,60,110,0.05); }
.ce-icon-btn.danger:hover { border-color: #FCA5A5; color: #DC2626; background: rgba(239,68,68,0.06); }

/* =========================================
   LEADERBOARD PAGE
   ========================================= */
.leaderboard-header-section {
  background: var(--gradient-hero);
  border-radius: var(--radius-xl);
  padding: 30px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}
.leaderboard-header-section::before {
  content: '🏆';
  position: absolute;
  right: 30px; top: 50%;
  transform: translateY(-50%);
  font-size: 5rem; opacity: 0.15;
}
.lb-title { font-size: 1.4rem; font-weight: 800; color: white; margin-bottom: 4px; }
.lb-subtitle { font-size: 0.85rem; color: rgba(255,255,255,0.7); }

.top3-podium { display: flex; align-items: flex-end; justify-content: center; gap: 16px; margin-bottom: 28px; }

.podium-item {
  display: flex; flex-direction: column; align-items: center;
  padding: 20px 16px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  min-width: 140px;
  position: relative;
}
.podium-item:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

.podium-item.first {
  background: linear-gradient(135deg, #FEF3C7, #FDE68A);
  border-color: #FCD34D;
  transform: scale(1.05);
}
.podium-item.second {
  background: linear-gradient(135deg, #F0F4F8, #E2E8F0);
}
.podium-item.third {
  background: linear-gradient(135deg, #FEF0E6, #FDE8D0);
  border-color: #FDBA74;
}

.podium-rank {
  position: absolute; top: -14px;
  font-size: 1.6rem;
}
.podium-avatar {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; font-weight: 700; color: white;
  border: 3px solid white;
  box-shadow: var(--shadow-md);
  margin-bottom: 10px;
  overflow: hidden;
}
.podium-avatar.gold { border-color: #FCD34D; box-shadow: 0 4px 15px rgba(252,211,77,0.5); }
.podium-avatar.silver { border-color: #CBD5E0; }
.podium-avatar.bronze { border-color: #FDBA74; }
.podium-name { font-size: 0.83rem; font-weight: 700; color: var(--text-primary); text-align: center; margin-bottom: 2px; }
.podium-dept { font-size: 0.72rem; color: var(--text-muted); text-align: center; margin-bottom: 6px; }
.podium-points { font-size: 1rem; font-weight: 800; color: var(--primary); }
.podium-points span { font-size: 0.7rem; font-weight: 600; color: var(--text-muted); }

.leaderboard-table-wrap { background: var(--bg-card); border-radius: var(--radius-lg); border: 1px solid var(--border); overflow-x: auto; box-shadow: var(--shadow-sm); }
.lb-table { width: 100%; border-collapse: collapse; min-width: 580px; }
.lb-table thead th {
  background: var(--bg-main);
  padding: 12px 16px;
  font-size: 0.75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-muted);
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.lb-table tbody tr {
  border-bottom: 1px solid var(--border-light);
  transition: var(--transition);
}
.lb-table tbody tr:last-child { border-bottom: none; }
.lb-table tbody tr:hover { background: var(--bg-main); }
.lb-table tbody tr.current-user { background: rgba(26,60,110,0.04); }
.lb-table td { padding: 14px 16px; font-size: 0.83rem; color: var(--text-secondary); }

.rank-cell { font-weight: 700; color: var(--text-primary); width: 50px; }
.rank-num {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.82rem; font-weight: 700;
}
.rank-num.top1 { background: #FEF3C7; color: #B45309; }
.rank-num.top2 { background: #F0F4F8; color: #4A5568; }
.rank-num.top3 { background: #FEF0E6; color: #C2410C; }

.lb-user-cell { display: flex; align-items: center; gap: 10px; }
.lb-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--gradient-primary); display: flex; align-items: center; justify-content: center; font-size: 0.8rem; font-weight: 700; color: white; flex-shrink: 0; overflow: hidden; }
.lb-name { font-weight: 600; color: var(--text-primary); font-size: 0.84rem; }
.lb-you { font-size: 0.68rem; color: var(--secondary); font-weight: 700; background: rgba(0,169,143,0.1); padding: 1px 6px; border-radius: 99px; margin-left: 6px; }

.points-cell { font-weight: 700; color: var(--primary); }
.points-bar-wrap { display: flex; align-items: center; gap: 8px; }
.points-mini-bar { flex: 1; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.points-mini-fill { height: 100%; background: var(--gradient-secondary); border-radius: 3px; }

/* Badges Section */
.badges-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
.badge-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 16px;
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}
.badge-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.badge-card.locked { opacity: 0.5; }
.badge-card.locked:hover { opacity: 0.7; }
.badge-card.earned { border-color: transparent; }
.badge-card.earned-gold { box-shadow: 0 4px 20px rgba(252,211,77,0.3); background: linear-gradient(135deg, #FFFBEB, white); border-color: #FCD34D; }
.badge-card.earned-green { box-shadow: 0 4px 20px rgba(0,169,143,0.2); background: linear-gradient(135deg, #ECFDF5, white); border-color: #6EE7B7; }
.badge-card.earned-blue { box-shadow: 0 4px 20px rgba(42,87,167,0.2); background: linear-gradient(135deg, #EFF6FF, white); border-color: #BFDBFE; }
.badge-card.earned-purple { box-shadow: 0 4px 20px rgba(139,92,246,0.2); background: linear-gradient(135deg, #F5F3FF, white); border-color: #DDD6FE; }

.badge-icon-wrap {
  width: 60px; height: 60px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem;
  margin-bottom: 10px;
}
.badge-name { font-size: 0.82rem; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.badge-desc { font-size: 0.72rem; color: var(--text-muted); line-height: 1.4; }
.badge-earned-label { font-size: 0.68rem; font-weight: 700; color: var(--secondary); margin-top: 6px; }
.lock-overlay { position: absolute; top: 10px; right: 10px; font-size: 0.85rem; color: var(--text-muted); }

/* =========================================
   MY PROGRESS PAGE
   ========================================= */
.progress-stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 28px; }

.chart-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.chart-title { font-size: 0.9rem; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.chart-subtitle { font-size: 0.76rem; color: var(--text-muted); margin-bottom: 18px; }
.chart-container { position: relative; }

/* ── Progress page empty state ──────────────────────────────────────────── */
.prog-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.prog-empty i { font-size: 2rem; margin-bottom: 10px; color: var(--border); }
.prog-empty p { margin: 3px 0; }

/* ── Progress grid responsive ────────────────────────────────────────────── */
.prog-grid { grid-template-columns: 1fr 1fr; }

.cert-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.cert-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.cert-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

.cert-visual {
  background: var(--gradient-hero);
  padding: 24px 20px;
  position: relative;
  overflow: hidden;
  min-height: 120px;
  display: flex; flex-direction: column; justify-content: flex-end;
}
.cert-visual::before { content: '🏅'; position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-size: 3rem; opacity: 0.25; }
.cert-org { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: rgba(255,255,255,0.6); margin-bottom: 4px; }
.cert-title { font-size: 0.92rem; font-weight: 800; color: white; line-height: 1.3; }

.cert-body { padding: 16px 18px; }
.cert-meta { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }
.cert-meta-item { display: flex; align-items: center; gap: 5px; font-size: 0.76rem; color: var(--text-muted); }
.cert-actions { display: flex; gap: 10px; }

.activity-timeline { display: flex; flex-direction: column; gap: 0; }
.activity-item {
  display: flex; gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-light);
  position: relative;
}
.activity-item:last-child { border-bottom: none; }
.activity-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}
.activity-dot.green { background: var(--secondary); box-shadow: 0 0 8px rgba(0,169,143,0.4); }
.activity-dot.blue { background: var(--primary-light); }
.activity-dot.amber { background: var(--accent); }
.activity-content { flex: 1; }
.activity-text { font-size: 0.82rem; color: var(--text-primary); margin-bottom: 2px; }
.activity-text strong { font-weight: 700; }
.activity-time { font-size: 0.72rem; color: var(--text-muted); }

/* Skills Radar */
.skills-bar-list { display: flex; flex-direction: column; gap: 14px; }
.skill-bar-item {}
.skill-bar-label { display: flex; justify-content: space-between; margin-bottom: 5px; }
.skill-name { font-size: 0.8rem; font-weight: 600; color: var(--text-primary); }
.skill-pct { font-size: 0.78rem; font-weight: 700; color: var(--primary-light); }

/* =========================================
   HELP DESK PAGE
   ========================================= */
.help-hero {
  background: var(--gradient-primary);
  border-radius: var(--radius-xl);
  padding: 36px;
  margin-bottom: 28px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.help-hero::before { content: '❓'; position: absolute; left: 20px; top: 50%; transform: translateY(-50%); font-size: 5rem; opacity: 0.1; }
.help-hero::after { content: '💬'; position: absolute; right: 20px; top: 50%; transform: translateY(-50%); font-size: 5rem; opacity: 0.1; }
.help-title { font-size: 1.5rem; font-weight: 800; color: white; margin-bottom: 6px; }
.help-subtitle { font-size: 0.9rem; color: rgba(255,255,255,0.75); margin-bottom: 20px; }
.help-search-wrap { max-width: 480px; margin: 0 auto; position: relative; }
.help-search { width: 100%; padding: 13px 50px 13px 18px; border-radius: var(--radius-full); border: none; font-size: 0.9rem; }
.help-search:focus { outline: none; box-shadow: 0 0 0 3px rgba(255,255,255,0.3); }
.help-search-btn { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: var(--primary); color: white; border-radius: var(--radius-full); padding: 7px 18px; font-size: 0.83rem; font-weight: 600; }
.help-search-btn:hover { background: var(--primary-dark); }

.faq-list { display: flex; flex-direction: column; gap: 8px; }
.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition);
}
.faq-question {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px;
  cursor: pointer;
  font-size: 0.88rem; font-weight: 600; color: var(--text-primary);
  transition: var(--transition);
}
.faq-question:hover { color: var(--primary); }
.faq-icon { font-size: 0.9rem; transition: transform 0.25s; }
.faq-item.open .faq-icon { transform: rotate(180deg); }
.faq-answer { padding: 0 18px; max-height: 0; overflow: hidden; transition: all 0.3s ease; font-size: 0.84rem; color: var(--text-secondary); line-height: 1.7; }
.faq-item.open .faq-answer { padding: 0 18px 16px; max-height: 300px; }

.contact-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  text-align: center;
  transition: var(--transition);
}
.contact-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.contact-icon { font-size: 2rem; margin-bottom: 10px; }
.contact-title { font-size: 0.9rem; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.contact-desc { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 14px; }

/* =========================================
   NOTIFICATIONS PANEL
   ========================================= */
.notif-panel {
  position: fixed;
  top: var(--topbar-height); right: 0;
  width: 340px;
  background: white;
  border-left: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-xl);
  transform: translateX(100%);
  transition: var(--transition-slow);
  z-index: 950;
  border-radius: 0 0 0 var(--radius-lg);
  max-height: calc(100vh - var(--topbar-height));
  overflow-y: auto;
}
.notif-panel.open { transform: translateX(0); }
.notif-panel-header { padding: 18px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.notif-panel-title { font-size: 0.9rem; font-weight: 700; }
.notif-mark-all { font-size: 0.78rem; color: var(--primary-light); cursor: pointer; font-weight: 600; }
.notif-list { }
.notif-item { display: flex; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border-light); cursor: pointer; transition: var(--transition); }
.notif-item:hover { background: var(--bg-main); }
.notif-item.unread { background: rgba(42,87,167,0.03); }
.notif-icon { width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0; }
.notif-content { flex: 1; }
.notif-text { font-size: 0.8rem; color: var(--text-primary); line-height: 1.4; margin-bottom: 3px; }
.notif-text strong { font-weight: 700; }
.notif-time { font-size: 0.7rem; color: var(--text-muted); }
.unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary-light); flex-shrink: 0; margin-top: 6px; }

/* =========================================
   RESPONSIVE DESIGN
   ========================================= */

/* ── 1280px: wide sidebar + content ── */
@media (max-width: 1280px) {
  .hero-stats { gap: 8px; }
  .hero-stat-item { padding: 12px 14px; min-width: 78px; }
  .hero-stat-number { font-size: 1.25rem; }
}

/* ── 1100px: stats start wrapping ── */
@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .hero-stats { display: none; }
  .hero-banner { padding: 32px 32px; }
  .progress-stats-row { grid-template-columns: repeat(2, 1fr); }
  .chart-grid-row { grid-template-columns: 1fr !important; }
  .skills-activity-row { grid-template-columns: 1fr !important; }
  .um-stats { grid-template-columns: repeat(3, 1fr) !important; }
}

/* ── 900px: mobile sidebar ── */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.mobile-open { transform: translateX(0); }
  .main-content { margin-left: 0 !important; }
  .mobile-menu-btn { display: flex; }
  .page-title { display: none; }
  .player-layout { flex-direction: column; }
  .syllabus-panel { width: 100%; border-right: none; border-bottom: 1px solid var(--border); }
  .top3-podium { flex-wrap: wrap; }
  .topbar { padding: 0 16px; gap: 10px; }
  .hero-banner { padding: 28px 24px; }
  .hero-title { font-size: 1.5rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .dash-grid-4 { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .lang-selector span.lang-name { display: none; }
}

/* ── 680px: small tablets / large phones ── */
@media (max-width: 680px) {
  .page-container { padding: 16px 14px; }
  .hero-banner { padding: 22px 18px; border-radius: var(--radius-lg); }
  .hero-title { font-size: 1.25rem; }
  .hero-subtitle { font-size: 0.82rem; }
  .hero-actions { gap: 8px; }
  .btn-hero-primary, .btn-hero-secondary { padding: 9px 18px; font-size: 0.82rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 18px; }
  .dash-grid-4 { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .stat-card { padding: 16px 14px; }
  .stat-number { font-size: 1.4rem; }
  .stat-icon { width: 40px; height: 40px; font-size: 1.1rem; }
  .progress-stats-row { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .catalog-grid { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .search-wrapper { max-width: 160px; }
  .filter-bar { gap: 8px; }
  .topbar { padding: 0 14px; gap: 8px; }
  .chart-grid-row { grid-template-columns: 1fr !important; }
  .skills-activity-row { grid-template-columns: 1fr !important; }
  .um-stats { grid-template-columns: repeat(2, 1fr) !important; }
  .courses-scroll { padding-bottom: 12px; }
  .lb-table th, .lb-table td { padding: 10px 8px; font-size: 0.78rem; }
  .section-title { font-size: 0.95rem; }
}

/* ── 480px: phones ── */
@media (max-width: 480px) {
  .page-container { padding: 12px; }
  .hero-banner { padding: 18px 16px; }
  .hero-title { font-size: 1.1rem; }
  .hero-actions { flex-direction: column; gap: 8px; }
  .btn-hero-primary, .btn-hero-secondary { width: 100%; justify-content: center; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .dash-grid-4 { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-card { padding: 14px 12px; gap: 10px; }
  .stat-number { font-size: 1.25rem; }
  .stat-icon { width: 36px; height: 36px; font-size: 1rem; }
  .search-wrapper { display: none; }
  .topbar-right .lang-selector { display: none; }
  .um-stats { grid-template-columns: repeat(2, 1fr) !important; }
  .grid-4 { grid-template-columns: 1fr; }
  .notif-panel { width: 100%; border-radius: 0; }
  .recommended-grid { grid-template-columns: 1fr !important; }
}

/* ── 360px: very small phones ── */
@media (max-width: 360px) {
  .stats-grid { grid-template-columns: 1fr; }
  .dash-grid-4 { grid-template-columns: 1fr; }
  .stat-card { padding: 12px; }
  .hero-banner { padding: 16px 14px; }
  .hero-title { font-size: 1rem; }
}

/* =========================================
   OVERLAY
   ========================================= */
.overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 998;
  opacity: 0; pointer-events: none;
  transition: var(--transition);
}
.overlay.active { opacity: 1; pointer-events: all; }

/* =========================================
   SCROLLBAR
   ========================================= */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #CBD5E0; }

/* =========================================
   TOOLTIPS
   ========================================= */
[data-tooltip] { position: relative; }
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%; transform: translateX(-50%);
  background: var(--text-primary);
  color: white;
  font-size: 0.72rem;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  opacity: 0; pointer-events: none;
  transition: var(--transition);
  z-index: 100;
}
[data-tooltip]:hover::after { opacity: 1; }

/* =========================================
   MODAL OVERLAY (shared by all JS modals)
   ========================================= */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 1100;
  display: none;
  align-items: center; justify-content: center;
  padding: 20px;
  overflow-y: auto;
}
.modal-overlay.active {
  display: flex;
}
.modal-box {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  width: 100%;
  position: relative;
  box-shadow: 0 25px 60px rgba(0,0,0,0.28);
  animation: modalIn 0.28s cubic-bezier(0.34,1.56,0.64,1);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}
@keyframes modalIn {
  from { opacity:0; transform: scale(0.92) translateY(16px); }
  to   { opacity:1; transform: scale(1) translateY(0); }
}

/* ── Certificate Preview Modal ─────────────────────────────────────── */
.cert-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0;
  background: var(--bg-card);
  z-index: 2;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}
.cert-modal-header-title {
  font-size: 0.95rem; font-weight: 700; color: var(--text-primary);
  display: flex; align-items: center; gap: 8px;
}
.cert-modal-header-title i { color: var(--primary); }
.cert-modal-body { padding: 28px; }

/* The A4-proportioned certificate card */
.cert-preview-card {
  border-radius: 14px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  position: relative;
  margin-bottom: 22px;
}
.cert-preview-inner {
  padding: 48px 40px 40px;
  color: white;
  text-align: center;
  position: relative;
  min-height: 320px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
/* Decorative watermark rings */
.cert-preview-inner::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 10% 10%, rgba(255,255,255,0.08) 0%, transparent 50%),
    radial-gradient(circle at 90% 90%, rgba(255,255,255,0.06) 0%, transparent 50%);
  pointer-events: none;
}
.cert-header-label {
  font-size: 0.65rem; letter-spacing: 4px; text-transform: uppercase;
  opacity: 0.65; margin-bottom: 6px;
}
.cert-org-name {
  font-size: 1.5rem; font-weight: 800; margin-bottom: 2px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.cert-org-sub {
  font-size: 0.68rem; opacity: 0.6; margin-bottom: 28px;
}
.cert-awarded-to {
  font-size: 0.7rem; opacity: 0.72; margin-bottom: 4px; letter-spacing: 0.05em;
}
.cert-recipient {
  font-size: 1.7rem; font-weight: 800;
  border-bottom: 2px solid rgba(255,255,255,0.35);
  padding-bottom: 8px; margin-bottom: 18px;
  display: inline-block;
  text-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.cert-course-label {
  font-size: 0.7rem; opacity: 0.72; margin-bottom: 6px;
}
.cert-course-name {
  font-size: 1.05rem; font-weight: 700; margin-bottom: 28px;
  max-width: 420px; line-height: 1.4;
}
.cert-footer-row {
  display: flex; justify-content: space-between; align-items: flex-end;
  width: 100%; gap: 20px;
}
.cert-footer-col { text-align: center; flex: 1; }
.cert-footer-col.left { text-align: left; }
.cert-footer-col.right { text-align: right; }
.cert-footer-label { font-size: 0.62rem; opacity: 0.6; margin-bottom: 4px; }
.cert-footer-val { font-size: 0.82rem; font-weight: 700; }
.cert-footer-score {
  font-size: 1.8rem; font-weight: 900; line-height: 1;
  text-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.cert-footer-score-lbl { font-size: 0.62rem; opacity: 0.65; margin-top: 2px; }
.cert-sig-line {
  border-bottom: 1.5px solid rgba(255,255,255,0.35);
  width: 100px; margin: 0 auto 4px;
}
.cert-id-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(0,0,0,0.15);
  padding: 5px 12px; border-radius: 999px;
  font-size: 0.62rem; opacity: 0.75;
  margin-top: 20px;
}

/* Modal action row */
.cert-modal-actions {
  display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
  padding: 0 28px 28px;
}

/* ── Print styles (for PDF) ──────────────────────────────────────── */
@media print {
  body > *:not(#certPrintFrame) { display: none !important; }
  #certPrintFrame { display: block !important; position: static !important; }
}

/* =========================================
   ANIMATIONS
   ========================================= */
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.animate-pulse { animation: pulse 2s infinite; }
.animate-bounce { animation: bounce 1.5s infinite; }

/* Number counter animation */
.count-up { display: inline-block; }

/* XP Bar animation */
.xp-bar {
  height: 10px;
  background: var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: 6px;
}
.xp-fill {
  height: 100%;
  background: var(--gradient-accent);
  border-radius: var(--radius-full);
  transition: width 1.5s cubic-bezier(0.4,0,0.2,1);
}

/* =========================================
   MY LEARNING PAGE — COURSE CARDS
   ========================================= */
.ml-course-card {
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.18s, box-shadow 0.18s;
}
.ml-course-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.ml-card-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
}
/* Thumbnail */
.ml-thumb {
  width: 80px;
  height: 64px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.9rem;
  position: relative;
}
.ml-thumb-done {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-sm);
  background: rgba(22,163,74,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.2rem;
}
/* Body */
.ml-body {
  flex: 1;
  min-width: 0;
}
.ml-title {
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary);
}
.ml-meta {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-bottom: 7px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ml-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 9px;
}
/* Progress bar */
.ml-progress-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ml-progress-bar {
  flex: 1;
  height: 7px;
  background: var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.ml-progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--primary-light), var(--secondary));
  transition: width 0.6s cubic-bezier(0.4,0,0.2,1);
}
.ml-progress-pct {
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
  min-width: 32px;
  text-align: right;
}
/* Action button column */
.ml-action {
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .ml-card-inner { flex-wrap: wrap; }
  .ml-thumb { width: 56px; height: 48px; font-size: 1.4rem; }
  .ml-action { width: 100%; }
  .ml-action .btn { width: 100%; }
}

/* =========================================
   QUIZ SIDEBAR ENTRY
   The locked/unlocked quiz entry at the
   bottom of the syllabus sidebar
   ========================================= */
.quiz-sidebar-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-top: 2px solid var(--border);
  margin-top: 6px;
  cursor: pointer;
  transition: background 0.18s, box-shadow 0.18s;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  user-select: none;
  position: relative;
}
.quiz-sidebar-entry:hover:not(.locked) {
  background: rgba(37, 87, 167, 0.07);
  box-shadow: inset 3px 0 0 var(--primary-light);
}
.quiz-sidebar-entry.active {
  background: rgba(37, 87, 167, 0.11);
  box-shadow: inset 3px 0 0 var(--primary);
}
.quiz-sidebar-entry.locked {
  cursor: not-allowed;
  opacity: 0.55;
  background: transparent;
}

/* Icon circle */
.qse-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(37, 87, 167, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: background 0.18s;
}
.quiz-sidebar-entry.locked .qse-icon {
  background: rgba(113, 128, 150, 0.12);
}
.quiz-sidebar-entry:hover:not(.locked) .qse-icon {
  background: rgba(37, 87, 167, 0.18);
}
.quiz-sidebar-entry.active .qse-icon {
  background: rgba(37, 87, 167, 0.2);
}

/* Body text */
.qse-body {
  flex: 1;
  min-width: 0;
}
.qse-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}
.quiz-sidebar-entry.locked .qse-label {
  color: var(--text-muted);
}
.qse-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Chevron arrow */
.qse-arrow {
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform 0.18s;
}
.quiz-sidebar-entry:hover:not(.locked) .qse-arrow {
  color: var(--primary-light);
  transform: translateX(2px);
}

/* =========================================
   QUIZ AREA WRAPPER
   Full-area quiz panel replacing the tab+
   video area when quiz is open
   ========================================= */
#quizArea {
  padding: 0;
}
.quiz-area-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.quiz-area-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  position: sticky;
  top: 0;
  z-index: 10;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.quiz-area-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  flex: 1;
}
