/* ============================================================
   schedule.css — Halaman Jadwal Tayang
   Import: tokens.css wajib dimuat sebelum file ini
   ============================================================ */

/* ── HERO HEADER ──────────────────────────────────────────── */
.schedule-hero {
  background: linear-gradient(180deg, var(--surface-2) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
  padding: 32px 24px 0;
}

.schedule-hero__inner {
  max-width: 1200px;
  margin: 0 auto;
}

.schedule-hero__title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 36px;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.schedule-hero__sub {
  font-size: 14px;
  color: var(--text-2);
  margin-bottom: 20px;
}

/* Navigasi minggu */
.week-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.week-nav__label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-1);
  background: var(--surface-3);
  border: 1px solid var(--border-hi);
  border-radius: var(--r-sm);
  padding: 6px 14px;
}

.btn-week {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  cursor: pointer;
}

.btn-week:hover {
  color: var(--text-1);
  border-color: var(--border-hi);
  background: var(--surface-3);
}

/* ── FILTER KATEGORI ──────────────────────────────────────── */
.schedule-filter {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-bottom: 0;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 500;
  font-family: 'Space Grotesk', sans-serif;
  color: var(--text-2);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 100px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.filter-pill:hover {
  color: var(--text-1);
  border-color: var(--border-hi);
}

.filter-pill.active {
  color: var(--red);
  background: var(--red-dim);
  border-color: var(--red-border);
}

/* ── TABS HARI (7 HARI) ───────────────────────────────────── */
.day-tabs-wrap {
  background: var(--surface-1);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: var(--nav-h);
  z-index: 50;
}

.day-tabs {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.day-tabs::-webkit-scrollbar {
  display: none;
}

.day-tab {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 20px;
  min-width: 80px;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: color 0.2s, border-color 0.2s;
  background: transparent;
  color: var(--text-2);
}

.day-tab:hover {
  color: var(--text-1);
  background: var(--surface-2);
}

.day-tab.active {
  color: var(--red);
  border-bottom-color: var(--red);
  background: var(--red-dim);
}

.day-tab__name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.day-tab__date {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}

.day-tab__today-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: var(--red-shadow);
}

.day-tab.today .day-tab__date {
  color: var(--red);
}

/* ── KONTEN UTAMA ─────────────────────────────────────────── */
.schedule-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
  min-height: calc(100vh - var(--nav-h) - 200px);
}

/* Jumlah konten per hari */
.day-count-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 16px;
  padding: 6px 12px;
  background: var(--surface-2);
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
}

.day-count-badge strong {
  color: var(--text-1);
  font-family: 'Space Grotesk', sans-serif;
}

/* ── GRUP WAKTU ───────────────────────────────────────────── */
.time-group {
  margin-bottom: 32px;
}

.time-group__label {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-3);
  padding: 0 0 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

/* ── ITEM JADWAL ──────────────────────────────────────────── */
.schedule-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  background: var(--surface-1);
  margin-bottom: 8px;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
  cursor: pointer;
  animation: fadeIn 0.3s ease;
}

.schedule-item:hover {
  background: var(--surface-2);
  border-color: var(--border-hi);
  transform: translateX(2px);
}

/* Thumbnail */
.schedule-item__thumb {
  position: relative;
  width: 100px;
  height: 60px;
  flex-shrink: 0;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--surface-3);
}

.schedule-item__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.schedule-item:hover .schedule-item__thumb img {
  transform: scale(1.06);
}

.schedule-item__thumb-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.2s;
  font-size: 20px;
}

.schedule-item:hover .schedule-item__thumb-play {
  opacity: 1;
}

/* Info */
.schedule-item__info {
  flex: 1;
  min-width: 0;
}

.schedule-item__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.schedule-item__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: 6px;
}

.schedule-item__meta-sep {
  color: var(--text-3);
}

.schedule-item__time {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-2);
  font-family: 'Space Grotesk', sans-serif;
}

.schedule-item__time-wib {
  color: var(--red);
  font-weight: 500;
}

.schedule-item__time-orig {
  color: var(--text-3);
}

/* Badge kategori */
.schedule-item__cat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 500;
  font-family: 'Space Grotesk', sans-serif;
  border-radius: 4px;
  white-space: nowrap;
}

