/**
 * YouTube Light Theme & Player Styles for Showcase Tube
 * Built on Bootstrap 5.3 Light Mode
 */

:root {
  --yt-bg: #f9f9f9;
  --yt-surface: #ffffff;
  --yt-surface-hover: #f2f2f2;
  --yt-border: #e5e5e5;
  --yt-red: #ff0000;
  --yt-red-hover: #cc0000;
  --yt-text: #0f0f0f;
  --yt-text-muted: #606060;
  --sidebar-width: 240px;
  --sidebar-mini-width: 72px;
  --topbar-height: 56px;
}

body,
body[data-bs-theme="light"] {
  background-color: var(--yt-bg) !important;
  color: var(--yt-text) !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow-x: hidden;
}

/* ==========================================================================
   TOPBAR NAVBAR
   ========================================================================== */
.yt-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-height);
  background-color: var(--yt-surface);
  border-bottom: 1px solid var(--yt-border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  z-index: 1040;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
}

.yt-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--yt-text);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.5px;
  font-size: 1.15rem;
}

.yt-brand:hover {
  color: var(--yt-text);
}

.yt-brand img {
  height: 32px;
  width: auto;
  object-fit: contain;
  transition: transform 0.2s ease;
}

.yt-brand:hover img {
  transform: scale(1.05);
}

.yt-logo-badge {
  background: var(--yt-red);
  color: #fff;
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.yt-search-container {
  max-width: 600px;
  width: 100%;
}

.yt-search-group {
  display: flex;
  border: 1px solid #ccc;
  border-radius: 40px;
  overflow: hidden;
  background-color: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.yt-search-group:focus-within {
  border-color: #065fd4;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.08);
}

.yt-search-input {
  background: transparent !important;
  border: none !important;
  color: #0f0f0f !important;
  box-shadow: none !important;
  padding-left: 1.25rem;
  font-size: 0.95rem;
}

.yt-search-btn {
  background-color: #f8f8f8 !important;
  border: none !important;
  border-left: 1px solid #ccc !important;
  color: #555 !important;
  padding: 0.5rem 1.25rem !important;
  border-radius: 0 40px 40px 0 !important;
}

.yt-search-btn:hover {
  background-color: #f0f0f0 !important;
  color: #000 !important;
}

/* ==========================================================================
   SIDEBAR DRAWER
   ========================================================================== */
.yt-sidebar {
  position: fixed;
  top: var(--topbar-height);
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background-color: var(--yt-surface);
  border-right: 1px solid var(--yt-border);
  overflow-y: auto;
  z-index: 1030;
  padding: 0.75rem 0.5rem;
  transition: width 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s ease;
}

.yt-main-content {
  margin-left: var(--sidebar-width);
  margin-top: var(--topbar-height);
  padding: 1.25rem 1.75rem;
  min-height: calc(100vh - var(--topbar-height));
  transition: margin-left 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Collapsed mini sidebar */
body.sidebar-collapsed .yt-sidebar {
  width: var(--sidebar-mini-width);
  padding: 0.5rem 0.25rem;
}

body.sidebar-collapsed .yt-sidebar .nav-link span.nav-text,
body.sidebar-collapsed .yt-sidebar .sidebar-heading,
body.sidebar-collapsed .yt-sidebar .sidebar-footer {
  display: none;
}

body.sidebar-collapsed .yt-sidebar .nav-link {
  flex-direction: column;
  padding: 0.75rem 0.25rem;
  font-size: 0.65rem;
  text-align: center;
  gap: 0.25rem;
}

body.sidebar-collapsed .yt-sidebar .nav-link i {
  font-size: 1.35rem;
}

body.sidebar-collapsed .yt-main-content {
  margin-left: var(--sidebar-mini-width);
}

/* Pre-collapse: applied by inline script before body renders to prevent layout flicker */
html.sidebar-pre-collapsed body .yt-sidebar {
  width: var(--sidebar-mini-width);
  padding: 0.5rem 0.25rem;
}
html.sidebar-pre-collapsed body .yt-sidebar .nav-link span.nav-text,
html.sidebar-pre-collapsed body .yt-sidebar .sidebar-heading,
html.sidebar-pre-collapsed body .yt-sidebar .sidebar-footer {
  display: none;
}
html.sidebar-pre-collapsed body .yt-main-content {
  margin-left: var(--sidebar-mini-width);
}

/* Sidebar Nav links */
.yt-sidebar .nav-link {
  color: var(--yt-text);
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.65rem 1rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background-color 0.15s ease;
}

.yt-sidebar .nav-link:hover {
  background-color: var(--yt-surface-hover);
  color: #0f0f0f;
}

.yt-sidebar .nav-link.active {
  background-color: #e5e5e5;
  color: #0f0f0f;
  font-weight: 600;
}

.yt-sidebar .nav-link i {
  font-size: 1.2rem;
  width: 24px;
  text-align: center;
}

.sidebar-heading {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--yt-text-muted);
  font-weight: 700;
  padding: 0.75rem 1rem 0.25rem 1rem;
  letter-spacing: 0.5px;
}

/* ==========================================================================
   CATEGORY CHIP PILLS
   ========================================================================== */
.yt-chip-bar {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  white-space: nowrap;
  padding-bottom: 0.75rem;
  margin-bottom: 1.25rem;
  scrollbar-width: none;
}
.yt-chip-bar::-webkit-scrollbar {
  display: none;
}

.yt-chip {
  background-color: #f2f2f2;
  color: var(--yt-text);
  border: 1px solid var(--yt-border);
  border-radius: 8px;
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.15s ease;
}

.yt-chip:hover {
  background-color: #e5e5e5;
  color: #0f0f0f;
}

.yt-chip.active {
  background-color: #0f0f0f;
  color: #ffffff;
  font-weight: 600;
  border-color: #0f0f0f;
}

/* ==========================================================================
   YOUTUBE ASSET / VIDEO CARDS
   ========================================================================== */
.yt-card {
  background: transparent;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease;
  position: relative;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}

.yt-card:hover .yt-thumb-wrapper img {
  transform: scale(1.03);
}

.yt-thumb-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: #e0e0e0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.yt-thumb-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.yt-thumb-wrapper video.hover-preview {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.yt-card:hover .yt-thumb-wrapper video.hover-preview {
  display: block;
}

.yt-duration-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background-color: rgba(0, 0, 0, 0.85);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 5px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.yt-type-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background-color: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.yt-card-body {
  padding: 0.75rem 0.25rem 0.25rem 0.25rem;
  display: flex;
  gap: 0.75rem;
}

.yt-author-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: #0f0f0f;
  flex-shrink: 0;
  border: 1px solid #e0e0e0;
}

