/* ==========================================================================
   DeX Learning Centre - Quick Guides (Lite Version) Dedicated Stylesheet
   Strict Colakin Brand Colors: Pure White, Brand Blue, Soft Blue, Amber/Gold.
   Strictly No Dark Mode or Black Backgrounds on Cards & Banners.
   Font: Poppins Throughout.
   YouTube-Style Right Sidebar Architecture:
   1. Top Card: Current Chapter Episodes (Exact same height as the Video Player window card)
   2. Bottom Section: Next Chapters / More Quick Guides (Exact same height and starting line as Description Card, internally scrollable)
   ========================================================================== */

/* Right Column Sidebar Wrapper */
.quickguides-right-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0px !important;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

/* ==========================================================================
   1. TOP CARD: CURRENT CHAPTER EPISODES PLAYLIST
   Exact same height as .player-window-card in desktop view
   ========================================================================== */
.quickguides-right-sidebar .yt-playlist-sidebar,
.yt-episodes-playlist-card {
  position: static !important;
  top: auto !important;
  width: 100% !important;
  margin: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  background: #ffffff !important;
  border-radius: 18px !important;
  border: 1px solid rgba(226, 232, 240, 0.95) !important;
  box-shadow:
    0 24px 55px -12px rgba(15, 23, 42, 0.10),
    0 4px 16px -2px rgba(15, 23, 42, 0.04),
    inset 0 1px 1px #ffffff !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
  transition: all 0.25s ease;
}

@media (min-width: 1024px) {
  .quickguides-right-sidebar .yt-playlist-sidebar,
  .yt-episodes-playlist-card {
    height: 485px; /* Synchronized dynamically via JS ResizeObserver */
    max-height: 485px !important;
    min-height: 380px;
  }
}

@media (max-width: 1023px) {
  .quickguides-right-sidebar .yt-playlist-sidebar,
  .yt-episodes-playlist-card {
    height: auto !important;
    max-height: 380px !important;
    margin-bottom: 20px !important;
  }
}

/* Playlist Header (Matching Masterclass Aesthetic) */
.quickguides-right-sidebar .yt-playlist-header {
  padding: 16px 18px 14px !important;
  background: #f8fafc !important;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9) !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
  flex-shrink: 0 !important;
}

.quickguides-right-sidebar .yt-playlist-header-top {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
}

.yt-sidebar-section-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.yt-sidebar-section-icon {
  width: 16px;
  height: 16px;
  color: #1e40af;
  flex-shrink: 0;
}

.quickguides-right-sidebar .yt-playlist-title {
  font-size: 15px !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  margin: 0 !important;
  letter-spacing: -0.01em !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.quickguides-right-sidebar .yt-playlist-count-badge {
  font-size: 10.5px !important;
  font-weight: 700 !important;
  color: #2563eb !important;
  background: #eff6ff !important;
  border: 1px solid rgba(37, 99, 235, 0.2) !important;
  padding: 3px 8px !important;
  border-radius: 9999px !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

.quickguides-right-sidebar .yt-playlist-sub {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  font-size: 12px !important;
  color: #64748b !important;
  font-weight: 600 !important;
}

/* Scrollable Playlist Items List */
.quickguides-right-sidebar .yt-playlist-items-list {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  padding: 10px 8px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
  scrollbar-width: thin !important;
  scrollbar-color: rgba(148, 163, 184, 0.35) transparent !important;
}

.quickguides-right-sidebar .yt-playlist-items-list::-webkit-scrollbar {
  width: 5px;
}

.quickguides-right-sidebar .yt-playlist-items-list::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.35);
  border-radius: 6px;
}

/* Playlist Episode Item Card */
.quickguides-right-sidebar .yt-playlist-item {
  display: grid !important;
  grid-template-columns: 24px 110px minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 8px 10px !important;
  border-radius: 12px !important;
  text-decoration: none !important;
  background: #ffffff !important;
  border: 1px solid transparent !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  color: inherit !important;
  cursor: pointer !important;
}

.quickguides-right-sidebar .yt-playlist-item:hover {
  background: #f1f5f9 !important;
  border-color: rgba(226, 232, 240, 0.9) !important;
  transform: translateX(2px) !important;
}

.quickguides-right-sidebar .yt-playlist-item.active {
  background: #eff6ff !important;
  border: 1.5px solid rgba(37, 99, 235, 0.45) !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.12) !important;
}

.quickguides-right-sidebar .yt-item-index-col {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  color: #64748b !important;
}

.quickguides-right-sidebar .yt-playlist-item.active .yt-item-index-col {
  color: #2563eb !important;
}

.quickguides-right-sidebar .yt-now-playing-icon {
  width: 14px !important;
  height: 14px !important;
  color: #2563eb !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  animation: pulsePlay 1.5s infinite ease-in-out !important;
}

@keyframes pulsePlay {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.8; }
}

.quickguides-right-sidebar .yt-item-thumb-box {
  position: relative !important;
  width: 110px !important;
  aspect-ratio: 16 / 9 !important;
  border-radius: 8px !important;
  overflow: hidden !important;
  background: #020617 !important;
  border: 1px solid rgba(226, 232, 240, 0.9) !important;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08) !important;
  flex-shrink: 0 !important;
}

.quickguides-right-sidebar .yt-item-thumb-box img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
}

