/* ===========================================================
   Club House Discovery — Signage Jadwal (TV display)
   Direkonstruksi high-fidelity dari design handoff.
   Kanvas tetap 1600×950, scale-to-fit (lihat app.js: fit()).
   =========================================================== */
:root {
  /* Latar & aksen */
  --page-bg: radial-gradient(1400px 900px at 50% -10%, #0f2740 0%, #0a1a2e 45%, #050d18 100%);
  --accent: linear-gradient(90deg, #3aa0ff, #25e0c0); /* underline/aksen */
  --accent-blue: #3aa0ff;

  /* Teks */
  --text: #eaf2ff;   /* utama */
  --text-2: #cfe0f5; /* sekunder */
  --text-3: #9db6d4; /* tersier / redup */

  /* Garis panel */
  --line-18: rgba(90, 140, 200, 0.18);
  --line-22: rgba(90, 140, 200, 0.22);

  /* Radius */
  --r-panel: 18px;
  --r-lesson: 16px;
  --r-time: 12px;
  --r-slot: 11px;
  --r-badge: 999px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; background: #050d18; overflow: hidden; }
body {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Barlow", sans-serif;
  color: var(--text);
}

/* ---------- Stage (kanvas tetap 1600×950, scale-to-fit) ---------- */
#stage {
  width: 1600px;
  height: 950px;
  flex: 0 0 auto;
  position: relative;
  transform-origin: center center;
  overflow: hidden;
  background: var(--page-bg);
  padding: 14px 26px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ---------- Slot gambar (logo & foto court, diisi manual) ---------- */
.img-slot {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.img-slot img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  position: relative;
  z-index: 2;
}
.img-slot.cover img { object-fit: cover; }
.img-slot .ph {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 4px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: #5f7ba3;
  background: rgba(12, 28, 48, 0.45);
  border: 1px dashed rgba(90, 140, 200, 0.35);
  border-radius: inherit;
}
.img-slot.is-empty .ph { display: flex; }

/* ---------- Header ---------- */
.head {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 2px 6px 12px;
  border-bottom: 1px solid var(--line-18);
}
.logo-clubhouse { justify-self: start; width: 250px; height: 84px; margin-left: -12px; }
/* Logo Club House rata kiri di dalam slot (bukan center) supaya menempel ke kiri */
.logo-clubhouse img { object-position: left center; }
.logo-jaya { justify-self: end; width: 200px; height: 60px; }
.title {
  font-family: "Oswald", sans-serif;
  font-weight: 700;
  font-size: 52px;
  letter-spacing: 2px;
  text-align: center;
  color: #fff;
  text-transform: uppercase;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.5);
}

/* ---------- Main ---------- */
.main {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr; /* panel lapangan & renang sama besar */
  gap: 22px;
  min-height: 0;
}

/* Lokasi dengan satu kategori saja → panel yang aktif memenuhi layar penuh.
   Class di-set dari app.js berdasarkan hasLapangan/hasRenang dari backend. */
.main.only-lapangan,
.main.only-renang {
  grid-template-columns: 1fr;
}
.main.only-lapangan .panel-swim {
  display: none;
}
.main.only-renang .panel-padel {
  display: none;
}

/* ===== KIRI — Padel courts ===== */
.panel-padel {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  /* Frame disamakan dengan panel-swim (renang) agar konsisten */
  background: linear-gradient(180deg, rgba(14, 36, 72, 0.7), rgba(8, 22, 48, 0.7));
  border: 1px solid rgba(70, 130, 220, 0.4);
  border-radius: var(--r-panel);
  padding: 19px;
  box-shadow: 0 0 40px rgba(30, 90, 180, 0.18) inset;
  min-height: 0;
  overflow: hidden; /* pengaman terakhir; ukuran sudah dikondisikan agar tidak perlu terpotong */
}

/* tidak scroll — semua isi (2 court + legend) dikondisikan pas muat
   dalam tinggi panel */
#courts {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
  min-height: 0;
}

/* Indikator halaman (slide) & transisi fade */
.pager {
  position: absolute;
  top: 18px;
  right: 20px;
  display: flex;
  gap: 8px;
  z-index: 5;
}
.pager .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(120, 160, 210, 0.28);
  transition: width 0.25s, background 0.25s;
}
.pager .dot.active {
  width: 22px;
  border-radius: 5px;
  background: var(--accent-blue);
  box-shadow: 0 0 8px rgba(58, 160, 255, 0.6);
}
#courts,
.lessons { transition: opacity 0.26s ease; }
#courts.fade-out,
.lessons.fade-out { opacity: 0; }