.yt-card-info {
  flex-grow: 1;
  min-width: 0;
}

.yt-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
  color: #0f0f0f;
  margin-bottom: 0.3rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.yt-card-meta {
  font-size: 0.8rem;
  color: var(--yt-text-muted);
  line-height: 1.25;
}

/* ==========================================================================
   YOUTUBE PLAYER & WATCH PAGE
   ========================================================================== */
.watch-container {
  max-width: 1750px;
  margin: 0 auto;
}

.yt-player-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: #000;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  user-select: none;
}

.yt-player-container video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

/* Theater Mode */
.watch-layout.theater-active {
  display: block;
}

.watch-layout.theater-active .yt-player-container {
  max-height: 80vh;
  border-radius: 0;
  margin-bottom: 1.5rem;
}

/* Custom Player Controls */
.yt-controls-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
  padding: 0 1rem 0.5rem 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
  z-index: 20;
}

/* When paused or when explicitly instructed to show controls */
.yt-player-container.show-controls .yt-controls-overlay,
.yt-player-container.paused .yt-controls-overlay {
  opacity: 1;
  pointer-events: auto;
}

/* Explicit hide controls overrides hover and stays hidden on mobile until tapped */
.yt-player-container.hide-controls .yt-controls-overlay {
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Desktop hover (only on devices with fine mouse pointer, never sticky on mobile touch) */
@media (hover: hover) and (pointer: fine) {
  .yt-player-container:hover:not(.hide-controls) .yt-controls-overlay {
    opacity: 1;
    pointer-events: auto;
  }
}

/* Hide mouse cursor when controls are hidden during playback */
.yt-player-container.hide-controls {
  cursor: none;
}
.yt-player-container.hide-controls * {
  cursor: none !important;
}

/* Progress bar / Scrubber */
.yt-progress-container {
  position: relative;
  width: 100%;
  height: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.yt-progress-bg {
  width: 100%;
  height: 4px;
  background-color: rgba(255, 255, 255, 0.25);
  position: relative;
  transition: height 0.1s ease;
  border-radius: 2px;
}

.yt-progress-container:hover .yt-progress-bg {
  height: 6px;
}

.yt-progress-buffer {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  background-color: rgba(255, 255, 255, 0.4);
  border-radius: 2px;
}

.yt-progress-played {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  background-color: var(--yt-red);
  border-radius: 2px;
}

.yt-progress-scrubber {
  position: absolute;
  top: 50%;
  right: -6px;
  width: 13px;
  height: 13px;
  background-color: var(--yt-red);
  border-radius: 50%;
  transform: translateY(-50%) scale(0);
  transition: transform 0.15s ease;
}

.yt-progress-container:hover .yt-progress-scrubber {
  transform: translateY(-50%) scale(1);
}

.yt-scrub-tooltip {
  position: absolute;
  bottom: 24px;
  background-color: rgba(0, 0, 0, 0.85);
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  display: none;
  pointer-events: none;
  transform: translateX(-50%);
}

.yt-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.25rem;
}

.yt-ctrl-btn {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.25rem;
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s ease, color 0.15s ease;
}

.yt-ctrl-btn:hover {
  color: var(--yt-red);
}

.yt-volume-wrapper {
  display: flex;
  align-items: center;
}

.yt-volume-slider {
  width: 0;
  opacity: 0;
  transition: width 0.2s ease, opacity 0.2s ease;
  accent-color: #fff;
  cursor: pointer;
}

.yt-volume-wrapper:hover .yt-volume-slider {
  width: 60px;
  opacity: 1;
  margin-left: 0.25rem;
}

.yt-time-display {
  font-size: 0.85rem;
  color: #ddd;
  margin-left: 0.5rem;
  font-variant-numeric: tabular-nums;
}

/* Watch Description Box */
.yt-desc-box {
  background-color: #f2f2f2;
  color: #0f0f0f;
  border-radius: 12px;
  padding: 1rem;
  margin-top: 1rem;
  font-size: 0.9rem;
  line-height: 1.5;
  cursor: pointer;
  position: relative;
  border: 1px solid #e5e5e5;
}

.yt-desc-box:hover {
  background-color: #e8e8e8;
}

.yt-desc-text.collapsed {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.timestamp-link {
  color: #065fd4;
  text-decoration: none;
  font-weight: 600;
}
.timestamp-link:hover {
  text-decoration: underline;
}

/* Light Card & Table overrides */
.card {
  background-color: var(--yt-surface) !important;
  border-color: var(--yt-border) !important;
}

.table {
  color: var(--yt-text) !important;
}

/* Responsive adjustments */
@media (max-width: 991.98px) {
  .yt-sidebar {
    transform: translateX(-100%) !important;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    z-index: 1040 !important;
  }
  body.sidebar-mobile-open .yt-sidebar {
    transform: translateX(0) !important;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.25) !important;
  }
  .yt-main-content {
    margin-left: 0 !important;
    padding: 1rem;
  }
}

/* ==========================================================================
   PROJECT-WISE GROUPING & LIGHTBOX
   ========================================================================== */
.project-card-container {
  background: var(--yt-surface);
  border: 1px solid var(--yt-border);
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
}

.project-card-container:hover {
  border-color: #d0d0d0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.project-avatar {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  background-color: #f0f0f0;
  flex-shrink: 0;
}

.project-filter-btn {
  font-size: 0.85rem;
  padding: 0.35rem 0.85rem;
  font-weight: 500;
  border-radius: 18px;
  transition: all 0.15s ease;
}

.project-filter-btn.active {
  background-color: var(--yt-text) !important;
  color: #fff !important;
  border-color: var(--yt-text) !important;
}

.image-thumb-card {
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  background: #f8f9fa;
  border: 1px solid var(--yt-border);
}

.image-thumb-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.lightbox-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.9);
  color: #0f0f0f;
  border: 1px solid rgba(0, 0, 0, 0.15);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
}

