/* =====================================================================
   Booking Popup — booking-popup.css
   martinjason.com

   Glass technique from liquid-glass-vue / AppCard.vue:
   ─ backdrop-filter: brightness() blur() url(#bp-glass)
     The SVG displacement filter is applied INSIDE backdrop-filter,
     which makes the page content visible through the card warp organically.
   ─ feTurbulence + feDisplacementMap in the SVG (injected by booking-glass.js)
   ─ ::before with inset box-shadow for the glass rim glow
   ─ filter: drop-shadow() on the card for outer depth

   Progressive enhancement:
   ─ All browsers  → standard frosted glass (.booking-popup base styles)
   ─ Chrome / Edge → liquid glass (@supports backdrop-filter: url())
   ===================================================================== */


/* ── Overlay ─────────────────────────────────────────────────────────── */

.booking-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.22);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
          backdrop-filter: blur(10px) saturate(140%);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 360ms cubic-bezier(0.16, 1, 0.3, 1);
}

.booking-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}


/* ── Popup shell — glass layer (no overflow, no scroll) ─────────────
   Separating glass rendering from the scroll container eliminates the
   compositing artifact at the bottom clip edge that appears when
   backdrop-filter + filter: drop-shadow() share a scrollable element.
   ─────────────────────────────────────────────────────────────────── */

.booking-popup-shell {
  /* Shape */
  border-radius: 28px;
  width: 100%;
  max-width: 560px;
  position: relative;
  /* overflow: clip clips child content to the rounded corners without
     creating a block formatting context — safe to combine with
     backdrop-filter (unlike overflow: hidden which breaks it) */
  overflow: clip;

  /* Standard frosted glass — Safari / Firefox */
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturation));
          backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturation));
  border: 1px solid var(--glass-border);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    var(--glass-shadow-strong);

  /* Entry animation lives on the shell */
  transform: scale(0.95) translateY(10px);
  transition: transform 420ms cubic-bezier(0.16, 1, 0.3, 1);
}

.booking-overlay.is-open .booking-popup-shell {
  transform: scale(1) translateY(0);
}

/* Hard fallback — no backdrop-filter support */
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .booking-popup-shell { background: rgba(247, 245, 241, 0.97); }
}


/* ── Liquid glass enhancement (Chrome / Edge only) ───────────────────
   Glass effects on the shell — NOT the scroll container.
   ─────────────────────────────────────────────────────────────────── */

@supports (backdrop-filter: url('#')) {

  .booking-popup-shell {
    background: rgba(255, 255, 255, 0.50);
    border: none;
    -webkit-backdrop-filter: brightness(1.05) blur(2px) url(#bp-glass);
            backdrop-filter: brightness(1.05) blur(2px) url(#bp-glass);
    filter:
      drop-shadow(-6px -8px 40px rgba(255, 255, 255, 0.10))
      drop-shadow( 0px  20px 56px rgba(0,   0,   0,   0.24));
    box-shadow: none;
  }

  /* Glass rim glow on the shell */
  .booking-popup-shell::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: inherit;
    pointer-events: none;
    overflow: hidden;
    -webkit-box-shadow:
      inset  6px  6px 0px -6px rgba(255, 255, 255, 0.80),
      inset  0    0   8px  1px rgba(255, 255, 255, 0.55),
      inset  0   -4px 8px -3px rgba(255, 255, 255, 0.30);
    box-shadow:
      inset  6px  6px 0px -6px rgba(255, 255, 255, 0.80),
      inset  0    0   8px  1px rgba(255, 255, 255, 0.55),
      inset  0   -4px 8px -3px rgba(255, 255, 255, 0.30);
  }

}


/* ── Popup scroll container (inner) — no glass effects here ─────────── */

.booking-popup {
  /* Scroll lives here, isolated from glass compositing */
  max-height: 88vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 2.25rem 2.5rem 2.5rem;
  position: relative;
  border-radius: inherit;

  /* Hide scrollbar — Chrome/Safari/Edge */
  scrollbar-width: none;           /* Firefox */
  -ms-overflow-style: none;        /* IE / Edge legacy */
}
.booking-popup::-webkit-scrollbar {
  display: none;                   /* Chrome, Safari */
}


/* ── Ensure all popup content sits above the shell ::before rim ──────── */

.booking-popup > * {
  position: relative;
  z-index: 1;
}


/* ── Header ──────────────────────────────────────────────────────────── */

.bp-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.bp-eyebrow {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 500;
  color: #0A84FF;
  margin: 0 0 0.35rem;
}

.bp-title {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0;
  color: var(--color-ink);
}

.bp-close {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(10, 10, 10, 0.07);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--color-ink);
  transition: background 160ms ease, color 160ms ease;
  margin-top: 2px;
}
.bp-close:hover { background: rgba(10, 10, 10, 0.12); color: #0A0A0A; }


/* ── Timezone note ───────────────────────────────────────────────────── */

.bp-tz-note {
  font-size: 0.8rem;
  color: var(--color-ink);
  margin: 0 0 1.25rem;
}
.bp-tz-note strong { color: var(--color-ink); font-weight: 500; }


/* ── Loading state ───────────────────────────────────────────────────── */

.bp-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3rem 1rem;
  gap: 1rem;
  color: #54545A;
  font-size: 0.95rem;
}