.quickguides-right-sidebar .yt-item-duration-badge {
  position: absolute !important;
  bottom: 3px !important;
  right: 4px !important;
  background: rgba(15, 23, 42, 0.88) !important;
  color: #ffffff !important;
  font-size: 9.5px !important;
  font-weight: 700 !important;
  padding: 1px 4px !important;
  border-radius: 4px !important;
  letter-spacing: 0.2px !important;
  font-variant-numeric: tabular-nums !important;
}

.quickguides-right-sidebar .yt-item-details-box {
  display: flex !important;
  flex-direction: column !important;
  gap: 3px !important;
  min-width: 0 !important;
}

.quickguides-right-sidebar .yt-item-title {
  font-size: 12.5px !important;
  font-weight: 600 !important;
  color: #1e293b !important;
  margin: 0 !important;
  line-height: 1.35 !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  transition: color 0.15s ease !important;
}

.quickguides-right-sidebar .yt-playlist-item:hover .yt-item-title {
  color: #2563eb !important;
}

.quickguides-right-sidebar .yt-playlist-item.active .yt-item-title {
  color: #1d4ed8 !important;
  font-weight: 700 !important;
}

/* ==========================================================================
   2. BOTTOM SECTION: MORE QUICK GUIDES (Exact Same Height as Description Card, Scrollable)
   ========================================================================== */
.quickguides-more-section {
  display: flex !important;
  flex-direction: column !important;
  background: #ffffff !important;
  border-radius: 18px !important;
  border: 1px solid rgba(226, 232, 240, 0.95) !important;
  box-shadow:
    0 24px 55px -12px rgba(15, 23, 42, 0.10),
    0 4px 16px -2px rgba(15, 23, 42, 0.04),
    inset 0 1px 1px #ffffff !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
  transition: all 0.25s ease;
  margin-top: 56px; /* Dynamic pixel alignment via JS ResizeObserver */
}

@media (min-width: 1024px) {
  .quickguides-more-section {
    min-height: 360px;
  }
}

@media (max-width: 1023px) {
  .quickguides-more-section {
    margin-top: 0 !important;
    height: auto !important;
    max-height: 480px !important;
  }
}

.quickguides-more-header {
  padding: 16px 18px 14px !important;
  background: #f8fafc !important;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  flex-shrink: 0 !important;
}

.quickguides-more-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.quickguides-more-title {
  font-size: 15px !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  margin: 0 !important;
  letter-spacing: -0.01em !important;
}

.quickguides-more-badge {
  font-size: 10.5px !important;
  font-weight: 700 !important;
  color: #2563eb !important;
  background: #eff6ff !important;
  border: 1px solid rgba(37, 99, 235, 0.2) !important;
  padding: 3px 8px !important;
  border-radius: 9999px !important;
  white-space: nowrap !important;
}

/* Scrollable Next Modules Video List */
.yt-rec-videos-list {
  display: flex !important;
  flex-direction: column !important;
  padding: 10px 8px !important;
  gap: 6px !important;
  background: #ffffff !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  scrollbar-width: thin !important;
  scrollbar-color: rgba(148, 163, 184, 0.35) transparent !important;
}

.yt-rec-videos-list::-webkit-scrollbar {
  width: 5px;
}

.yt-rec-videos-list::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.35);
  border-radius: 6px;
}

.yt-rec-video-card {
  display: flex !important;
  align-items: flex-start !important;
  gap: 12px !important;
  padding: 8px 10px !important;
  border-radius: 12px !important;
  text-decoration: none !important;
  color: inherit !important;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1) !important;
  border: 1px solid transparent !important;
  position: relative !important;
  cursor: pointer !important;
}

.yt-rec-video-card:hover {
  background: #f1f5f9 !important;
  border-color: rgba(226, 232, 240, 0.9) !important;
  transform: translateX(2px) !important;
}

.yt-rec-thumb-box {
  width: 120px !important;
  min-width: 120px !important;
  aspect-ratio: 16 / 9 !important;
  border-radius: 8px !important;
  overflow: hidden !important;
  position: relative !important;
  background: #020617 !important;
  border: 1px solid rgba(226, 232, 240, 0.9) !important;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08) !important;
  flex-shrink: 0 !important;
}

.yt-rec-thumb-img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
  transition: transform 0.3s ease !important;
}

.yt-rec-video-card:hover .yt-rec-thumb-img {
  transform: scale(1.05) !important;
}

.yt-rec-duration {
  position: absolute !important;
  bottom: 3px !important;
  right: 4px !important;
  background: rgba(15, 23, 42, 0.88) !important;
  color: #ffffff !important;
  font-size: 9.5px !important;
  font-weight: 700 !important;
  padding: 1px 4px !important;
  border-radius: 4px !important;
  letter-spacing: 0.2px !important;
  font-variant-numeric: tabular-nums !important;
}

.yt-rec-details {
  display: flex !important;
  flex-direction: column !important;
  gap: 3px !important;
  min-width: 0 !important;
}

.yt-rec-title {
  font-size: 12.5px !important;
  font-weight: 600 !important;
  line-height: 1.35 !important;
  color: #1e293b !important;
  margin: 0 !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  transition: color 0.15s ease !important;
}

.yt-rec-video-card:hover .yt-rec-title {
  color: #2563eb !important;
}

.yt-rec-channel {
  font-size: 11.5px !important;
  font-weight: 600 !important;
  color: #2563eb !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
}

.yt-rec-meta {
  font-size: 11px !important;
  color: #64748b !important;
  margin: 0 !important;
  font-weight: 500 !important;
}

/* Description expanded styling */
.yt-desc-collapsible.expanded {
  display: flex !important;
}
