/* Renubu inline booking widget — month-calendar date picker + time list.
   Light theme to match renubu.com. Paired with booking.js (#renubu-booking). */

#renubu-booking {
  --rb-ink: #230380;        /* dark purple text */
  --rb-brand: #6b45da;      /* purple accent */
  --rb-brand-weak: #efecfb; /* light purple fill */
  --rb-line: #dcdaf0;       /* subtle borders */
  --rb-muted: #6b6b86;      /* secondary text */
  width: 100%;
  min-width: 300px;
  color: var(--rb-ink);
  container-type: inline-size; /* stack panes based on the widget's own width */
}

#renubu-booking .rb-card {
  background: #ffffff;
  border: 1px solid var(--rb-line);
  border-radius: 16px;
  padding: 20px 18px;
  box-shadow: 0 8px 30px rgba(35, 3, 128, 0.06);
  min-height: 380px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ── two-pane picker: calendar | times ── */
#renubu-booking .rb-picker {
  display: flex;
  gap: 22px;
  align-items: flex-start;
}
#renubu-booking .rb-cal { flex: 1 1 55%; min-width: 0; }
#renubu-booking .rb-times { flex: 1 1 45%; min-width: 0; }

/* calendar */
#renubu-booking .rb-cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
#renubu-booking .rb-cal-title { font-size: 15px; font-weight: 700; color: var(--rb-ink); }

#renubu-booking .rb-cal-dows,
#renubu-booking .rb-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}
#renubu-booking .rb-cal-dows { margin-bottom: 4px; }
#renubu-booking .rb-cal-dow {
  text-align: center;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--rb-muted);
}
#renubu-booking .rb-cal-grid-dim { opacity: 0.4; pointer-events: none; }
#renubu-booking .rb-cal-blank { aspect-ratio: 1 / 1; }
#renubu-booking .rb-cal-day {
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: var(--rb-brand-weak);
  color: var(--rb-ink);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s, box-shadow 0.15s;
}
#renubu-booking .rb-cal-day:hover { background: #e0d9f9; }
#renubu-booking .rb-cal-day-off {
  background: transparent;
  color: #b9b7ce;
  cursor: default;
}
#renubu-booking .rb-cal-day-today { box-shadow: inset 0 0 0 1.5px var(--rb-brand); }
#renubu-booking .rb-cal-day-sel,
#renubu-booking .rb-cal-day-sel:hover {
  background: var(--rb-brand);
  color: #fff;
}

/* times list */
#renubu-booking .rb-times-head {
  font-size: 14px;
  font-weight: 700;
  color: var(--rb-ink);
  margin: 0 0 12px;
}
#renubu-booking .rb-times-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 296px;
  overflow-y: auto;
  padding-right: 4px;
}
#renubu-booking .rb-times-empty { padding: 8px 0; }

#renubu-booking .rb-slot {
  border: 1px solid var(--rb-brand);
  background: #fff;
  color: var(--rb-brand);
  border-radius: 10px;
  padding: 11px 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
  white-space: nowrap;
}
#renubu-booking .rb-slot:hover { background: var(--rb-brand); color: #fff; }

/* thin scrollbar for the times list */
#renubu-booking .rb-times-list::-webkit-scrollbar { width: 6px; }
#renubu-booking .rb-times-list::-webkit-scrollbar-thumb { background: var(--rb-line); border-radius: 3px; }

#renubu-booking .rb-arrow {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border: 1px solid var(--rb-line);
  background: #fff;
  border-radius: 9px;
  color: var(--rb-brand);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.15s, opacity 0.15s;
}
#renubu-booking .rb-arrow:hover:not(:disabled) { background: var(--rb-brand-weak); }
#renubu-booking .rb-arrow:disabled { opacity: 0.3; cursor: default; }

#renubu-booking .rb-tz { margin: 16px 0 0; font-size: 12px; color: var(--rb-muted); text-align: center; }

/* ── attendee form ── */
#renubu-booking .rb-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 440px;
  margin: 0 auto;
  width: 100%;
  text-align: left; /* section is centered; forms read better left-aligned */
}
#renubu-booking .rb-back {
  align-self: flex-start;
  background: none;
  border: none;
  color: var(--rb-muted);
  font-size: 14px;
  cursor: pointer;
  padding: 0;
}
#renubu-booking .rb-back:hover { color: var(--rb-ink); }
#renubu-booking .rb-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--rb-ink);
}
#renubu-booking .rb-input {
  font: inherit;
  font-weight: 400;
  color: var(--rb-ink);
  background: #faf9ff;
  border: 1px solid var(--rb-line);
  border-radius: 10px;
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.15s;
}
#renubu-booking .rb-input:focus { border-color: var(--rb-brand); }
#renubu-booking .rb-textarea { resize: none; }

/* ── buttons / states ── */
#renubu-booking .rb-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--rb-brand);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 12px 22px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s, opacity 0.15s;
  text-decoration: none;
}
#renubu-booking .rb-btn-primary:hover { filter: brightness(1.05); }
#renubu-booking .rb-btn-primary:disabled { opacity: 0.7; cursor: not-allowed; }
#renubu-booking .rb-btn-secondary {
  background: var(--rb-brand-weak);
  color: var(--rb-brand);
  border: none;
  border-radius: 999px;
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
#renubu-booking .rb-link {
  background: none;
  border: none;
  color: var(--rb-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-size: 14px;
  cursor: pointer;
}
#renubu-booking .rb-link:hover { color: var(--rb-ink); }

#renubu-booking .rb-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 40px 0;
  text-align: center;
}
#renubu-booking .rb-muted { color: var(--rb-muted); font-size: 14px; font-weight: 400; }
#renubu-booking .rb-error { color: #c0392b; font-size: 14px; }

#renubu-booking .rb-booked .rb-check {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--rb-brand-weak);
  color: var(--rb-brand);
  font-size: 28px;
  font-weight: 700;
}
#renubu-booking .rb-booked-when { font-weight: 700; color: var(--rb-ink); margin: 0; }

/* ── spinner ── */
#renubu-booking .rb-spinner {
  width: 26px;
  height: 26px;
  border: 3px solid var(--rb-brand-weak);
  border-top-color: var(--rb-brand);
  border-radius: 50%;
  animation: rb-spin 0.8s linear infinite;
  display: inline-block;
}
#renubu-booking .rb-spinner-sm { width: 16px; height: 16px; border-width: 2px; }
@keyframes rb-spin { to { transform: rotate(360deg); } }

/* ── narrow widget: stack calendar above times (container-based, so it also
      triggers when the widget sits in a narrow column, not just small screens) ── */
@container (max-width: 480px) {
  #renubu-booking .rb-picker { flex-direction: column; gap: 18px; }
  #renubu-booking .rb-cal, #renubu-booking .rb-times { flex: 1 1 auto; width: 100%; }
  #renubu-booking .rb-cal-day { font-size: 14px; }
  #renubu-booking .rb-times-list { max-height: 220px; }
}
/* Fallback for engines without container queries: stack on small viewports. */
@supports not (container-type: inline-size) {
  @media (max-width: 540px) {
    #renubu-booking .rb-picker { flex-direction: column; gap: 18px; }
    #renubu-booking .rb-cal, #renubu-booking .rb-times { flex: 1 1 auto; width: 100%; }
  }
}
