/**
 * YouTube Education Plugin - Stylesheet
 * Strictly isolated with ytedu- prefix
 */

:root {
  --ytedu-primary: #0284c7;
  --ytedu-primary-hover: #0369a1;
  --ytedu-accent: #38bdf8;
  --ytedu-bg-dark: #070e1b;
  --ytedu-card-bg: #ffffff;
  --ytedu-card-border: #e2e8f0;
  --ytedu-text-dark: #0f172a;
  --ytedu-text-muted: #64748b;
  --ytedu-radius: 14px;
}

/* 1. HERO BANNER */
.ytedu-hero {
  position: relative;
  background-color: var(--ytedu-bg-dark);
  background-image: url('../images/hero-bg.webp');
  background-size: cover;
  background-position: center;
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 2rem;
  box-shadow: 0 10px 30px -10px rgba(2, 132, 199, 0.25);
  min-height: 380px;
  display: flex;
  align-items: center;
}

/* The hero is dark in both themes, so keep this outlined button readable. */
.ytedu-explore-topics,
.ytedu-explore-topics i {
    color: #fff !important;
}

.ytedu-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(7, 14, 27, 0.94) 0%, rgba(7, 14, 27, 0.85) 45%, rgba(7, 14, 27, 0.2) 100%);
  z-index: 1;
}

.ytedu-hero-content {
  position: relative;
  z-index: 2;
  padding: 3rem 2.5rem;
  max-width: 640px;
}