.bp-spinner {
  width: 32px;
  height: 32px;
  border: 2.5px solid rgba(10, 132, 255, 0.18);
  border-top-color: #0A84FF;
  border-radius: 50%;
  animation: bp-spin 0.75s linear infinite;
}

@keyframes bp-spin { to { transform: rotate(360deg); } }


/* ── Meeting type selection ──────────────────────────────────────────── */

.bp-meeting-types {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.25rem;
}

/* Cards use same glass as site nav — backdrop-filter blur + white tint + border */
.bp-meeting-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border-radius: 14px;

  /* Site glass tokens — same as .glass on the nav */
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturation));
          backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturation));
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);

  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease,
              box-shadow 160ms ease;
}

.bp-meeting-card:hover {
  border-color: rgba(10, 132, 255, 0.45);
  background: rgba(10, 132, 255, 0.06);
  transform: translateY(-1px);
  box-shadow: var(--glass-shadow), 0 0 0 3px rgba(10, 132, 255, 0.08);
}

.bp-meeting-card-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  line-height: 1;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.60);
  border: 1px solid rgba(255, 255, 255, 0.80);
  border-radius: 10px;
}

.bp-meeting-card-body { flex: 1; min-width: 0; }

.bp-meeting-card-label {
  font-size: 0.96rem;
  font-weight: 600;
  color: #0A0A0A;
  letter-spacing: -0.01em;
  margin: 0 0 0.18rem;
  display: block;
}

.bp-meeting-card-desc {
  font-size: 0.8rem;
  color: #54545A;
  margin: 0;
  line-height: 1.4;
  display: block;
}

.bp-meeting-card-arrow {
  flex-shrink: 0;
  color: #C7C7CC;
  transition: color 160ms ease, transform 160ms ease;
}

.bp-meeting-card:hover .bp-meeting-card-arrow {
  color: #0A84FF;
  transform: translateX(3px);
}

/* Selected meeting type badge */
.bp-meeting-badge {
  /* Block-level so the back button always wraps to the next line */
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: #0A84FF;
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturation));
          backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturation));
  border: 1px solid rgba(10, 132, 255, 0.18);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  margin: 0;                /* flush left, no top gap */
  margin-bottom: 0.75rem;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Back button that follows the badge — sits on its own line with breathing room */
.bp-back--after-badge {
  display: inline-flex;
  margin-top: 0.55rem;
}


/* ── Calendar ────────────────────────────────────────────────────────── */

.bp-calendar { margin-top: 0.25rem; }

.bp-cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.bp-cal-month {
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--color-ink);
  letter-spacing: -0.01em;
  text-transform: capitalize;
}

