body { 
    font-family: sans-serif;
    margin: 0;
    padding: 0;
    padding-top: 20px;
}

form { 
    margin-bottom: 2rem; 
}

form.row {
    flex-wrap: wrap;
}

input, select, button { 
    padding: 6px; font-size: 1rem; 
}
                        
iframe { 
    width: 320px; height: 180px; border: none; 
}

/* add a smooth transition for hover */
a.badge {
    transition: background-color 150ms ease, color 150ms ease;
}

/* override Bootstrap bg-secondary on hover/focus */
a.badge.bg-secondary:hover,
a.badge.bg-secondary:focus {
    background-color: #0d6efd !important; /* Bootstrap primary blue */
    color: #ffffff !important;
    text-decoration: none !important;
}

.position-sticky {
  top: 80px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}

.list-group-item a:hover {
  background-color: #6c757d; /* Bootstrap secondary */
  color: white !important;
  text-decoration: none;
}

.list-group-item a.fw-bold {
  box-shadow: inset 0 0 5px rgba(255,255,255,0.2);
}

.video-item {
  align-items: flex-start;
  max-width: 100%;
  word-wrap: break-word;
}

.video-embed iframe {
  display: block;
  border-radius: 8px;
}

.video-info {
  flex: 1;
  min-width: 250px;
}

.video-title {
  font-size: 2rem; /* larger title */
  margin-bottom: 0.25rem;
  color: #000;
  overflow-wrap: anywhere;
}

.video-channel {
  font-size: 1.1rem;
  color: #ccc;
  margin-bottom: 0.5rem;
  overflow-wrap: anywhere;
}

.video-duration {
  font-size: 1rem;
  color: #ccc;
  margin-bottom: 0.5rem;
  overflow-wrap: anywhere;
}

.video-item p {
  margin-bottom: 0;
  font-size: 0.95rem;
}

html, body {
  overflow-x: hidden; /* Hide horizontal scrollbar */
}

iframe {
  max-width: 100%;
  height: auto;
  display: block;
}

/* --- Page spacing under navbar --- */
.page-content {
  margin-top: 80px; /* adjust if navbar height differs */
  padding-left: 0%;
  padding-right: 0%;
}

/* --- Sidebar wrapper: relative positioning context --- */
.sidebar-wrapper {
  position: relative;
  margin-right: 0rem;
  padding-right: 0rem;
}

/* --- Preferred sticky behavior (works in most layouts) --- */
.sidebar-sticky {
  position: -webkit-sticky;
  position: sticky;
  top: 90px;                         /* space under navbar */
  max-height: calc(100vh - 110px);   /* fit into viewport */
  overflow-y: auto;                  /* scroll inside sidebar if long */
  z-index: 1020;
  width: 100%;                       /* fill the column */
}

.sidebar-fixed {
  position: fixed;
  top: 80px;
  right: 0;
  width: 25%; /* for col-md-3 in a 12-col grid */
  max-width: 300px; /* optional */
}

/* ensure ancestors don't clip sticky */
.container, .row, .page-content {
  overflow: visible !important;
  transform: none !important; /* transforms create new stacking context & break sticky */
  padding-left: 0;
  padding-right: 0;
  margin-left: 0.5rem;
}

#collapseGlobal > div {
  padding: 0.5rem 0.75rem;
}

/* 🎵 Playlist link styling */
.playlist-link {
    transition: color 0.25s ease, background-color 0.25s ease;
}

/* Default (non-active) hover effect */
.playlist-link:hover {
    color: #0d6efd !important; /* Bootstrap primary blue */
    background-color: rgba(13, 110, 253, 0.08); /* subtle blue tint background */
}

/* Active (green) playlist hover */
.playlist-link.bg-success:hover {
    background-color: #2ecc71 !important; /* a fresh green */
    color: #ffffff !important;
}

/* responsive: when narrow viewport, sidebar becomes normal flow below content */
@media (max-width: 991.98px) { /* md breakpoint */
  .sidebar-sticky {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .video-item {
    flex-direction: column;
  }

  .video-embed {
    margin-bottom: 0.75rem;
  }

  .video-info {
    text-align: left;
  }

  .video-title {
    font-size: 1.25rem;
  }
}