.court { display: flex; flex-direction: column; gap: 10px; margin-bottom: 4px; }
.court-head { display: flex; align-items: center; gap: 18px; }
.court-photo {
  width: 143px;
  height: 64px;
  flex: none;
  border-radius: var(--r-lesson);
  border: 2px solid rgba(120, 170, 220, 0.35);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}
.court-titlewrap { display: flex; flex-direction: column; gap: 5px; }
.court-title {
  font-family: "Oswald", sans-serif;
  font-weight: 700;
  font-size: 26px;
  line-height: 1.1;
  letter-spacing: 0.8px;
  color: #fff;
}
.court-underline {
  width: 112px;
  height: 4px;
  border-radius: 3px;
  background: var(--accent);
}

.slots {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.slot {
  border-radius: var(--r-slot);
  padding: 9px 4px;
  text-align: center;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.28);
}
.slot .time {
  font-family: "Chakra Petch", monospace;
  font-weight: 700;
  font-size: 17px;
  line-height: 1;
}
.slot .status {
  font-size: 11px;
  font-weight: 600;
  margin-top: 3px;
  opacity: 0.95;
}

/* Warna status slot (design tokens) */
.slot.s-tersedia {
  background: linear-gradient(180deg, #1f9e79, #127a5c);
  border: 1px solid #2fc79a;
  color: #fff;
}
.slot.s-digunakan {
  background: linear-gradient(180deg, #7e9c2f, #5f7a1f);
  border: 1px solid #a4c74a;
  color: #fff;
}
.slot.s-terbooking {
  background: linear-gradient(180deg, #c05468, #94374a);
  border: 1px solid #e07d90;
  color: #fff;
}
.slot.s-tidak {
  background: rgba(12, 28, 48, 0.85);
  border: 1px solid rgba(90, 140, 200, 0.28);
  color: var(--text-3);
}

/* Legenda */
.legend {
  flex: none;
  margin-top: 15px;
  display: flex;
  justify-content: center;
  gap: 19px;
  flex-wrap: wrap;
  padding: 9px 14px;
  background: rgba(8, 20, 36, 0.6);
  border: 1px solid var(--line-18);
  border-radius: 12px;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}
.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

/* ===== KANAN — Les Renang ===== */
.panel-swim {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: linear-gradient(180deg, rgba(14, 36, 72, 0.7), rgba(8, 22, 48, 0.7));
  border: 1px solid rgba(70, 130, 220, 0.4);
  border-radius: var(--r-panel);
  padding: 24px;
  box-shadow: 0 0 40px rgba(30, 90, 180, 0.18) inset;
  min-height: 0;
  overflow: hidden; /* jaga konten tetap di dalam panel, tak menimpa footer */
}
.swim-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 8px;
}
.swim-icon {
  flex: none;
  width: 46px;
  height: 46px;
  object-fit: contain;
}
.swim-titlewrap { display: flex; flex-direction: column; gap: 6px; }
.swim-title {
  font-family: "Oswald", sans-serif;
  font-weight: 700;
  font-size: 40px;
  letter-spacing: 1px;
  color: #fff;
}
.swim-underline {
  width: 120px;
  height: 4px;
  border-radius: 3px;
  background: var(--accent);
}

.lessons {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 16px;
  min-height: 0;
}
.lesson {
  /* Tinggi natural, TIDAK meregang — 1 kartu tetap ringkas, tidak memanjang
     ke bawah. Beberapa kartu tersusun rapi dari atas. */
  flex: 0 0 auto;
  display: flex;
  align-items: stretch;
  gap: 20px;
  border-radius: var(--r-lesson);
  padding: 0 20px 0 0; /* tanpa padding atas/bawah: band jam full-bleed ke tepi kartu */
  background: rgba(10, 26, 52, 0.55);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  border: 2px solid transparent; /* warna diisi per-variant di bawah */
}
.lesson-time {
  /* Band warna FULL setinggi kartu (atas-bawah menempel tepi kartu, seperti
     contoh.png) — bukan chip kecil yang di-inset. Sudut kiri mengikuti radius
     kartu. Jarak teks jam diatur lewat padding internal. */
  flex: none;
  width: 138px;
  padding: 16px 0;
  border-radius: var(--r-lesson) 0 0 var(--r-lesson);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: "Chakra Petch", monospace;
  font-weight: 700;
  font-size: 27px;
  line-height: 1.2;
}
.lesson-time .dash { opacity: 0.85; font-size: 19px; }
.lesson-body {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
  padding: 16px 0;
}
/* Ikon dibungkus cincin lingkaran berwarna sesuai status (seperti referensi) */
.lesson-icon-wrap {
  flex: none;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lesson-icon {
  flex: none;
  width: 50px;
  height: 50px;
  object-fit: contain;
}
.lesson-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.lesson-name {
  font-family: "Oswald", sans-serif;
  font-weight: 700;
  font-size: 27px;
  letter-spacing: 0.5px;
  color: #fff;
  line-height: 1.05;
}
.lesson-badge {
  align-self: start;
  padding: 6px 18px;
  border-radius: var(--r-badge);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #fff;
  text-transform: uppercase;
}

/* Warna les — hijau (SEDANG BERLANGSUNG) */
.lesson.l-green { border-color: rgba(76, 175, 80, 0.65); }
.lesson.l-green .lesson-time { background: linear-gradient(180deg, #4caf50, #2e8b3d); }
.lesson.l-green .lesson-badge { background: linear-gradient(90deg, #4caf50, #3a9440); }
.lesson.l-green .lesson-icon-wrap {
  background: rgba(76, 175, 80, 0.14);
  border: 2px solid rgba(76, 175, 80, 0.6);
}
.lesson.l-green .lesson-icon {
  filter: brightness(0) saturate(100%) invert(34.2%) sepia(40.9%) saturate(586.6%) hue-rotate(73deg) brightness(155.6%) contrast(96.9%);
}

/* Warna les — biru (AKAN DIMULAI) */
.lesson.l-blue { border-color: rgba(43, 142, 240, 0.65); }
.lesson.l-blue .lesson-time { background: linear-gradient(180deg, #2b8ef0, #1c66c4); }
.lesson.l-blue .lesson-badge { background: linear-gradient(90deg, #2b8ef0, #1c66c4); }
.lesson.l-blue .lesson-icon-wrap {
  background: rgba(43, 142, 240, 0.14);
  border: 2px solid rgba(43, 142, 240, 0.6);
}
.lesson.l-blue .lesson-icon {
  filter: brightness(0) saturate(100%) invert(10%) sepia(60.2%) saturate(537.5%) hue-rotate(168deg) brightness(444.9%) contrast(122.5%);
}

/* ---------- Footer ---------- */
.foot {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 12px 8px 14px; /* beri jarak bawah agar jam tidak menempel ke tepi */
  border-top: 1px solid var(--line-18);
}
.foot-note {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-self: center;
  color: var(--text-2);
  font-size: 15px;
  font-weight: 600;
}
.foot-clock {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.5px;
}
.foot-clock .sep { color: var(--accent-blue); }
.foot-clock .clock-time { font-family: "Chakra Petch", monospace; }