/* ======================================================
   PLAYLIST GRID STYLES
   ====================================================== */

.bls-playlist-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  box-sizing: border-box;
}

/* Cấu trúc Card: Thêm shadow mượt và bo góc mềm hơn */
.bls-playlist-card {
  /* Tùy chỉnh độ lệch của ảnh tại biến này (Mặc định 8px) */
  --stack-offset: 8px;

  display: flex;
  flex-direction: row;
  align-items: flex-start;
  background: #ffffff59;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 24px;
  gap: 28px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease,
    border-color 0.3s ease;
}

.bls-playlist-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
  border-color: #d1d5db;
}

/* ── CỘT 1: Hình ảnh ── */
.bls-pl-col-images {
  width: 45%;
  /* Tính toán tự động width dựa theo offset để ảnh không bị tràn viền */
  max-width: 45%;
  padding-top: 10px;
}

.bls-stack-wrapper {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9; /* Giữ tỉ lệ chuẩn cho ảnh */
  position: relative;
}

.bls-stack-item {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  border: 2px solid #ffffff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  background: #f3f4f6;
}

.bls-pl-col-images .bls-stack-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Hiệu ứng Stack dùng biến CSS để căn lệch tự động */
.bls-stack-3 {
  transform: translate(
    calc(var(--stack-offset) * 2),
    calc(var(--stack-offset) * -2)
  );
  z-index: 1;
  opacity: 0.45;
}

.bls-stack-2 {
  transform: translate(var(--stack-offset), calc(var(--stack-offset) * -1));
  z-index: 2;
  opacity: 0.75;
}

.bls-stack-1 {
  transform: translate(0, 0);
  z-index: 3;
}

/* ── CỘT 2: Nội dung văn bản ── */
.bls-pl-col-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.bls-pl-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 12px 0;
  line-height: 1.35;
}

.bls-pl-title a {
  color: #111827;
  text-decoration: none;
  transition: color 0.2s ease;
}

.bls-pl-title a:hover {
  color: #0061fe;
}

/* Hàng Meta: Chứa Số Video và Logo Software */
.bls-pl-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.bls-pl-count {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  color: #4b5563;
  background: #f3f4f6;
  padding: 4px 10px;
  border-radius: 999px;
}

.bls-pl-dot {
  color: #d1d5db;
  font-size: 16px;
}

/* Danh sách logo Software */
.bls-pl-softwares {
  display: flex;
  align-items: center;
  gap: 6px;
}

.bls-pl-sw-logo {
  width: 22px;
  height: 22px;
  object-fit: contain;
  border-radius: 4px;
  padding: 2px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
}

.bls-pl-sw-text {
  font-size: 12px;
  font-weight: 500;
  color: #6b7280;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  padding: 2px 6px;
  border-radius: 4px;
}

/* Mô tả ngắn */
.bls-pl-desc {
  font-size: 14.5px;
  line-height: 1.6;
  color: #1d1d1e;
  margin: 0 0 16px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Nút Youtube Action */
.bls-pl-action {
  margin-top: auto;
  align-self: flex-end;
}

.bls-pl-yt-btn {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  color: #ef4444; /* Màu Youtube */
  background: #fef2f2;
  padding: 8px 16px;
  border-radius: 999px;
  text-decoration: none;
  transition:
    background 0.2s ease,
    transform 0.1s ease;
}

.bls-pl-yt-btn:hover {
  background: #fee2e2;
}

.bls-pl-yt-btn:active {
  transform: scale(0.97);
}

/* ======================================================
   RESPONSIVE
   ====================================================== */
@media (max-width: 960px) {
  .bls-playlist-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

@media (max-width: 480px) {
  .bls-playlist-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px;
    gap: 16px;
  }

  .bls-pl-col-images {
    /* Điều chỉnh nhẹ để cân bằng trên điện thoại */
    padding-left: calc(var(--stack-offset) * 2);
  }
}