.lightbox-nav-btn:hover {
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  color: var(--yt-red);
}

.lightbox-prev {
  left: 15px;
}

.lightbox-next {
  right: 15px;
}

/* ==========================================================================
   YOUTUBE WATCH PAGE REFINED COMPONENTS (MATCHING YOUTUBE UI)
   ========================================================================== */

/* Unified Action Pill Buttons */
.yt-action-pill-group {
  display: inline-flex;
  align-items: center;
  background-color: #f2f2f2;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid #e5e5e5;
  transition: background-color 0.15s ease;
}

.yt-action-pill-group:hover {
  background-color: #e8e8e8;
}

.yt-action-pill-btn {
  background: transparent;
  border: none;
  padding: 0.45rem 0.9rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: #0f0f0f;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.yt-action-pill-btn:hover {
  color: #000;
  background-color: rgba(0, 0, 0, 0.05);
}

.yt-action-pill-btn.single {
  background-color: #f2f2f2;
  border: 1px solid #e5e5e5;
  border-radius: 24px;
  padding: 0.45rem 1rem;
}

.yt-action-pill-btn.single:hover {
  background-color: #e5e5e5;
}

.yt-action-pill-btn.icon-only {
  background-color: #f2f2f2;
  border: 1px solid #e5e5e5;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  padding: 0;
  justify-content: center;
}

