/* ============================================================
   LỊCH LIVESTREAM — v3.0
   Font: Itim | SVG boards | Responsive: mobile / tablet / desktop
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Itim&display=swap');

:root {
  --cds-text-color: #3a7d44;
  --cds-off-color: #d9d6d0;
  --cds-word-color: #f0a500;
  --cds-build-color: #4caf50;
  --cds-font: 'Itim', cursive;
}

/* ============================================================
   1. OUTER WRAPPER — full width, chứa background
   ============================================================ */
.cds-live-outer {
  position: relative;
  width: 100vw;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  padding: 40px 20px 60px;
  box-sizing: border-box;
  overflow: hidden;
  font-family: var(--cds-font);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

/* Background image */
.cds-live-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 0;
}

/* Fade trên + dưới để hòa vào nền trang */
.cds-live-bg-fade {
  position: absolute;
  left: 0;
  right: 0;
  height: 120px;
  z-index: 1;
  pointer-events: none;
}
.cds-live-bg-fade--top {
  top: 0;
  background: linear-gradient(
    to bottom,
    var(--cds-page-bg, #ffffff) 0%,
    transparent 100%
  );
}
.cds-live-bg-fade--bottom {
  bottom: 0;
  background: linear-gradient(
    to top,
    var(--cds-page-bg, #ffffff) 0%,
    transparent 100%
  );
}

/* ============================================================
   2. TITLE BOARD (small-board.svg) — nổi lên trên main board
   ============================================================ */
.cds-title-wrap {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: 480px;
  margin-bottom: -20px; /* Chồng nhẹ xuống main board */
  display: flex;
  align-items: center;
  justify-content: center;
}

.cds-title-board-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.cds-title-board-bg svg {
  width: 100%;
  height: 100%;
  display: block;
}

.cds-live-title {
  position: relative;
  z-index: 1;
  font-family: var(--cds-font);
  font-size: 26px;
  font-weight: 400;
  color: var(--cds-text-color);
  text-align: center;
  margin: 0;
  padding: 32px 40px 28px;
  letter-spacing: 2px;
  white-space: nowrap;
}

/* ============================================================
   3. MAIN BOARD — desktop (Group_48.svg làm nền)
   ============================================================ */
.cds-live-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1200px;
  padding: 48px 48px 36px;
  box-sizing: border-box;
}

/* SVG bảng trắng nền main */
.cds-live-board-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.cds-live-board-bg svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Nội dung nằm trên SVG */
.cds-live-inner > *:not(.cds-live-board-bg) {
  position: relative;
  z-index: 1;
}

/* ============================================================
   4. DESKTOP SCHEDULE — flex ngang, 7 cột
   ============================================================ */
.cds-schedule-desktop {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 10px;
}

/* Cột ngày */
.cds-day-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.cds-day-label {
  font-family: var(--cds-font);
  font-size: 15px;
  color: var(--cds-text-color);
  letter-spacing: 1px;
  margin-bottom: 2px;
  text-align: center;
}

.cds-slots-wrap {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
}

/* ============================================================
   5. SLOT — SVG làm nền, màu tô qua filter / overlay
   ============================================================ */
.cds-slot-wrap {
  position: relative;
  width: 100%;
  /* Tỉ lệ chiều cao dựa trên viewBox 306:107 ≈ 35% */
  padding-bottom: 35%;
}

.cds-slot-wrap svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* Tô màu nền lên path fill="white" bằng cách đè một rect có màu + mix-blend-mode */
.cds-slot-wrap::before {
  content: '';
  position: absolute;
  inset: 4% 2%; /* thu nhỏ chút để không chồng ra viền SVG */
  border-radius: 6px;
  z-index: 1;
  transition: filter 0.2s ease;
}

.cds-slot-wrap:has(.cds-slot-off)::before {
  background: var(--cds-off-color);
}
.cds-slot-wrap:has(.cds-slot-word)::before {
  background: var(--cds-word-color);
}
.cds-slot-wrap:has(.cds-slot-build)::before {
  background: var(--cds-build-color);
}

.cds-slot-wrap:hover::before {
  filter: brightness(1.08);
}

/* Text */
.cds-slot-text {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--cds-font);
  font-size: 13px;
  letter-spacing: 0.3px;
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
}

.cds-slot-off {
  color: #888;
}
.cds-slot-word {
  color: #fff;
}
.cds-slot-build {
  color: #fff;
}

/* ============================================================
   6. LEGEND
   ============================================================ */
.cds-legend {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 18px;
}
.cds-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--cds-font);
  font-size: 13px;
  color: var(--cds-text-color);
}
.cds-legend-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ============================================================
   7. MOBILE BOARD — stand-board.svg + layout dọc
      Ẩn mặc định, hiện ở màn hình ≤ 480px
   ============================================================ */
.cds-live-mobile {
  display: none;
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 340px;
  padding: 60px 36px 50px;
  box-sizing: border-box;
}

.cds-live-stand-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.cds-live-stand-bg svg {
  width: 100%;
  height: 100%;
  display: block;
}

.cds-live-mobile > *:not(.cds-live-stand-bg) {
  position: relative;
  z-index: 1;
}

/* Layout dọc mobile */
.cds-schedule-mobile {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cds-mobile-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.cds-mobile-day {
  font-family: var(--cds-font);
  font-size: 17px;
  color: var(--cds-text-color);
  min-width: 44px;
  padding-top: 4px;
  letter-spacing: 1px;
  flex-shrink: 0;
}

.cds-mobile-slots {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

/* Slot mobile — giữ tỉ lệ nhưng chiều cao cố định hơn */
.cds-live-mobile .cds-slot-wrap {
  padding-bottom: 0;
  height: 36px;
}

.cds-legend-mobile {
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-top: 16px;
  justify-content: flex-start;
}

/* ============================================================
   8. TABLET — 481px → 900px
      Dùng desktop board nhưng thu nhỏ, 2 hàng 4-3 nếu cần
   ============================================================ */
@media (max-width: 900px) and (min-width: 481px) {
  .cds-live-outer {
    padding: 36px 16px 50px;
  }

  .cds-live-inner {
    padding: 44px 32px 32px;
  }

  .cds-title-wrap {
    max-width: 380px;
  }
  .cds-live-title {
    font-size: 22px;
    padding: 28px 32px 24px;
  }

  .cds-schedule-desktop {
    flex-wrap: wrap;
    gap: 8px;
  }

  /* Tablet: mỗi cột chiếm ~1/4 → 2 hàng (4 ngày + 3 ngày) */
  .cds-day-col {
    flex: 0 0 calc(14.28% - 8px);
    min-width: 80px;
  }

  .cds-day-label {
    font-size: 14px;
  }
  .cds-slot-text {
    font-size: 12px;
  }
}

/* ============================================================
   9. MOBILE — ≤ 480px
   ============================================================ */
@media (max-width: 480px) {
  .cds-live-outer {
    padding: 30px 16px 40px;
  }

  /* Ẩn desktop board, hiện mobile board */
  .cds-live-inner {
    display: none;
  }
  .cds-live-mobile {
    display: block;
  }

  .cds-title-wrap {
    max-width: 300px;
    margin-bottom: -16px;
  }
  .cds-live-title {
    font-size: 20px;
    padding: 28px 28px 22px;
    letter-spacing: 1.5px;
  }
}