.bp-cal-nav-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;

  /* Glass style for nav buttons */
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);

  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #54545A;
  transition: background 150ms ease, border-color 150ms ease;
}
.bp-cal-nav-btn:hover:not(:disabled) {
  background: rgba(10, 132, 255, 0.08);
  border-color: rgba(10, 132, 255, 0.3);
  color: #0A84FF;
}
.bp-cal-nav-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.bp-cal-days {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.bp-cal-dow {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-ink);
  padding: 0.3rem 0 0.6rem;
}

.bp-cal-cell {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 450;
  color: #54545A;
  position: relative;
  gap: 2px;
  transition: background 140ms ease, color 140ms ease;
}

.bp-cal-cell--disabled { color: rgba(10, 10, 10, 0.22); pointer-events: none; }

.bp-cal-cell--available { 
  color: var(--color-ink);
  cursor: pointer;
  font-weight: 500;
  background: rgb(255, 255, 255, 0.20);
}

.bp-cal-cell--available:hover {
  background: rgba(255, 255, 255, 0.60);
  color: #0A84FF;
}

.bp-cal-cell--today { font-weight: 600; }
.bp-cal-cell--today::after {
  content: '';
  position: absolute;
  bottom: 3px;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: #0A84FF;
  opacity: 0.45;
}

.bp-cal-cell--selected,
.bp-cal-cell--selected:hover {
  background: #0A84FF !important;
  color: #fff !important;
}
.bp-cal-cell--selected .bp-cal-dot { background: rgba(255, 255, 255, 0.7) !important; }

.bp-cal-dot {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: #0A84FF;
  flex-shrink: 0;
}


/* ── Back button ─────────────────────────────────────────────────────── */

.bp-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--color-ink);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem 0;
  margin-bottom: 1rem;
  transition: color 150ms ease;
}
.bp-back:hover { color: #0A84FF; }


/* ── Time slots ──────────────────────────────────────────────────────── */

.bp-times {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin-top: 0.25rem;
}

/* Time slots — same glass as nav / meeting cards */
.bp-time-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.85rem 0.75rem;
  border-radius: 12px;

  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturation));
          backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturation));
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);

  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}
.bp-time-slot:hover {
  border-color: rgba(10, 132, 255, 0.45);
  background: rgba(255, 255, 255, 0.75);
  transform: translateY(-1px);
}

.bp-time-local { font-size: 1rem; font-weight: 600; color: #0A0A0A; letter-spacing: -0.01em; }
.bp-time-bali  { font-size: 0.76rem; color: #8A8A92; font-weight: 400; }

.bp-no-slots {
  grid-column: 1 / -1;
  text-align: center;
  color: #8A8A92;
  font-size: 0.9rem;
  padding: 2rem;
}


/* ── Form ────────────────────────────────────────────────────────────── */

/* Slot preview — glass pill matching site style */
.bp-slot-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturation));
          backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturation));
  border: 1px solid rgba(10, 132, 255, 0.20);
  border-radius: 12px;
  padding: 0.85rem 1.1rem;
  margin-bottom: 1.5rem;
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);
}
.bp-slot-preview-time { font-size: 1rem; font-weight: 600; color: #0A0A0A; letter-spacing: -0.01em; }
.bp-slot-preview-tz   { font-size: 0.76rem; color: var(--color-ink); }

.bp-form { display: flex; flex-direction: column; gap: 1.1rem; }
.bp-field { display: flex; flex-direction: column; gap: 0.4rem; }

.bp-label { font-size: 0.85rem; font-weight: 500; color: var(--color-ink); }
.bp-optional { font-weight: 400; color: var(--color-ink); }

/* Inputs — glass style, clearly readable */
.bp-input,
.bp-textarea {
  width: 100%;
  padding: 0.78rem 1rem;
  border-radius: 11px;

  background: var(--glass-bg-strong);               /* rgba(255,255,255,0.78) */
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);

  font-family: inherit;
  font-size: 0.96rem;
  color: #0A0A0A;
  transition: border-color 160ms ease, box-shadow 160ms ease;
  outline: none;
  -webkit-appearance: none;
}
.bp-input::placeholder,
.bp-textarea::placeholder { color: #8A8A92; }
.bp-input:focus,
.bp-textarea:focus {
  border-color: #0A84FF;
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.12);
}
.bp-textarea { resize: vertical; min-height: 80px; }