.yt-action-pill-btn.icon-only:hover {
  background-color: #e5e5e5;
}

.yt-action-pill-divider {
  width: 1px;
  height: 20px;
  background-color: #d0d0d0;
}

/* Subscribe button */
.btn-yt-subscribe {
  background-color: #0f0f0f;
  color: #fff;
  border: none;
  border-radius: 24px;
  padding: 0.5rem 1.15rem;
  font-size: 0.88rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-yt-subscribe:hover {
  background-color: #272727;
  color: #fff;
}

.btn-yt-subscribe.subscribed {
  background-color: #f2f2f2;
  color: #0f0f0f;
  border: 1px solid #e5e5e5;
}

.btn-yt-subscribe.subscribed:hover {
  background-color: #e5e5e5;
}

/* Autoplay Overlay on Video Player */
.yt-autoplay-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 50;
  color: #fff;
  padding: 1.5rem;
  text-align: center;
  animation: fadeIn 0.25s ease;
}

/* Unsupported Legacy Format Overlay (for WMV, FLV, MPG, AVI or decode errors) */
.yt-unsupported-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 10, 10, 0.92);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 45;
  color: #fff;
  padding: 1.5rem;
  text-align: center;
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.yt-countdown-circle {
  width: 60px;
  height: 60px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.yt-countdown-number {
  font-size: 1.5rem;
  font-weight: 700;
  font-family: monospace;
}

/* Comments Section */
.yt-comment-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
  flex-shrink: 0;
}

.yt-comment-input {
  background: transparent !important;
  border: none !important;
  border-bottom: 1px solid #ccc !important;
  font-size: 0.92rem;
  padding: 0.4rem 0 !important;
  transition: border-color 0.2s ease;
}

.yt-comment-input:focus {
  border-bottom: 2px solid #0f0f0f !important;
  box-shadow: none !important;
}

.yt-comment-action-btn {
  background: transparent;
  border: none;
  color: #606060;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.yt-comment-action-btn:hover {
  background-color: #f0f0f0;
  color: #0f0f0f;
}

/* Up Next Sidebar Videos */
.yt-upnext-card {
  display: flex;
  gap: 0.75rem;
  text-decoration: none;
  color: #0f0f0f;
  padding: 0.35rem;
  border-radius: 8px;
  transition: background-color 0.15s ease;
}

.yt-upnext-card:hover {
  background-color: rgba(0, 0, 0, 0.05);
  color: #0f0f0f;
}

.yt-upnext-thumb {
  width: 168px;
  aspect-ratio: 16/9;
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background-color: #e5e5e5;
}

@media (max-width: 575.98px) {
  .yt-upnext-thumb {
    width: 120px;
  }
}

.yt-upnext-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  justify-content: flex-start;
}

.yt-upnext-title {
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.3;
  color: #0f0f0f;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0.25rem;
}

.yt-upnext-channel {
  font-size: 0.78rem;
  color: #606060;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.yt-upnext-meta {
  font-size: 0.75rem;
  color: #606060;
  margin-top: 0.15rem;
}

/* Seek buttons & overlays */
.yt-seek-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  font-size: 1.15rem;
}

.yt-seek-text {
  font-size: 0.65rem;
  font-weight: 800;
  margin-left: 1px;
}

.yt-seek-overlay {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 40%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 45;
  color: #fff;
  animation: seekRippleAnim 0.6s ease forwards;
}

.yt-seek-overlay-left {
  left: 0;
  background: radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.25) 0%, transparent 70%);
}

.yt-seek-overlay-right {
  right: 0;
  background: radial-gradient(circle at 80% 50%, rgba(255, 255, 255, 0.25) 0%, transparent 70%);
}