.schedule-item__cat--kdrama {
  background: rgba(59, 130, 246, 0.15);
  color: #60A5FA;
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.schedule-item__cat--anime {
  background: rgba(192, 132, 252, 0.15);
  color: #C084FC;
  border: 1px solid rgba(192, 132, 252, 0.25);
}

.schedule-item__cat--cdrama {
  background: rgba(251, 191, 36, 0.12);
  color: #FCD34D;
  border: 1px solid rgba(251, 191, 36, 0.2);
}

.schedule-item__cat--series {
  background: rgba(34, 197, 94, 0.12);
  color: #4ADE80;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.schedule-item__cat--other {
  background: var(--surface-3);
  color: var(--text-2);
  border: 1px solid var(--border);
}

/* Rating & Durasi */
.schedule-item__rating {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  font-weight: 600;
  color: var(--yellow);
  font-family: 'Space Grotesk', sans-serif;
}

/* Tombol reminder */
.schedule-item__actions {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.btn-reminder {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 500;
  font-family: 'Space Grotesk', sans-serif;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  white-space: nowrap;
}

.btn-reminder:hover {
  color: var(--text-1);
  border-color: var(--border-hi);
}

.btn-reminder.active {
  color: var(--red);
  background: var(--red-dim);
  border-color: var(--red-border);
}

.btn-reminder.active .btn-reminder__icon {
  animation: glowPulse 1.5s ease infinite;
}

.btn-reminder__icon {
  font-size: 14px;
}

/* ── DETAIL JADWAL (expanded) ─────────────────────────────── */
.schedule-item.is-expanded {
  flex-wrap: wrap;
}

.schedule-item__expand {
  width: 100%;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.6;
  display: none;
  animation: slideUp 0.25s ease;
}

.schedule-item.is-expanded .schedule-item__expand {
  display: block;
}

/* ── LOADING SKELETON ─────────────────────────────────────── */
.schedule-skeleton {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.schedule-skeleton-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  background: var(--surface-1);
  border: 1px solid var(--border);
}

.schedule-skeleton-thumb {
  width: 100px;
  height: 60px;
  border-radius: var(--r-sm);
  flex-shrink: 0;
}

.schedule-skeleton-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ── EMPTY STATE ──────────────────────────────────────────── */
.schedule-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  text-align: center;
  gap: 12px;
  animation: fadeIn 0.3s ease;
}

.schedule-empty__icon {
  font-size: 48px;
  opacity: 0.5;
}

.schedule-empty__title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--text-2);
}

.schedule-empty__sub {
  font-size: 14px;
  color: var(--text-3);
}

/* ── REMINDER BANNER (notif permission) ───────────────────── */
.notif-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--red-dim);
  border: 1px solid var(--red-border);
  border-radius: var(--r-md);
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--text-1);
  animation: slideDown 0.3s ease;
}

.notif-banner__icon {
  font-size: 20px;
  flex-shrink: 0;
}

.notif-banner__msg {
  flex: 1;
}

.notif-banner__close {
  font-size: 16px;
  color: var(--text-3);
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s;
}

.notif-banner__close:hover {
  color: var(--text-1);
}

/* ── SIDEBAR — REMINDER LIST ──────────────────────────────── */
.schedule-layout {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 24px;
  padding: 24px;
}

.schedule-content {
  min-width: 0;
}

.schedule-sidebar {
  position: sticky;
  top: calc(var(--nav-h) + 57px); /* sticky di bawah tab hari */
  height: fit-content;
}

.sidebar-box {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.sidebar-box__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-box__title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-1);
}

.sidebar-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: var(--red);
  color: white;
  font-size: 11px;
  font-weight: 700;
  font-family: 'Space Grotesk', sans-serif;
  border-radius: 100px;
}

.sidebar-box__body {
  padding: 8px;
  max-height: 400px;
  overflow-y: auto;
}

.reminder-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 8px;
  border-radius: var(--r-sm);
  transition: background 0.2s;
}

.reminder-item:hover {
  background: var(--surface-2);
}

.reminder-item__info {
  flex: 1;
  min-width: 0;
}

.reminder-item__title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.reminder-item__time {
  font-size: 11px;
  color: var(--text-2);
}

.btn-reminder-remove {
  font-size: 14px;
  color: var(--text-3);
  cursor: pointer;
  padding: 2px 4px;
  flex-shrink: 0;
  transition: color 0.2s;
  background: transparent;
  border: none;
}

.btn-reminder-remove:hover {
  color: var(--red);
}

.sidebar-empty {
  padding: 20px 8px;
  text-align: center;
  font-size: 13px;
  color: var(--text-3);
}

/* ── MOBILE ───────────────────────────────────────────────── */
@media (max-width: 900px) {
  .schedule-layout {
    grid-template-columns: 1fr;
    padding: 16px;
    gap: 16px;
  }

  .schedule-sidebar {
    position: static;
    order: -1;
  }

  .schedule-hero {
    padding: 20px 16px 0;
  }

  .schedule-hero__title {
    font-size: 26px;
  }

  .week-nav {
    flex-wrap: wrap;
    gap: 8px;
  }

  .schedule-item__actions {
    flex-direction: row;
    align-items: center;
  }

  .schedule-item__thumb {
    width: 80px;
    height: 50px;
  }
}

@media (max-width: 600px) {
  .day-tab {
    min-width: 64px;
    padding: 12px 12px;
  }

  .day-tab__date {
    font-size: 18px;
  }

  .schedule-item {
    flex-wrap: wrap;
    padding: 12px;
  }

  .schedule-item__actions {
    width: 100%;
    flex-direction: row;
    justify-content: flex-end;
  }

  .schedule-item__title {
    font-size: 14px;
  }

  .btn-reminder {
    padding: 6px 12px;
  }
}