/* Submit button */
.bp-submit {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 0.95rem 1.4rem;
  font-size: 1rem;
  border-radius: 999px;
  margin-top: 0.25rem;
  background: #0A0A0A;
  color: #F7F5F1;
  border: none;
  font-weight: 500;
  letter-spacing: -0.005em;
  cursor: pointer;
  position: relative;
  isolation: isolate;
  transition: transform 160ms cubic-bezier(0.16, 1, 0.3, 1),
              background 160ms ease,
              box-shadow 160ms ease;
  box-shadow: 0 1px 1px rgba(0,0,0,0.04), 0 8px 24px rgba(10,10,10,0.18);
}
.bp-submit::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,0.14), rgba(255,255,255,0));
  pointer-events: none;
  z-index: 1;
}
.bp-submit:hover  { transform: translateY(-1px); background: #0A84FF; }
.bp-submit:active { transform: translateY(0); }

.bp-privacy {
  font-size: 0.76rem;
  color: #8A8A92;
  text-align: center;
  margin: 0.25rem 0 0;
}


/* ── Success state ───────────────────────────────────────────────────── */

.bp-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1rem 0 0.5rem;
  gap: 0.75rem;
}

.bp-success-icon {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(10, 132, 255, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0A84FF;
  animation: bp-pop 500ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes bp-pop {
  from { transform: scale(0.6); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.bp-success-title {
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0.5rem 0 0;
  color: #0A0A0A;
}
.bp-success-sub { color: #54545A; font-size: 0.95rem; margin: 0; }

/* Success details — glass card */
.bp-success-details {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturation));
          backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturation));
  border-radius: 14px;
  padding: 1rem 1.5rem;
  margin: 0.5rem 0;
  width: 100%;
  box-shadow: var(--glass-shadow);
}
.bp-success-details p { margin: 0.2rem 0; font-size: 0.95rem; color: #0A0A0A; }

.bp-tz-badge {
  display: inline-block;
  font-size: 0.76rem;
  background: rgba(255, 255, 255, 0.60);
  border: 1px solid rgba(255, 255, 255, 0.80);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  color: #54545A;
  font-weight: 400;
}

.bp-success-close {
  margin-top: 0.5rem;
  padding: 0.75rem 2rem;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  color: #0A0A0A;
  transition: background 160ms ease, border-color 160ms ease;
}
.bp-success-close:hover {
  background: rgba(10, 10, 10, 0.05);
  border-color: rgba(10, 10, 10, 0.3);
}


/* ── Error state ─────────────────────────────────────────────────────── */

.bp-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  padding: 2rem 1rem;
  text-align: center;
  color: #54545A;
}
.bp-error p { margin: 0; font-size: 0.95rem; }


/* ── Reduced motion ──────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .booking-overlay,
  .booking-popup-shell { transition: none; }
}


/* ── Responsive ──────────────────────────────────────────────────────── */

@media (max-width: 600px) {
  .booking-popup-shell {
    border-radius: 22px;
  }
  .booking-popup {
    padding: 1.75rem 1.5rem 2rem;
    max-height: 92vh;
  }
  .bp-title        { font-size: 1.25rem; }
  .bp-times        { grid-template-columns: repeat(2, 1fr); gap: 0.4rem; }
  .bp-time-slot    { padding: 0.75rem 0.5rem; }
  .bp-time-local   { font-size: 0.9rem; }
  .bp-meeting-card { padding: 0.85rem 0.9rem; }
}

@media (max-width: 380px) {
  .bp-times { grid-template-columns: 1fr; }
}