.yt-seek-ripple {
  background: rgba(0, 0, 0, 0.6);
  padding: 0.75rem 1.25rem;
  border-radius: 50px;
  display: flex;
  flex-direction: column;
  align-items: center;
  backdrop-filter: blur(4px);
}

@keyframes seekRippleAnim {
  0% { opacity: 0; transform: scale(0.85); }
  30% { opacity: 1; transform: scale(1.05); }
  70% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.15); }
}

/* Autoplay Unmute Badge */
.yt-unmute-badge {
  position: absolute;
  top: 15px;
  left: 15px;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  z-index: 40;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.yt-unmute-badge:hover {
  background: #d6111a;
  transform: scale(1.03);
}

/* ==========================================================================
   VIDEO RESUME & WATCH LATER FEATURES
   ========================================================================== */

/* Thumbnail Progress Bar (Red YouTube-style bottom progress bar) */
.yt-thumb-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background-color: rgba(255, 255, 255, 0.35);
  z-index: 5;
  display: none;
  overflow: hidden;
}

.yt-thumb-progress-fill {
  height: 100%;
  background-color: #ff0000;
  width: 0%;
  transition: width 0.3s ease;
}

/* Quick Watch Later button on video thumbnail hover */
.yt-quick-watch-later {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background-color: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  cursor: pointer;
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.15s ease;
  z-index: 6;
}

.yt-card:hover .yt-quick-watch-later,
.yt-quick-watch-later.active {
  opacity: 1;
  transform: scale(1);
}

.yt-quick-watch-later:hover,
.yt-quick-watch-later.active {
  background-color: #ff0000;
  color: #fff;
}

/* Resume Playback Toast on Player */
.yt-resume-toast {
  position: absolute;
  bottom: 56px;
  left: 20px;
  background: rgba(15, 15, 15, 0.92);
  backdrop-filter: blur(8px);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 0.5rem 0.9rem;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  z-index: 45;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  animation: fadeIn 0.3s ease;
}

.yt-resume-toast .btn-link {
  color: #ff4d4d;
  font-weight: 600;
  font-size: 0.85rem;
}

.yt-resume-toast .btn-link:hover {
  color: #ff8080;
}

/* Video Sub-filter buttons (All, History, Watch Later) */
.video-subfilter-btn {
  font-size: 0.82rem;
  transition: all 0.15s ease;
}

.video-subfilter-btn.active {
  background-color: #0f0f0f !important;
  color: #fff !important;
  border-color: #0f0f0f !important;
}

/* Site Footer */
.yt-site-footer {
  background-color: transparent;
}

.yt-site-footer a {
  transition: color 0.15s ease;
}

.yt-site-footer a:hover {
  color: #0f0f0f !important;
}

/* ==========================================================================
   COMPREHENSIVE MOBILE RESPONSIVENESS ENHANCEMENTS
   ========================================================================== */

/* 1. Mobile Sidebar Backdrop Overlay */
.yt-sidebar-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
  z-index: 1025; /* right beneath sidebar z-index: 1030 */
  opacity: 0;
  transition: opacity 0.2s ease;
}

body.sidebar-mobile-open .yt-sidebar-backdrop {
  display: block;
  opacity: 1;
}

/* 2. Horizontally Scrollable Action Pills on Mobile */
.yt-action-pills-scroll {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
  scrollbar-width: none;
  max-width: 100%;
}

.yt-action-pills-scroll::-webkit-scrollbar {
  display: none;
}

/* 3. Touch Friendly Bookmark Controls */
@media (hover: none), (max-width: 991.98px) {
  .yt-quick-watch-later {
    opacity: 0.9;
    transform: scale(1);
  }
}

/* 4. Medium / Tablet Devices (max-width: 991.98px) */
@media (max-width: 991.98px) {
  .yt-sidebar {
    box-shadow: 2px 0 16px rgba(0, 0, 0, 0.15);
  }
  .yt-main-content {
    margin-left: 0 !important;
    padding: 1rem 0.75rem;
  }
}

