/* ==========================================================================
   TSF YouTube Playlists — v1.0
   Colors: gold=#fde047, maroon=#820a02, teal=#0e7c6b, navy=#1a1a2e
   ========================================================================== */

/* Page container */
.tsf-yt-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

/* Intro text */
.tsf-yt-intro {
  margin-bottom: 2rem;
  font-size: 1.05rem;
  line-height: 1.6;
  color: #333;
}

/* ---------- Playlist sections ---------- */
.tsf-yt-playlist {
  margin-bottom: 2.5rem;
}

.tsf-yt-playlist__header {
  margin-bottom: 1rem;
}

.tsf-yt-playlist__title {
  font-size: 1.4rem;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0 0 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.tsf-yt-playlist__description {
  font-size: 0.9rem;
  color: #666;
  margin: 0;
  line-height: 1.5;
}

/* ---------- Featured badge ---------- */
.tsf-yt-featured-badge {
  display: inline-block;
  background: #fde047;
  color: #1a1a2e;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25em 0.6em;
  border-radius: 3px;
  flex-shrink: 0;
}

/* ---------- Featured playlist: top border accent ---------- */
.tsf-yt-playlist--featured {
  border-top: 3px solid #fde047;
  padding-top: 1.25rem;
  background: rgba(253, 224, 71, 0.04);
  border-radius: 6px;
  padding-left: 1rem;
  padding-right: 1rem;
  padding-bottom: 1rem;
}

/* ---------- Featured grid (Tutorials — all visible) ---------- */
.tsf-yt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

/* ---------- Carousel ---------- */
.tsf-yt-carousel-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.tsf-yt-carousel {
  overflow: hidden;
  flex: 1;
}

.tsf-yt-carousel__track {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  -ms-overflow-style: none;
  scrollbar-width: none;
  padding: 0.25rem 0;
}

.tsf-yt-carousel__track::-webkit-scrollbar {
  display: none;
}

.tsf-yt-carousel__track .tsf-yt-card {
  flex: 0 0 280px;
  scroll-snap-align: start;
}

/* Carousel arrows */
.tsf-yt-carousel__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-60%);
  z-index: 2;
  background: rgba(26, 26, 46, 0.85);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
  opacity: 0.8;
}

.tsf-yt-carousel__arrow:hover {
  background: #820a02;
  opacity: 1;
}

.tsf-yt-carousel__arrow:disabled {
  opacity: 0.25;
  cursor: default;
  pointer-events: none;
}

.tsf-yt-carousel__arrow--left {
  left: -16px;
}

.tsf-yt-carousel__arrow--right {
  right: -16px;
}

/* ---------- Video cards ---------- */
.tsf-yt-card {
  cursor: pointer;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #e5e7eb;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.tsf-yt-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  border-color: #0e7c6b;
}

.tsf-yt-card__thumb {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  overflow: hidden;
  background: #1a1a2e;
}

.tsf-yt-card__thumb img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.2s;
}

.tsf-yt-card:hover .tsf-yt-card__thumb img {
  opacity: 0.85;
}

/* Play button overlay */
.tsf-yt-card__play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}

.tsf-yt-card:hover .tsf-yt-card__play {
  opacity: 1;
}

.tsf-yt-card__info {
  padding: 0.65rem 0.75rem;
}

.tsf-yt-card__title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #1a1a2e;
  margin: 0;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- Lightbox ---------- */
.tsf-yt-lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  align-items: center;
  justify-content: center;
}

.tsf-yt-lightbox.is-open {
  display: flex;
}

.tsf-yt-lightbox__backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.82);
  cursor: pointer;
}

.tsf-yt-lightbox__content {
  position: relative;
  z-index: 1;
  width: 90%;
  max-width: 960px;
}

.tsf-yt-lightbox__close {
  position: absolute;
  top: -40px;
  right: 0;
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.tsf-yt-lightbox__close:hover {
  opacity: 1;
}

.tsf-yt-lightbox__player {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: #000;
  border-radius: 6px;
  overflow: hidden;
}

.tsf-yt-lightbox__player iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.tsf-yt-lightbox__title {
  color: #fde047;
  font-size: 1rem;
  font-weight: 600;
  margin-top: 0.75rem;
  text-align: center;
}

/* ---------- Empty state ---------- */
.tsf-yt-empty {
  text-align: center;
  padding: 4rem 1rem;
  color: #666;
  font-size: 1.05rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .tsf-yt-carousel__track .tsf-yt-card {
    flex: 0 0 240px;
  }

  .tsf-yt-carousel__arrow {
    display: none;
  }

  .tsf-yt-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }

  .tsf-yt-lightbox__content {
    width: 95%;
  }

  .tsf-yt-lightbox__close {
    top: -36px;
  }
}
