/* ============================================================
   PADEL BY THE 8 — styles
   ============================================================ */
:root {
  --bg: #0e1420;
  --bg-2: #131b2b;
  --card: #1a2333;
  --card-2: #202c40;
  --border: #2b3a55;
  --text: #e8eef7;
  --muted: #8ea0bd;
  --primary: #c8f04a;
  --primary-dark: #a9d02e;
  --primary-text: #0e1420;
  --danger: #e5484d;
  --success: #30a46c;
  --warn: #f5a524;
  --info: #46aef7;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: #d9ff6e; }
h1,h2,h3,h4 { line-height: 1.3; margin-bottom: .5rem; }
.container { width: min(1200px, 100% - 2.5rem); margin-inline: auto; }
.container-narrow { width: min(520px, 100% - 2.5rem); margin-inline: auto; }
.muted { color: var(--muted); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.mt-2 { margin-top: 1.5rem; }
.mt-3 { margin-top: 2rem; }
.mb-2 { margin-bottom: 1.25rem; }
.page { padding-block: 2.5rem; min-height: 60vh; }
.page-head { margin-bottom: 1.5rem; }
.no-wrap { white-space: nowrap; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .6rem 1.1rem; border-radius: 10px; border: 1px solid transparent;
  font-size: .95rem; font-weight: 600; cursor: pointer; line-height: 1.4; transition: .18s;
  background: transparent; color: var(--text); text-decoration: none;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.05); }
.btn-sm { padding: .38rem .7rem; font-size: .85rem; border-radius: 8px; }
.btn-lg { padding: .85rem 1.6rem; font-size: 1.02rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn-primary { background: var(--primary); color: var(--primary-text); }
.btn-primary:hover { background: #d5f468; color: var(--primary-text); }
.btn-outline { border-color: var(--primary); color: var(--primary); }
.btn-outline:hover { background: rgba(200,240,74,.1); }
.btn-ghost { border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--card-2); }
.btn-danger { background: var(--danger); color: #fff; }

/* ---------- Forms ---------- */
label { display: block; margin-bottom: .95rem; font-weight: 600; font-size: .92rem; }
label small { display: block; font-weight: 400; color: var(--muted); margin-top: .25rem; }
input, select, textarea {
  width: 100%; padding: .65rem .8rem; margin-top: .3rem;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  font: inherit; transition: .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); }
textarea { resize: vertical; }
.input-sm { width: auto; padding: .35rem .55rem; margin-top: 0; font-size: .85rem; border-radius: 8px; }
.form-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.form-row > * { flex: 1 1 180px; }
.form-row.checkboxes { align-items: center; }
.checkbox-label input { width: auto; margin-right: .5rem; }
.inline-form { display: inline-flex; gap: .35rem; align-items: center; }
.card .filters { display: flex; gap: .75rem; align-items: flex-end; }
.filters input[type="search"] { margin-top: 0; }

/* ---------- Cards ---------- */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.4rem;
}
.alert {
  padding: .8rem 1.1rem; border-radius: 10px; margin-bottom: 1rem;
  border: 1px solid; font-size: .95rem;
}
.alert-success { background: rgba(48,164,108,.15); border-color: var(--success); color: #b6e8cd; }
.alert-error, .alert-danger { background: rgba(229,72,77,.15); border-color: var(--danger); color: #f3b9bb; }
.alert-warn { background: rgba(245,165,36,.15); border-color: var(--warn); color: #f6d9a8; }
.alert-info { background: rgba(70,174,247,.14); border-color: var(--info); color: #bfe0fb; }
.empty { color: var(--muted); padding: .4rem 0; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(14,20,32,.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 1rem; padding-block: .9rem; }
.brand { display: flex; align-items: center; gap: .7rem; font-weight: 800; font-size: 1.15rem; color: var(--text); }
.brand:hover { color: var(--text); }
.brand-logo {
  display: inline-grid; place-items: center; width: 38px; height: 38px;
  background: var(--primary); color: var(--primary-text); border-radius: 10px;
  font-weight: 900; letter-spacing: -1px; font-size: 1rem;
}
.site-nav { display: flex; align-items: center; gap: 1rem; margin-left: auto; }
.site-nav ul { display: flex; list-style: none; gap: .1rem; flex-wrap: wrap; }
.site-nav a { color: var(--text); padding: .5rem .7rem; border-radius: 8px; font-size: .93rem; }
.site-nav a:hover { color: var(--primary); }
.site-nav a.active { color: var(--primary); background: rgba(200,240,74,.08); }
.nav-auth { display: flex; gap: .45rem; margin-left: .5rem; }
.nav-toggle {
  display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 6px;
}
.nav-toggle span { width: 24px; height: 2px; background: var(--text); border-radius: 2px; }

/* ---------- Hero ---------- */
.hero {
  position: relative; text-align: center; padding: 6rem 1rem 4rem;
  background:
    radial-gradient(1200px 600px at 70% -10%, rgba(200,240,74,.18), transparent 60%),
    radial-gradient(900px 500px at 10% 110%, rgba(70,174,247,.14), transparent 60%),
    var(--bg-2);
  border-bottom: 1px solid var(--border);
}
.hero-inner { width: min(860px, 100% - 2rem); margin-inline: auto; }
.hero-eyebrow { color: var(--primary); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; font-size: .85rem; }
.hero-title { font-size: clamp(2.1rem, 5vw, 3.6rem); margin: .6rem 0; }
.hero-sub { color: var(--muted); max-width: 620px; margin: .4rem auto 1.6rem; font-size: 1.1rem; }
.hero-actions { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; }
.hero-promo {
  display: inline-block; margin-top: 1.8rem; padding: .6rem 1.2rem;
  border: 1px dashed var(--primary); border-radius: 999px; color: var(--primary); font-size: .95rem;
}

/* ---------- Sections ---------- */
.section { padding-block: 3.2rem; }
.section-alt { background: var(--bg-2); border-block: 1px solid var(--border); }
.section-head { text-align: center; margin-bottom: 2rem; }
.kicker { color: var(--primary); font-weight: 700; text-transform: uppercase; letter-spacing: .12em; font-size: .82rem; }
.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }

/* ---------- Grids ---------- */
.grid { display: grid; gap: 1.2rem; }
.courts-grid, .packages-grid, .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.pricing-grid, .schedule-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.pricing-grid .card { text-align: center; }
.price-card table { text-align: left; }
.court-card { overflow: hidden; padding: 0; }
.court-card img { height: 190px; width: 100%; object-fit: cover; }
.court-card .card-body { padding: 1.2rem; }
.court-placeholder { height: 190px; display: grid; place-items: center; background: linear-gradient(135deg,var(--card-2),var(--bg)); font-size: 2.4rem; font-weight: 900; color: var(--primary); }
.package-card h3 { color: var(--primary); }
.package-meta { display: flex; gap: .8rem; color: var(--muted); font-size: .9rem; margin-bottom: .5rem; }
.package-price { font-size: 1.6rem; font-weight: 800; margin-bottom: .6rem; }

/* ---------- Tables ---------- */
.table-wrap { padding: 0; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th, .table td { padding: .7rem .9rem; text-align: left; border-bottom: 1px solid var(--border); }
.table th { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; background: rgba(255,255,255,.02); }
.table tr:last-child td { border-bottom: 0; }
.table tfoot td { font-weight: 700; background: rgba(200,240,74,.06); }
.table-compact th, .table-compact td { padding: .5rem .7rem; }
.list-thumb { width: 34px; height: 34px; object-fit: cover; border-radius: 8px; display: inline-block; vertical-align: middle; margin-right: .5rem; }
.court-photo-preview { width: 90px; height: 60px; object-fit: cover; border-radius: 8px; display: inline-block; }

/* ---------- Badges ---------- */
.badge {
  display: inline-block; padding: .18rem .55rem; border-radius: 999px;
  font-size: .78rem; font-weight: 700; white-space: nowrap;
}
.badge-success { background: rgba(48,164,108,.18); color: #8fe0b5; }
.badge-danger { background: rgba(229,72,77,.18); color: #f3a8ab; }
.badge-warn { background: rgba(245,165,36,.18); color: #f6c76d; }
.badge-info { background: rgba(70,174,247,.18); color: #9ad3fb; }
.badge-muted { background: rgba(142,160,189,.18); color: var(--muted); }

/* ---------- Slot row ---------- */
.slot-row { display: flex; justify-content: space-between; padding: .55rem 0; border-bottom: 1px dashed var(--border); }
.slot-row:last-child { border-bottom: 0; }

/* ---------- Booking ---------- */
.slot-box { margin-block: 1.2rem; }
.slot-list { list-style: none; display: grid; gap: .6rem; margin-top: .5rem; }
.slot-list li { display: flex; align-items: center; gap: .7rem; }
.slot-list input[type="radio"] { width: auto; margin: 0; accent-color: var(--primary); }
.slot-list .slot-time { min-width: 120px; font-weight: 600; }
.slot-list .slot-price { margin-left: auto; font-weight: 700; }
.slot-list .slot-price-free { color: var(--success); }
.slot-taken { opacity: .45; pointer-events: none; }
.booking-form { margin-block: 1.2rem; }
.booking-form .form-row { align-items: flex-end; }
.slot-summary { padding: .6rem .8rem; background: var(--bg-2); border-radius: 10px; }
.booking-confirm h3 { margin-bottom: .75rem; }

/* ---------- Auth ---------- */
.auth-card { max-width: 460px; margin-inline: auto; }
.auth-title { text-align: center; }
.auth-hint { text-align: center; margin-top: 1rem; color: var(--muted); font-size: .92rem; }

/* ---------- Customer nav ---------- */
.customer-nav { display: flex; align-items: center; gap: 1.2rem; margin-bottom: 1.6rem; flex-wrap: wrap; }
.customer-hello { display: flex; flex-direction: column; }
.customer-tabs { display: flex; gap: .2rem; flex-wrap: wrap; }
.customer-tab { color: var(--text); padding: .45rem .75rem; border-radius: 8px; font-size: .9rem; }
.customer-tab:hover { color: var(--primary); }
.customer-tab.active { color: var(--primary); background: rgba(200,240,74,.08); }

/* ---------- Media grid ---------- */
.media-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.media-item { padding: .7rem; }
.media-item img { width: 100%; height: 150px; object-fit: cover; border-radius: 6px; }
.media-video-thumb { width: 100%; height: 150px; border-radius: 6px; background: #000; }
.media-locked {
  height: 150px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem;
  background: var(--bg-2); border-radius: 10px; color: var(--muted);
}
.lock-icon { font-size: 1.6rem; }
.media-preview-locked { position: relative; }
.media-preview-locked img { display: block; }
.media-preview-locked a { display: block; }
.cart-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; display: inline-block; vertical-align: middle; margin-right: .5rem; }
.event-block { margin-bottom: 2.2rem; }
.event-head { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; margin-bottom: 1rem; }
.event-head h2 { margin: 0; }
.cart-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 1.2rem; flex-wrap: wrap; gap: .8rem; }
.pay-card { border: 1px solid var(--primary); }

/* ---------- Foto & Video per sesi ---------- */
.p8-marquee {
  overflow: hidden; position: relative;
  background: linear-gradient(90deg, #0ea5e9, #6366f1);
  border-radius: 10px; margin: 0 0 .9rem;
  box-shadow: 0 2px 10px rgba(0,0,0,.12);
}
.p8-marquee-track {
  display: inline-flex; white-space: nowrap; width: max-content;
  animation: p8-marq 22s linear infinite;
  will-change: transform;
}
.p8-marquee-track span {
  padding: .5rem 1.2rem; font-size: .85rem; font-weight: 700;
  letter-spacing: .02em; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.25);
}
@keyframes p8-marq {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.lookup-form .form-row { max-width: 420px; }
.booking-info-grid { display: grid; gap: .2rem .8rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.booking-info-grid .muted { display: block; font-size: .9rem; }
.media-item video { width: 100%; height: 150px; object-fit: cover; border-radius: 6px; background: #000; }
.media-grid .media-item .btn-sm { margin-top: .4rem; }

/* ---------- Pemutar video publik (pilihan kualitas + proteksi) ---------- */
.p8-videobox { position: relative; background: #000; border-radius: 6px; overflow: hidden; }
.p8-videobox video { width: 100%; height: 150px; object-fit: contain; border-radius: 6px; background: #000; display: block; }
.p8-vqbtn {
  position: absolute; top: .45rem; right: .45rem; z-index: 5;
  padding: .2rem .62rem; font-size: .72rem; font-weight: 700; line-height: 1.2;
  color: #fff; background: rgba(0,0,0,.55); border: 1px solid rgba(255,255,255,.35);
  border-radius: 999px; cursor: pointer; user-select: none; -webkit-user-select: none;
}
.p8-vqbtn:hover { background: rgba(0,0,0,.78); }
.p8-vqbtn.is-full { background: #2b6ae0; border-color: transparent; }

/* ---------- Media admin ---------- */
.admin-media-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.media-edit { margin-top: .6rem; display: flex; flex-direction: column; gap: .4rem; }

.media-edit select, .media-edit input { margin-top: 0; }
.media-item .media-name { margin: .55rem 0 .35rem; word-break: break-word; }
/* ---------- Facility / map ---------- */
.facilities-list { list-style: none; display: grid; gap: .7rem; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.facility-item { padding: .9rem 1.2rem; text-align: center; font-weight: 600; }
.map-grid { display: grid; gap: 1.2rem; grid-template-columns: 1fr 1.4fr; }
.map-embed { padding: 0; overflow: hidden; }
.map-embed iframe { width: 100%; height: 300px; border: 0; }
.cta-banner {
  margin-top: 2.2rem; text-align: center; padding: 2.4rem 1rem;
  background: linear-gradient(120deg, rgba(200,240,74,.12), rgba(70,174,247,.1));
  border: 1px solid var(--border); border-radius: var(--radius);
}
.cta-banner p { color: var(--muted); margin-bottom: 1.2rem; }
.cta-line { text-align: center; margin-top: 1.2rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--bg-2); border-top: 1px solid var(--border); padding-top: 2.4rem; margin-top: 3rem; }
.footer-grid { display: grid; gap: 1.6rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); padding-bottom: 1.6rem; }
.footer-grid h4 { color: var(--primary); }
.footer-grid p { color: var(--muted); font-size: .93rem; }
.footer-links { list-style: none; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--primary); }
.footer-bottom { border-top: 1px solid var(--border); padding-block: 1rem; color: var(--muted); font-size: .85rem; }

/* ---------- Admin layout ---------- */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 230px; flex-shrink: 0; background: var(--bg-2);
  border-right: 1px solid var(--border); padding: 1.2rem 1rem;
  display: flex; flex-direction: column; gap: 1rem; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.admin-brand { display: flex; flex-direction: column; gap: .2rem; }
.admin-brand a { color: var(--text); display: flex; align-items: center; gap: .6rem; }
.admin-menu { display: flex; flex-direction: column; gap: .15rem; }
.admin-link { color: var(--text); padding: .55rem .8rem; border-radius: 9px; font-size: .93rem; }
.admin-link:hover { background: var(--card-2); color: var(--primary); }
.admin-link.active { background: rgba(200,240,74,.1); color: var(--primary); font-weight: 600; }
.admin-sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: .15rem; border-top: 1px solid var(--border); padding-top: 1rem; }
.admin-main { flex: 1; min-width: 0; }
.admin-topbar {
  display: flex; align-items: center; gap: 1rem; padding: 1rem 1.6rem;
  border-bottom: 1px solid var(--border); background: var(--bg-2);
  position: sticky; top: 0; z-index: 40;
}
.admin-page-title { font-size: 1.25rem; margin: 0; }
.admin-content { padding: 1.6rem; }
.admin-grid-2 { display: grid; gap: 1.4rem; grid-template-columns: 1fr 1.4fr; align-items: start; }
.admin-stats { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.2rem; flex-wrap: wrap; }
.toolbar h2 { margin: 0; }
.stat { text-align: center; padding: 1.2rem; }
.stat-num { display: block; font-size: 1.7rem; font-weight: 800; color: var(--primary); }
.stat-label { color: var(--muted); font-size: .86rem; }

/* ---------- Quick availability ---------- */
.quick-availability { margin-top: 1.4rem; }
.quick-availability .form-inline { display: flex; gap: 1rem; flex-wrap: wrap; align-items: flex-end; }
.quick-availability label { margin-bottom: 0; }

/* ---------- Lightbox ---------- */
.p8-lb { position: fixed; inset: 0; z-index: 1000; background: rgba(8,10,14,.88);
  display: none; align-items: center; justify-content: center; }
.p8-lb.open { display: flex; }
.p8-lb-card { position: relative; max-width: 94vw; max-height: 92vh; display: flex; flex-direction: column; }
.p8-lb-stage { position: relative; display: grid; place-items: center; width: 92vw; height: 82vh;
  overflow: hidden; cursor: zoom-in; touch-action: none;
  border: 1px solid rgba(255,255,255,.16); border-radius: 14px;
  background: rgba(0,0,0,.25); }
.p8-lb-stage.zoomed { cursor: grab; }
.p8-lb-stage.grabbing { cursor: grabbing; }
.p8-lb-frame { will-change: transform; transform-origin: center center; min-width: 0; min-height: 0; }
.p8-lb-spin { position: absolute; width: 42px; height: 42px; border-radius: 50%;
  border: 4px solid rgba(255,255,255,.2); border-top-color: #fff; animation: p8sp 1s linear infinite; }
@keyframes p8sp { to { transform: rotate(360deg); } }
.p8-lb img { max-width: 92vw; max-height: 82vh; object-fit: contain; border-radius: 10px;
  box-shadow: 0 30px 80px rgba(0,0,0,.5); background: #000; display: block;
  user-select: none; -webkit-user-drag: none; }
.p8-lb img.loading { opacity: 0; }
.p8-lb-stage.zoomed img { max-width: none; max-height: none; border-radius: 0; }
.p8-lb-cap { color: #CFD4DC; font-size: 13px; text-align: center; padding: 10px 8px; }
.p8-lb-hint { color: rgba(255,255,255,.45); font-size: 12px; text-align: center; padding: 0 8px 6px; }
.p8-lb-x, .p8-lb-prev, .p8-lb-next, .p8-lb-in, .p8-lb-out, .p8-lb-reset {
  position: absolute; border: none; cursor: pointer; z-index: 10;
  background: rgba(255,255,255,.14); color: #fff; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; font-size: 22px; line-height: 1; transition: background .15s;
  box-shadow: 0 4px 14px rgba(0,0,0,.35); }
.p8-lb-x { top: 10px; right: 10px; background: rgba(229,61,118,.92); }
.p8-lb-reset { top: 10px; left: 10px; width: 40px; height: 40px; font-size: 15px; font-weight: 600; }
.p8-lb-prev, .p8-lb-next { top: 50%; transform: translateY(-50%); }
.p8-lb-prev { left: 10px; }
.p8-lb-next { right: 10px; }
.p8-lb-in, .p8-lb-out { right: 10px; left: auto; width: 36px; height: 36px; font-size: 20px; background: rgba(255,255,255,.10); }
.p8-lb-in { bottom: 68px; }
.p8-lb-out { bottom: 24px; }
.p8-lb-x:hover, .p8-lb-prev:hover, .p8-lb-next:hover,
.p8-lb-in:hover, .p8-lb-out:hover, .p8-lb-reset:hover { background: rgba(229,61,118,.9); }
body.p8-no-scroll { overflow: hidden; }
@media (max-width: 900px) {
  .p8-lb-prev { left: 6px; }
  .p8-lb-next { right: 6px; }
  .p8-lb-x { top: 8px; right: 8px; }
  .p8-lb-in, .p8-lb-out { right: 6px; }
  .p8-lb-in { bottom: 62px; }
  .p8-lb-out { bottom: 22px; }
  .p8-lb-reset { top: 8px; left: 8px; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .nav-toggle { display: flex; margin-left: auto; }
  .site-nav {
    position: fixed; inset: 61px 0 auto 0; flex-direction: column; align-items: stretch;
    background: var(--bg-2); padding: 1rem; gap: .8rem;
    transform: translateY(-140%); transition: .25s; border-bottom: 1px solid var(--border);
  }
  .site-nav.open { transform: none; }
  .site-nav ul { flex-direction: column; }
  .nav-auth { margin-left: 0; flex-wrap: wrap; }
  .admin-layout { flex-direction: column; }
  .admin-sidebar {
    position: fixed; inset: 0 auto 0 0; width: 240px; transform: translateX(-105%);
    transition: .25s; z-index: 60; height: 100vh;
  }
  .admin-sidebar.open { transform: none; box-shadow: var(--shadow); }
  .admin-nav-toggle { display: flex; }
  .map-grid { grid-template-columns: 1fr; }
  .admin-grid-2 { grid-template-columns: 1fr; }
}