/* 5. Mobile Phones (max-width: 767.98px) */
@media (max-width: 767.98px) {
  /* Flush edge-to-edge player on phone screens like YouTube App */
  .watch-container {
    margin: 0 -0.75rem;
  }
  .yt-player-container {
    border-radius: 0 !important;
    box-shadow: none;
  }
  .watch-container .mt-3,
  .watch-container .col-lg-4,
  .watch-container .yt-description-box {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  /* Player controls: hide desktop-only controls */
  .yt-volume-wrapper {
    display: none !important;
  }
  .yt-theater-btn {
    display: none !important;
  }
  .yt-time-display {
    font-size: 0.75rem;
    margin-left: 0.25rem;
  }
  .yt-controls-row {
    padding: 0 0.5rem 0.25rem 0.5rem;
  }
  .yt-ctrl-btn {
    padding: 0.3rem 0.45rem;
    font-size: 1.15rem;
  }
  .yt-seek-btn {
    font-size: 1.15rem;
  }
  .yt-seek-text {
    font-size: 0.55rem;
  }

  /* Up Next videos on mobile: clean compact horizontal item */
  .yt-upnext-card {
    gap: 0.65rem;
  }
  .yt-upnext-thumb {
    width: 130px;
    height: 74px;
    flex-shrink: 0;
  }
  .yt-upnext-title {
    font-size: 0.85rem;
    line-height: 1.25;
  }
  .yt-upnext-meta {
    font-size: 0.72rem;
  }

  /* Studio metrics on mobile */
  .row-cols-2 > .col {
    padding-left: 0.35rem;
    padding-right: 0.35rem;
  }
}

/* 6. Extra Small Screens (max-width: 575.98px) */
@media (max-width: 575.98px) {
  /* Header branding & search on narrow screens */
  .yt-header {
    padding: 0.45rem 0.5rem;
    gap: 0.35rem;
  }
  .yt-brand .brand-text span {
    display: none; /* Hide 'SHOWCASE' on small phones to save space */
  }
  .yt-brand .brand-text {
    font-size: 1.05rem;
  }
  .yt-brand img {
    height: 26px;
  }
  .yt-search-container {
    max-width: none;
    margin: 0 0.25rem !important;
  }
  .yt-search-input {
    font-size: 0.85rem;
    padding-left: 0.75rem;
  }
  .yt-search-btn {
    padding: 0.35rem 0.75rem !important;
  }

  /* Player controls further streamlined */
  .yt-pip-btn {
    display: none !important;
  }
  .yt-speed-select {
    padding: 0.2rem 0.4rem !important;
    font-size: 0.75rem !important;
  }

  /* Category switcher chips touch swipe */
  .yt-chip-bar {
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    padding-right: 1.5rem;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
  }
  .yt-chip {
    padding: 0.4rem 0.85rem;
    font-size: 0.82rem;
    flex-shrink: 0;
    scroll-snap-align: start;
  }

  /* Video title typography on small screens */
  .yt-card-title {
    font-size: 0.9rem;
    line-height: 1.35;
  }
  .h4 {
    font-size: 1.15rem;
  }

  /* Extra mobile viewport spacing */
  .yt-main-content {
    padding: 0.75rem !important;
    padding-bottom: 5rem !important;
  }
}

/* ==========================================================================
   SCROLL TO TOP FLOATING BUTTON
   ========================================================================== */
#scrollToTopBtn {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 46px;
  height: 46px;
  border-radius: 50% !important;
  background-color: #0f0f0f !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(0, 0, 0, 0.08);
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 1.25rem;
  cursor: pointer;
  z-index: 9999 !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(16px) scale(0.85);
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), visibility 0.25s, background-color 0.2s ease, box-shadow 0.2s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#scrollToTopBtn.visible {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  transform: translateY(0) scale(1) !important;
}

#scrollToTopBtn:hover {
  background-color: var(--yt-red, #cc0000) !important;
  color: #ffffff !important;
  transform: translateY(-4px) scale(1.08) !important;
  box-shadow: 0 8px 24px rgba(204, 0, 0, 0.45);
}

#scrollToTopBtn:active {
  transform: translateY(0) scale(0.94) !important;
}

@media (max-width: 767.98px) {
  #scrollToTopBtn {
    bottom: 74px; /* Elevated cleanly above mobile bottom nav / footer */
    right: 18px;
    width: 44px;
    height: 44px;
    font-size: 1.2rem;
  }
}

/* Folder Accordion & Explorer Styles */
.folder-chevron.rotate-down {
  transform: rotate(90deg) !important;
}
.folder-header-row:hover {
  background-color: #f8f9fa !important;
}
.folder-file-row:hover {
  background-color: #fbfbfb;
}
.hover-danger:hover {
  color: #cc0000 !important;
}