.ytedu-hero-badge {
  display: inline-flex;
  align-items: center;
  background: rgba(2, 132, 199, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
  backdrop-filter: blur(8px);
  padding: 0.35rem 0.9rem;
  border-radius: 50px;
  font-size: 0.825rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}

.ytedu-hero-title {
  color: #ffffff;
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.ytedu-hero-title span {
  background: linear-gradient(135deg, #38bdf8 0%, #818cf8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.ytedu-hero-subtitle {
  color: #cbd5e1;
  font-size: 1.05rem;
  line-height: 1.55;
  margin-bottom: 1.75rem;
  font-weight: 400;
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

.ytedu-hero-character {
  position: absolute;
  right: 1.5rem;
  bottom: 0;
  height: 98%;
  max-height: 380px;
  z-index: 2;
  pointer-events: none;
  filter: drop-shadow(0 15px 25px rgba(0, 0, 0, 0.6));
  transition: transform 0.4s ease;
}

.ytedu-hero:hover .ytedu-hero-character {
  transform: translateY(-4px) scale(1.01);
}

.ytedu-search-form {
  position: relative;
  max-width: 480px;
  margin-bottom: 1.25rem;
}

.ytedu-search-input {
  width: 100%;
  padding: 0.85rem 3.25rem 0.85rem 1.25rem;
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid transparent;
  border-radius: 50px;
  font-size: 0.95rem;
  color: #0f172a;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  transition: all 0.25s ease;
}

.ytedu-search-input:focus {
  background: #ffffff;
  border-color: #38bdf8;
  outline: none;
  box-shadow: 0 8px 25px rgba(2, 132, 199, 0.35);
}

.ytedu-search-btn {
  position: absolute;
  right: 6px;
  top: 6px;
  bottom: 6px;
  width: 42px;
  border-radius: 50px;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ytedu-search-btn:hover {
  background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
  transform: scale(1.05);
}

/* 2. CATEGORY CAROUSEL & CHIPS */
.ytedu-categories-section {
  margin-bottom: 2.5rem;
}

.ytedu-carousel-container {
  position: relative;
  display: flex;
  align-items: center;
}

.ytedu-carousel-track {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 0.5rem 0.25rem 1rem 0.25rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.ytedu-carousel-track::-webkit-scrollbar {
  display: none;
}

.ytedu-carousel-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 3;
  color: #475569;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.ytedu-carousel-btn:hover {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}

.ytedu-cat-card {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 1.15rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 50px;
  text-decoration: none !important;
  color: #334155;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.ytedu-cat-card i {
  color: #0284c7;
  font-size: 0.95rem;
  transition: transform 0.2s ease;
}

.ytedu-cat-card:hover {
  background: #f0f9ff;
  border-color: #bae6fd;
  color: #0284c7;
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(2, 132, 199, 0.12);
}

.ytedu-cat-card:hover i {
  transform: scale(1.15);
}

.ytedu-cat-card.active {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff !important;
  border-color: #0284c7;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}

.ytedu-cat-card.active i {
  color: #ffffff;
}

body.night-mode .ytedu-categories-section .ytedu-cat-card:not(.active),
body[data-bs-theme="dark"] .ytedu-categories-section .ytedu-cat-card:not(.active) {
  color: #000000 !important;
}

/* 3. 16:9 VIDEO CARDS */
.ytedu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.ytedu-card {
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.25s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.ytedu-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px -6px rgba(15, 23, 42, 0.12);
  border-color: #cbd5e1;
}

.ytedu-card-thumb-link {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0f172a;
  overflow: hidden;
}

.ytedu-card-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.ytedu-card:hover .ytedu-card-thumb {
  transform: scale(1.05);
}

.ytedu-duration-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(4px);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 4px;
  letter-spacing: 0.3px;
  z-index: 2;
}

.ytedu-play-overlay {
  position: absolute;
  inset: 0;
  background: rgba(2, 132, 199, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
  z-index: 2;
}

.ytedu-play-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #ffffff;
  color: #0284c7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
  transform: scale(0.85);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.ytedu-card:hover .ytedu-play-overlay {
  opacity: 1;
}

.ytedu-card:hover .ytedu-play-icon {
  transform: scale(1);
}

.ytedu-card-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.ytedu-card-cat-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: #0284c7;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 0.4rem;
  text-decoration: none !important;
}

.ytedu-card-cat-badge:hover {
  color: #0369a1;
}

.ytedu-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.35;
  color: #0f172a;
  margin-bottom: 0.65rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 2.6em;
}

.ytedu-card-title a {
  color: inherit !important;
  text-decoration: none !important;
}

.ytedu-card-title a:hover {
  color: #0284c7 !important;
}

.ytedu-card-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.775rem;
  color: #64748b;
  padding-top: 0.65rem;
  border-top: 1px solid #f1f5f9;
}

.ytedu-card-views {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* Video grid: dark surfaces must accompany the existing light text colors. */
body.night-mode .kizmio-education-page .ytedu-grid .ytedu-card,
[data-bs-theme="dark"] .kizmio-education-page .ytedu-grid .ytedu-card {
  background: linear-gradient(145deg, #0b1728 0%, #101d31 100%) !important;
  border-color: #263a57 !important;
  color: #e6edf8;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.3);
}

body.night-mode .kizmio-education-page .ytedu-grid .ytedu-card:hover,
[data-bs-theme="dark"] .kizmio-education-page .ytedu-grid .ytedu-card:hover {
  border-color: #258bc5 !important;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.42), 0 0 15px rgba(56, 189, 248, 0.12);
}

body.night-mode .kizmio-education-page .ytedu-grid .ytedu-card-title,
body.night-mode .kizmio-education-page .ytedu-grid .ytedu-card-title a,
[data-bs-theme="dark"] .kizmio-education-page .ytedu-grid .ytedu-card-title,
[data-bs-theme="dark"] .kizmio-education-page .ytedu-grid .ytedu-card-title a {
  color: #f8fafc !important;
}

body.night-mode .kizmio-education-page .ytedu-grid .ytedu-card-footer,
[data-bs-theme="dark"] .kizmio-education-page .ytedu-grid .ytedu-card-footer {
  border-top-color: #263a57;
  color: #aebbd0;
}

body.night-mode .kizmio-education-page .ytedu-grid .ytedu-card .badge.bg-light,
[data-bs-theme="dark"] .kizmio-education-page .ytedu-grid .ytedu-card .badge.bg-light {
  background: #16263d !important;
  border-color: #324966 !important;
  color: #cbd7e8 !important;
}

body.night-mode .kizmio-education-page .ytedu-grid > .bg-white,
[data-bs-theme="dark"] .kizmio-education-page .ytedu-grid > .bg-white {
  background: #0b1728 !important;
  border-color: #263a57 !important;
}

body.night-mode .kizmio-education-page .ytedu-grid > .bg-white .text-dark,
[data-bs-theme="dark"] .kizmio-education-page .ytedu-grid > .bg-white .text-dark {
  color: #f8fafc !important;
}

/* 4. CINEMA WATCH PAGE */
.ytedu-player-wrapper {
  background: #000000;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.3);
}

.ytedu-player-ratio {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
}

.ytedu-player-iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* 5. RESPONSIVE DESIGN */
@media (max-width: 991.98px) {
  .ytedu-hero-character {
    opacity: 0.4;
    right: -2rem;
    max-height: 320px;
  }
  .ytedu-hero-title {
    font-size: 2.1rem;
  }
}

@media (max-width: 767.98px) {
  .ytedu-hero {
    min-height: auto;
    border-radius: 14px;
  }
  .ytedu-hero-content {
    padding: 2rem 1.25rem;
    max-width: 100%;
  }
  .ytedu-hero-character {
    display: none;
  }
  .ytedu-hero-title {
    font-size: 1.75rem;
  }
  .ytedu-hero-subtitle {
    font-size: 0.925rem;
  }
  .ytedu-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
  }
}

/* ==========================================================================
   OFFCANVAS SIDEBAR (MOBILE DRAWER LIKE BLOGS)
   ========================================================================== */
.education-sidebar-backdrop {
  display: none;
}

.ytedu-mobile-bar {
  background: var(--kzm-surface, #ffffff);
  border: 1px solid var(--kzm-border, #e2e8f0);
}

body.night-mode .ytedu-mobile-bar,
[data-bs-theme="dark"] .ytedu-mobile-bar {
  background: #0B1933 !important;
  border-color: rgba(2, 132, 199, 0.25) !important;
}

body.night-mode .ytedu-mobile-bar span,
[data-bs-theme="dark"] .ytedu-mobile-bar span {
  color: #F8FAFC !important;
}

@media (max-width: 767.98px) {
  .kizmio-education-page.sg-offcanvas {
    overflow: visible !important;
  }

  .kizmio-education-page.sg-offcanvas.active {
    position: relative !important;
    z-index: 1000000 !important;
    isolation: isolate;
    overflow: visible !important;
    min-height: max-content !important;
  }

  .kizmio-education-page .sg-offcanvas-sidebar {
    position: fixed !important;
    inset: 0 auto 0 0 !important;
    display: block !important;
    width: min(88vw, 340px) !important;
    max-width: 88vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    padding: 16px 14px 80px !important;
    overflow-x: hidden !important;
    overflow-y: scroll !important;
    background: var(--bs-body-bg, #fff) !important;
    box-shadow: 0 0 40px rgba(15, 23, 42, .3) !important;
    z-index: 2 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    touch-action: pan-y;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: #0284c7 transparent;
    transform: translateX(-105%) !important;
    transition: transform .28s cubic-bezier(.16, 1, .3, 1), visibility .28s !important;
  }

  body.night-mode .kizmio-education-page .sg-offcanvas-sidebar,
  [data-bs-theme="dark"] .kizmio-education-page .sg-offcanvas-sidebar {
    background: #081326 !important;
    border-right: 1px solid rgba(2, 132, 199, 0.28) !important;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.8) !important;
  }

  .kizmio-education-page.sg-offcanvas.active .sg-offcanvas-sidebar {
    left: 0 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: translateX(0) !important;
  }

  .kizmio-education-page.sg-offcanvas.active .sg-offcanvas-sidebar * {
    pointer-events: auto;
  }

  .kizmio-education-page .sg-offcanvas-sidebar::-webkit-scrollbar {
    width: 5px;
  }

  .kizmio-education-page .sg-offcanvas-sidebar::-webkit-scrollbar-track {
    background: transparent;
  }

  .kizmio-education-page .sg-offcanvas-sidebar::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: #0284c7;
  }

  .kizmio-education-page .sg-offcanvas-sidebar::-webkit-scrollbar-thumb:hover {
    background: #0369a1;
  }

  .kizmio-education-page .sg-offcanvas-mainbar,
  .kizmio-education-page.sg-offcanvas.active .sg-offcanvas-mainbar {
    position: static !important;
    left: 0 !important;
    width: 100% !important;
  }

  .kizmio-education-page .education-sidebar-backdrop {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 1;
    background: rgba(15, 23, 42, .55);
    pointer-events: auto;
  }

  .kizmio-education-page.sg-offcanvas.active .education-sidebar-backdrop {
    display: block;
  }
}

/* ==========================================================================
   6. KIZMIO CUSTOM CINEMA PLAYER CONTROLS (EDUCATION THEME #0284c7)
   ========================================================================== */
.ytedu-player-wrapper {
  position: relative !important;
  background: #000000 !important;
  border-radius: 16px !important;
  overflow: hidden !important;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.45) !important;
  user-select: none;
}

.ytedu-player-wrapper.is-fullscreen {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: none !important;
  max-height: none !important;
  z-index: 999999 !important;
  border-radius: 0 !important;
  margin: 0 !important;
}

.ytedu-player-wrapper.is-fullscreen .ytedu-player-ratio {
  width: 100vw !important;
  height: 100vh !important;
  aspect-ratio: auto !important;
}

.ytedu-player-wrapper.is-controls-hidden {
  cursor: none !important;
}

.ytedu-player-wrapper.is-controls-hidden .kzm-controls-bar,
.ytedu-player-wrapper.is-controls-hidden .kzm-resume-banner {
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Player Overlay Layer */
.kzm-player-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
}

/* Hit Area for Video Tapping */
.kzm-player-hit-area {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  cursor: pointer;
  pointer-events: auto;
}

/* Center Controls & Big Play Button */
.kzm-center-controls {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.kzm-center-controls.is-playing {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.85);
}

.kzm-center-play-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(12px);
  border: 2px solid rgba(255, 255, 255, 0.35);
  color: #ffffff;
  font-size: 24px;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 25px rgba(2, 132, 199, 0.35);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.kzm-center-play-btn:hover {
  background: #0284c7;
  border-color: #ffffff;
  transform: scale(1.1);
  box-shadow: 0 12px 35px rgba(2, 132, 199, 0.6);
}

/* Feedback Badge (+10s / -10s) */
.kzm-feedback-badge {
  position: absolute;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  opacity: 0;
  transform: scale(0.7);
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.kzm-feedback-badge.show {
  opacity: 1;
  transform: scale(1);
}

/* Resume Banner */
.kzm-resume-banner {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  max-width: 480px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 8px 14px;
  color: #ffffff;
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  pointer-events: auto;
  transition: opacity 0.4s ease;
}

.kzm-resume-banner.fade-out {
  opacity: 0;
}

/* Bottom Controls Bar */
.kzm-controls-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 15;
  padding: 24px 18px 12px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.6) 60%, transparent 100%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: auto;
  transition: opacity 0.25s ease;
}

/* Progress / Seek Bar */
.kzm-progress-container {
  position: relative;
  width: 100%;
  height: 18px;
  display: flex;
  align-items: center;
  cursor: pointer;
  outline: none;
}

.kzm-progress-bg {
  position: relative;
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  overflow: hidden;
  transition: height 0.15s ease;
}

.kzm-progress-container:hover .kzm-progress-bg {
  height: 8px;
}

.kzm-progress-buffer {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: rgba(255, 255, 255, 0.38);
  border-radius: 999px;
  transition: width 0.2s linear;
}

.kzm-progress-played {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #0284c7, #38bdf8);
  box-shadow: 0 0 10px rgba(2, 132, 199, 0.7);
  border-radius: 999px;
  z-index: 2;
}

.kzm-progress-thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #0284c7;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.15s ease;
  z-index: 3;
}

.kzm-progress-container:hover .kzm-progress-thumb {
  transform: translate(-50%, -50%) scale(1);
}

.kzm-progress-tooltip {
  position: absolute;
  bottom: 22px;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.95);
  color: #ffffff;
  padding: 3px 7px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  white-space: nowrap;
}

/* Server-verified watch completion progress */
.ytedu-watch-progress{display:flex;align-items:center;gap:14px;width:100%;margin:0 0 1.25rem;padding:16px 18px;border:1px solid rgba(34,211,238,.62);border-radius:17px;background:radial-gradient(circle at 8% 10%,rgba(34,211,238,.2),transparent 34%),linear-gradient(135deg,#071426 0%,#211044 58%,#35103e 100%);color:#e0f2fe;box-shadow:0 0 0 1px rgba(168,85,247,.14),0 0 24px rgba(34,211,238,.17),inset 0 0 22px rgba(168,85,247,.1)}
.ytedu-watch-progress__icon{display:grid;width:48px;height:48px;place-items:center;flex:0 0 48px;border-radius:14px;background:linear-gradient(135deg,#22d3ee,#8b5cf6,#ec4899);color:#fff;font-size:20px;box-shadow:0 0 13px rgba(34,211,238,.72),0 0 25px rgba(168,85,247,.42)}
.ytedu-watch-progress__body{flex:1;min-width:0}.ytedu-watch-progress__heading{display:flex;align-items:center;justify-content:space-between;gap:12px}.ytedu-watch-progress__heading strong{color:#fff;font-size:15px;text-shadow:0 0 10px rgba(34,211,238,.55)}.ytedu-watch-progress__heading b{color:#f0abfc;font-size:14px}.ytedu-watch-progress p{margin:2px 0 9px;color:#c4b5fd;font-size:12px}
.ytedu-watch-progress__track{height:11px;overflow:hidden;border:1px solid rgba(103,232,249,.38);border-radius:999px;background:rgba(2,6,23,.78);box-shadow:inset 0 1px 4px rgba(0,0,0,.65)}.ytedu-watch-progress__track span{display:block;width:0;height:100%;border-radius:inherit;background:linear-gradient(90deg,#22d3ee,#8b5cf6 55%,#ec4899);box-shadow:0 0 10px #22d3ee,0 0 18px #a855f7;transition:width .45s ease}
.ytedu-watch-progress.is-completed{border-color:rgba(52,211,153,.72);box-shadow:0 0 24px rgba(16,185,129,.28),inset 0 0 24px rgba(34,197,94,.1)}.ytedu-watch-progress.is-completed .ytedu-watch-progress__icon{background:linear-gradient(135deg,#10b981,#22d3ee);box-shadow:0 0 17px rgba(16,185,129,.7)}
@media(max-width:575px){.ytedu-watch-progress{align-items:flex-start;padding:14px}.ytedu-watch-progress__icon{width:42px;height:42px;flex-basis:42px}}

/* Controls Row */
.kzm-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.kzm-controls-left,
.kzm-controls-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Control Buttons */
.kzm-ctrl-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: #ffffff;
  font-size: 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.kzm-ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  transform: scale(1.05);
}

.kzm-ctrl-btn:active {
  transform: scale(0.95);
}

/* Volume Group */
.kzm-volume-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.kzm-volume-slider-wrap {
  width: 65px;
  display: flex;
  align-items: center;
}

.kzm-volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  outline: none;
  cursor: pointer;
}

.kzm-volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #0284c7;
  cursor: pointer;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.5);
}

.kzm-volume-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #0284c7;
  cursor: pointer;
  border: none;
}

/* Time Display */
.kzm-time-display {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  margin-left: 6px;
}

.kzm-time-sep {
  opacity: 0.5;
}

/* Actual Watched Time Badge */
.kzm-watch-stats {
  display: inline-flex;
  align-items: center;
  background: rgba(2, 132, 199, 0.2);
  border: 1px solid rgba(2, 132, 199, 0.4);
  color: #7dd3fc;
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  margin-right: 4px;
}

/* Speed Dropdown */
.kzm-speed-btn {
  font-size: 13px !important;
  font-weight: 700 !important;
  width: auto !important;
  padding: 0 8px !important;
}

.kzm-speed-menu {
  position: absolute;
  bottom: 42px;
  right: 0;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  min-width: 120px;
  z-index: 30;
}

.kzm-speed-item {
  display: block;
  width: 100%;
  padding: 6px 12px;
  border: none;
  background: transparent;
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 600;
  text-align: left;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.kzm-speed-item:hover {
  background: rgba(255, 255, 255, 0.12);
}

.kzm-speed-item.active {
  background: #0284c7;
  color: #ffffff;
}

/* Hover link color */
.hover-primary:hover {
  color: #0284c7 !important;
}

/* Watch Later Page Cards */
.ytedu-thumb-link {
  border-radius: 12px 12px 0 0;
  overflow: hidden;
}

.ytedu-thumb-link .ytedu-play-overlay {
  opacity: 0;
  background: rgba(0, 0, 0, 0.35);
  transition: opacity 0.2s ease;
}

.ytedu-thumb-link:hover .ytedu-play-overlay {
  opacity: 1;
}

/* Mobile Adjustments */
@media (max-width: 576px) {
  .kzm-controls-bar {
    padding: 18px 10px 8px;
  }
  .kzm-volume-slider-wrap {
    display: none;
  }
  .kzm-time-display {
    font-size: 11px;
    margin-left: 2px;
  }
  .kzm-ctrl-btn {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }
  .kzm-center-play-btn {
    width: 54px;
    height: 54px;
    font-size: 20px;
  }
}

/* ==========================================================================
   COURSE VIEW & CURRICULUM PLAYLIST STYLES (MATCHING DEMO UI)
   ========================================================================== */

/* Course Hero Section */
.ytedu-course-hero {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #38bdf8 100%);
  color: #ffffff;
  box-shadow: 0 10px 30px -5px rgba(37, 99, 235, 0.3);
}

.ytedu-hero-backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 85% 20%, rgba(244, 63, 94, 0.25) 0%, transparent 50%),
              radial-gradient(circle at 20% 80%, rgba(56, 189, 248, 0.2) 0%, transparent 60%);
  pointer-events: none;
}

body.night-mode .ytedu-course-hero,
[data-bs-theme="dark"] .ytedu-course-hero {
  background: linear-gradient(135deg, #091938 0%, #0d2859 50%, #173b7a 100%) !important;
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.6) !important;
}

.ytedu-course-title {
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.ytedu-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #ffffff;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Course Sidebar */
.ytedu-course-sidebar {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid #e2e8f0 !important;
  max-height: calc(100vh - 105px);
  overflow: hidden;
  scrollbar-width: thin;
  scrollbar-color: #0284c7 transparent;
}

.ytedu-sidebar-card,
.ytedu-sidebar-actions {
  flex: 0 0 auto;
}

.ytedu-sidebar-playlist {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 2px 5px 2px 2px;
  scrollbar-width: thin;
  scrollbar-color: #0284c7 transparent;
}

/* `gap-1.5` is not a Bootstrap utility, so define consistent lesson spacing. */
.ytedu-sidebar-playlist > .d-flex {
  gap: 8px !important;
}

.ytedu-sidebar-actions {
  position: relative;
  z-index: 2;
  background: inherit;
}

.ytedu-sidebar-playlist::-webkit-scrollbar {
  width: 5px;
}

.ytedu-sidebar-playlist::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(2, 132, 199, 0.65);
}

@media (max-width: 991.98px) {
  .ytedu-course-sidebar {
    position: static !important;
    max-height: none;
    overflow: visible;
  }

  .ytedu-sidebar-playlist {
    max-height: 420px;
  }
}

body.night-mode .ytedu-course-sidebar,
[data-bs-theme="dark"] .ytedu-course-sidebar {
  background: #0B1933 !important;
  border-color: rgba(2, 132, 199, 0.25) !important;
}

.ytedu-sidebar-cover-wrap {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.ytedu-progress-bar-wrap {
  background: #e2e8f0;
}

body.night-mode .ytedu-progress-bar-wrap,
[data-bs-theme="dark"] .ytedu-progress-bar-wrap {
  background: rgba(255, 255, 255, 0.1) !important;
}

/* Lesson Pills in Sidebar */
.ytedu-lesson-pill {
  width: 100%;
  border: none;
  background: #f8fafc;
  color: #334155;
  padding: 9px 12px;
  border-radius: 12px;
  font-weight: 500;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
}

.ytedu-lesson-pill:hover {
  background: #f1f5f9;
  color: #0f172a;
}

body.night-mode .ytedu-lesson-pill,
[data-bs-theme="dark"] .ytedu-lesson-pill {
  background: rgba(255, 255, 255, 0.04);
  color: #94a3b8;
}

body.night-mode .ytedu-lesson-pill:hover,
[data-bs-theme="dark"] .ytedu-lesson-pill:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #f8fafc;
}

/* Active Lesson Pill (Selected/Playing) */
.ytedu-lesson-pill.active {
  background: #0284c7 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
}

.ytedu-lesson-pill.active .ytedu-pill-title {
  color: #ffffff !important;
  font-weight: 600;
}

/* Icon in Pill */
.ytedu-pill-icon-wrap {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  background: rgba(0, 0, 0, 0.06);
  color: #64748b;
  transition: all 0.2s ease;
}

body.night-mode .ytedu-pill-icon-wrap,
[data-bs-theme="dark"] .ytedu-pill-icon-wrap {
  background: rgba(255, 255, 255, 0.1);
  color: #94a3b8;
}

.ytedu-lesson-pill .ytedu-icon-check {
  display: none;
}

.ytedu-lesson-pill.is-completed .ytedu-icon-play {
  display: none;
}

.ytedu-lesson-pill.is-completed .ytedu-icon-check {
  display: inline-block;
}

.ytedu-lesson-pill.is-completed .ytedu-pill-icon-wrap {
  background: #10b981;
  color: #ffffff;
}

.ytedu-lesson-pill.active .ytedu-pill-icon-wrap {
  background: #ffffff;
  color: #0284c7;
}

.ytedu-lesson-pill.active.is-completed .ytedu-pill-icon-wrap {
  background: #ffffff;
  color: #10b981;
}

/* Lesson Details Card Beside Player */
.ytedu-lesson-info-panel {
  background: #ffffff;
  border: 1px solid #e2e8f0 !important;
}

body.night-mode .ytedu-lesson-info-panel,
[data-bs-theme="dark"] .ytedu-lesson-info-panel {
  background: #0B1933 !important;
  border-color: rgba(2, 132, 199, 0.25) !important;
}

body.night-mode .ytedu-lesson-info-panel h2,
[data-bs-theme="dark"] .ytedu-lesson-info-panel h2 {
  color: #f8fafc !important;
}

body.night-mode .ytedu-lesson-info-panel .text-secondary,
[data-bs-theme="dark"] .ytedu-lesson-info-panel .text-secondary {
  color: #94a3b8 !important;
}

/* Completed Button Styling */
.js-btn-complete-lesson.is-completed {
  background: #10b981 !important;
  border-color: #10b981 !important;
  color: #ffffff !important;
}

/* Lower Section: All Videos in This Course */
.ytedu-all-videos-section {
  background: #ffffff;
  border: 1px solid #e2e8f0 !important;
}

body.night-mode .ytedu-all-videos-section,
[data-bs-theme="dark"] .ytedu-all-videos-section {
  background: #0B1933 !important;
  border-color: rgba(2, 132, 199, 0.25) !important;
}

body.night-mode .ytedu-all-videos-section h3,
[data-bs-theme="dark"] .ytedu-all-videos-section h3 {
  color: #f8fafc !important;
}

/* Lesson Card in Grid */
.ytedu-lesson-card {
  background: #ffffff;
  border: 2px solid transparent;
  border-radius: 14px;
  padding: 6px;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.ytedu-lesson-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px -4px rgba(0, 0, 0, 0.12);
}

body.night-mode .ytedu-lesson-card,
[data-bs-theme="dark"] .ytedu-lesson-card {
  background: #081326;
  border-color: rgba(255, 255, 255, 0.06);
}

body.night-mode .ytedu-lesson-card:hover,
[data-bs-theme="dark"] .ytedu-lesson-card:hover {
  border-color: rgba(2, 132, 199, 0.4);
  box-shadow: 0 8px 25px -4px rgba(0, 0, 0, 0.6);
}

/* Active Highlight on Grid Lesson Card */
.ytedu-lesson-card.is-active {
  border-color: #0284c7 !important;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.25), 0 8px 20px -4px rgba(2, 132, 199, 0.3) !important;
}

body.night-mode .ytedu-lesson-card.is-active,
[data-bs-theme="dark"] .ytedu-lesson-card.is-active {
  border-color: #38bdf8 !important;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25), 0 0 20px rgba(56, 189, 248, 0.3) !important;
}

.ytedu-lesson-card.is-active .ytedu-card-title {
  color: #0284c7 !important;
}

body.night-mode .ytedu-lesson-card.is-active .ytedu-card-title,
[data-bs-theme="dark"] .ytedu-lesson-card.is-active .ytedu-card-title {
  color: #38bdf8 !important;
}

body.night-mode .ytedu-card-title,
[data-bs-theme="dark"] .ytedu-card-title {
  color: #f1f5f9 !important;
}

/* Badges on Card Thumbnail */
.ytedu-badge-num {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.85);
  color: #ffffff;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-weight: 600;
}

.ytedu-badge-check {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #10b981 !important;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.4);
}

.ytedu-badge-dur {
  border-radius: 6px;
  padding: 3px 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* List View for Lessons Grid */
.ytedu-lessons-grid-view.is-list-view {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
}

.ytedu-lessons-grid-view.is-list-view .col {
  width: 100% !important;
  max-width: 100% !important;
}

.ytedu-lessons-grid-view.is-list-view .ytedu-lesson-card {
  display: flex !important;
  align-items: center !important;
  gap: 16px !important;
  padding: 10px 14px !important;
}

.ytedu-lessons-grid-view.is-list-view .ytedu-card-thumb-wrap {
  width: 130px !important;
  min-width: 130px !important;
  margin-bottom: 0 !important;
}

/* Course Distinction in Listing Grid */
.ytedu-course-badge {
  background: linear-gradient(135deg, #2563eb, #7c3aed) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  letter-spacing: 0.04em !important;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

.ytedu-course-icon {
  background: rgba(37, 99, 235, 0.9) !important;
}

/* Content Type Switcher in Add Form */
.ytedu-type-card {
  background: #ffffff;
  border-color: #cbd5e1 !important;
  transition: all 0.2s ease;
}

.ytedu-type-card:hover {
  border-color: #0284c7 !important;
}

.ytedu-type-card.active {
  border-color: #0284c7 !important;
  background: rgba(2, 132, 199, 0.06) !important;
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.2);
}

body.night-mode .ytedu-type-card,
[data-bs-theme="dark"] .ytedu-type-card {
  background: #081326;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

body.night-mode .ytedu-type-card.active,
[data-bs-theme="dark"] .ytedu-type-card.active {
  background: rgba(2, 132, 199, 0.15) !important;
  border-color: #38bdf8 !important;
}

/* Dynamic Lesson Rows in Add/Edit Course */
.ytedu-lesson-row {
  border-color: #e2e8f0 !important;
  transition: background-color 0.2s ease;
}

body.night-mode .ytedu-lesson-row,
[data-bs-theme="dark"] .ytedu-lesson-row {
  background: #0B1933 !important;
  border-color: rgba(2, 132, 199, 0.2) !important;
}

body.night-mode .ytedu-lesson-row label,
[data-bs-theme="dark"] .ytedu-lesson-row label {
  color: #e2e8f0 !important;
}

/* Category carousel night mode. */
body.night-mode .kizmio-education-page .ytedu-carousel-track,
body[data-bs-theme="dark"] .kizmio-education-page .ytedu-carousel-track {
  background: #081326 !important;
  border: 1px solid rgba(56, 189, 248, .14);
  border-radius: 16px;
  color: #e2e8f0 !important;
  padding: .65rem .5rem 1rem;
}

body.night-mode .kizmio-education-page .ytedu-carousel-track .ytedu-cat-card:not(.active),
body[data-bs-theme="dark"] .kizmio-education-page .ytedu-carousel-track .ytedu-cat-card:not(.active) {
  background: #101d32 !important;
  border-color: #283a53 !important;
  color: #e2e8f0 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .28);
}

body.night-mode .kizmio-education-page .ytedu-carousel-track .ytedu-cat-card:not(.active):hover,
body[data-bs-theme="dark"] .kizmio-education-page .ytedu-carousel-track .ytedu-cat-card:not(.active):hover {
  background: #152640 !important;
  border-color: #38bdf8 !important;
  color: #7dd3fc !important;
  box-shadow: 0 0 14px rgba(56, 189, 248, .2);
}

body.night-mode .kizmio-education-page .ytedu-carousel-btn,
body[data-bs-theme="dark"] .kizmio-education-page .ytedu-carousel-btn {
  background: #101d32;
  border-color: #283a53;
  color: #cbd5e1;
}

/* Video sort pills in night mode. */
body.night-mode .kizmio-education-page .ytedu-sort-pills,
body[data-bs-theme="dark"] .kizmio-education-page .ytedu-sort-pills {
  background: #081326 !important;
  border-color: #283a53 !important;
}

body.night-mode .kizmio-education-page .ytedu-sort-pills .btn-light,
body[data-bs-theme="dark"] .kizmio-education-page .ytedu-sort-pills .btn-light {
  background: #101d32 !important;
  border-color: transparent !important;
  color: #cbd5e1 !important;
}

body.night-mode .kizmio-education-page .ytedu-sort-pills .btn-light:hover,
body[data-bs-theme="dark"] .kizmio-education-page .ytedu-sort-pills .btn-light:hover {
  background: #152640 !important;
  color: #7dd3fc !important;
}
