/* ===== Premium Meeting Room Booking — Design System v7 ===== */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400&display=swap');

/* ===== CSS Variables ===== */
:root {
  --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --blue:    #0ea5e9;
  --indigo:  #2563eb;
  --navy:    #0f172a;
  --slate:   #1e293b;

  --bg:      #f0f4ff;
  --bg-card: #ffffff;
  --border:  #e2e8f0;
  --border-input: #cbd5e1;

  --text-1:  #0f172a;
  --text-2:  #475569;
  --text-3:  #94a3b8;

  --grad-primary: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%);
  --grad-primary-hover: linear-gradient(135deg, #0284c7 0%, #1d4ed8 100%);
  --grad-header: linear-gradient(135deg, #0f172a 0%, #1a2744 100%);

  --green:        #10b981;
  --green-light:  #d1fae5;
  --green-border: #6ee7b7;
  --green-text:   #065f46;

  --red:        #f43f5e;
  --red-light:  #fff1f2;
  --red-border: #fda4af;
  --red-text:   #9f1239;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;

  --shadow-sm:  0 1px 4px rgba(15,23,42,.06);
  --shadow-md:  0 4px 16px -2px rgba(15,23,42,.10);
  --shadow-lg:  0 12px 40px -6px rgba(15,23,42,.14);
  --shadow-blue: 0 8px 28px rgba(14,165,233,.30);
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

/* ===== Body — animated mesh background ===== */
body {
  font-family: var(--font);
  color: var(--text-1);
  min-height: 100vh;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;

  /* Animated gradient background */
  background-color: #e8eeff;
  background-image:
    radial-gradient(ellipse 80% 60% at 15% 10%, rgba(14,165,233,.18) 0%, transparent 55%),
    radial-gradient(ellipse 60% 50% at 85% 90%, rgba(37,99,235,.15) 0%, transparent 55%),
    radial-gradient(ellipse 50% 40% at 50% 50%, rgba(139,92,246,.08) 0%, transparent 60%);
  background-attachment: fixed;
  animation: bgShift 18s ease-in-out infinite alternate;
}

@keyframes bgShift {
  0%   { background-position: 0% 0%, 100% 100%, 50% 50%; }
  100% { background-position: 20% 30%, 80% 70%, 60% 40%; }
}

/* ===== Scroll margin ===== */
#bookingFormSection { scroll-margin-top: 90px; }

/* ===== Header ===== */
.brandbar {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border-bottom: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 4px 32px rgba(0,0,0,.25);
  padding: 0;
  animation: headerDrop 0.5s cubic-bezier(0.34,1.56,0.64,1) both;
}

@keyframes headerDrop {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

.brandwrap {
  max-width: 1060px;
  margin: 0 auto;
  padding: 8px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brandlogo {
  height: 30px;
  object-fit: contain;
  transition: transform 0.25s ease, filter 0.25s ease;
  filter: brightness(1.1);
}

.brandlogo:hover { transform: scale(1.05); filter: brightness(1.25); }

/* ===== Main container ===== */
.container {
  max-width: 1060px;
  margin: 36px auto 60px;
  padding: 0 20px;
}

/* ===== Main card ===== */
.card {
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.7);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255,255,255,.5) inset;
  padding: 32px 36px;
  animation: cardRise 0.55s cubic-bezier(0.34,1.2,0.64,1) both 0.1s;
}

@keyframes cardRise {
  from { opacity: 0; transform: translateY(22px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)   scale(1);    }
}

/* ===== Card header ===== */
.card-header { margin-bottom: 28px; }

h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-1);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 12px;
}

h1::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 28px;
  background: var(--grad-primary);
  border-radius: 6px;
  box-shadow: 0 0 12px rgba(14,165,233,.45);
}

.sub {
  color: var(--text-2);
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.5;
}

/* ===== Alerts (inline form messages) ===== */
.alert {
  padding: 13px 18px;
  border-radius: var(--r-md);
  margin-bottom: 18px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
  font-weight: 600;
  animation: alertPop 0.3s ease both;
}

@keyframes alertPop {
  from { opacity: 0; transform: scale(0.97); }
  to   { opacity: 1; transform: scale(1); }
}

.alert.bad {
  background: #fff1f2;
  border: 1px solid #fca5a5;
  color: #9f1239;
}

.alert.ok {
  background: #f0fdf4;
  border: 1px solid #86efac;
  color: #166534;
}

/* ===== Filter bar ===== */
.filter-bar {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 16px;
  align-items: flex-end;
  background: linear-gradient(135deg, #f8faff 0%, #f1f5ff 100%);
  padding: 20px 24px;
  border-radius: var(--r-lg);
  border: 1px solid rgba(37,99,235,.12);
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm), 0 0 0 1px rgba(14,165,233,.06) inset;
}

@media (max-width: 720px) {
  .filter-bar { grid-template-columns: 1fr; }
  .card { padding: 20px 18px; }
}

/* ===== Form elements ===== */
.form-group { display: flex; flex-direction: column; }

label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-2);
  margin-bottom: 7px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

select, input[type="text"], input[type="tel"], input[type="date"], input {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--border-input);
  background: #fff;
  color: var(--text-1);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

select:focus, input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(14,165,233,.18);
  background: #fafcff;
}

.select-wrapper { position: relative; }

.select-wrapper::after {
  content: '▾';
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
  font-size: 13px;
}

select { appearance: none; padding-right: 36px; cursor: pointer; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--r-md);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.22s cubic-bezier(0.34,1.56,0.64,1);
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background 0.2s;
  border-radius: inherit;
}

.btn:hover::after { background: rgba(255,255,255,.08); }

.btn-primary {
  background: var(--grad-primary);
  color: #fff;
  box-shadow: var(--shadow-blue);
}

.btn-primary:hover {
  background: var(--grad-primary-hover);
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 32px rgba(14,165,233,.40);
}

.btn-primary:active { transform: translateY(0) scale(0.99); }

.btn-secondary {
  background: #fff;
  color: var(--text-2);
  border: 1.5px solid var(--border-input);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: #f8fafc;
  color: var(--text-1);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-sm  { padding: 8px 14px; font-size: 13px; }
.btn-lg  { padding: 13px 28px; font-size: 15px; }

/* ===== Meta banner ===== */
.slots-meta-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 10px;
}

.meta-badges { display: flex; gap: 8px; flex-wrap: wrap; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
}

.badge-room {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.badge-date {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #e2e8f0;
}

/* ===== Slots grid ===== */
.slots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: 12px;
  margin-bottom: 30px;
}

/* Staggered entrance animation for slot cards */
.slot-card {
  border-radius: var(--r-md);
  padding: 15px 16px;
  min-height: 128px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.22s cubic-bezier(0.34,1.56,0.64,1),
              box-shadow 0.22s ease,
              border-color 0.22s ease;
  animation: slotFadeUp 0.4s ease both;
  position: relative;
  overflow: hidden;
}

/* Stagger via nth-child */
.slot-card:nth-child(1)  { animation-delay: .03s; }
.slot-card:nth-child(2)  { animation-delay: .05s; }
.slot-card:nth-child(3)  { animation-delay: .07s; }
.slot-card:nth-child(4)  { animation-delay: .09s; }
.slot-card:nth-child(5)  { animation-delay: .11s; }
.slot-card:nth-child(6)  { animation-delay: .13s; }
.slot-card:nth-child(7)  { animation-delay: .15s; }
.slot-card:nth-child(8)  { animation-delay: .17s; }
.slot-card:nth-child(9)  { animation-delay: .19s; }
.slot-card:nth-child(10) { animation-delay: .21s; }
.slot-card:nth-child(11) { animation-delay: .23s; }
.slot-card:nth-child(12) { animation-delay: .25s; }
.slot-card:nth-child(13) { animation-delay: .27s; }
.slot-card:nth-child(14) { animation-delay: .29s; }
.slot-card:nth-child(15) { animation-delay: .31s; }
.slot-card:nth-child(16) { animation-delay: .33s; }
.slot-card:nth-child(17) { animation-delay: .35s; }
.slot-card:nth-child(18) { animation-delay: .37s; }
.slot-card:nth-child(19) { animation-delay: .39s; }
.slot-card:nth-child(20) { animation-delay: .41s; }
.slot-card:nth-child(21) { animation-delay: .43s; }
.slot-card:nth-child(22) { animation-delay: .45s; }
.slot-card:nth-child(23) { animation-delay: .47s; }
.slot-card:nth-child(24) { animation-delay: .49s; }

@keyframes slotFadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.slot-time-header {
  font-size: 13.5px;
  font-weight: 800;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.slot-status-pill {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 6px;
  width: fit-content;
}

/* ===== Available slot ===== */
.slot-available {
  background: linear-gradient(160deg, #f0fdf8 0%, #ecfdf5 100%);
  border: 1.5px solid #6ee7b7;
  box-shadow: 0 2px 8px rgba(16,185,129,.08);
}

.slot-available .slot-time-header { color: #065f46; }

.slot-available .slot-status-pill {
  background: #d1fae5;
  color: #065f46;
}

/* Shimmer shine on hover */
.slot-available::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -60%;
  width: 50%;
  height: 200%;
  background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.55) 50%, transparent 70%);
  transform: skewX(-20deg);
  transition: left 0.6s ease;
  pointer-events: none;
}

.slot-available:hover::before { left: 130%; }

.slot-available:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 10px 28px rgba(16,185,129,.22);
  border-color: #34d399;
}

.slot-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

.slot-action-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  color: #059669;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px dashed rgba(16,185,129,.3);
}

/* ===== Booked slot ===== */
.slot-booked {
  background: linear-gradient(160deg, #fff1f2 0%, #ffe4e6 100%);
  border: 1.5px solid #fda4af;
  box-shadow: 0 2px 8px rgba(244,63,94,.08);
}

.slot-booked .slot-time-header { color: #9f1239; }

.slot-booked .slot-status-pill {
  background: #fecdd3;
  color: #9f1239;
}

/* Pulse indicator on booked slots */
.slot-booked::after {
  content: '';
  position: absolute;
  top: 12px;
  right: 14px;
  width: 8px;
  height: 8px;
  background: #f43f5e;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(244,63,94,.5);
  animation: pulseDot 2s ease infinite;
}

@keyframes pulseDot {
  0%   { box-shadow: 0 0 0 0   rgba(244,63,94,.5); }
  70%  { box-shadow: 0 0 0 7px rgba(244,63,94,.0); }
  100% { box-shadow: 0 0 0 0   rgba(244,63,94,.0); }
}

.booked-info-box {
  border-top: 1px dashed rgba(159,18,57,.22);
  padding-top: 7px;
  margin-top: auto;
  font-size: 12px;
  line-height: 1.4;
}

.booked-name {
  font-size: 13px;
  font-weight: 800;
  color: #9f1239;
}

.booked-entity-phone {
  font-size: 11.5px;
  color: #be123c;
  margin: 2px 0;
}

.booked-purpose {
  font-size: 11.5px;
  color: #e11d48;
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== Cancel button ===== */
.btn-cancel-slot {
  background: rgba(255,255,255,.75);
  color: #e11d48;
  border: 1px solid #fda4af;
  padding: 5px 10px;
  border-radius: var(--r-sm);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  margin-top: 6px;
  transition: all 0.2s cubic-bezier(0.34,1.56,0.64,1);
  box-shadow: 0 1px 4px rgba(244,63,94,.12);
  font-family: var(--font);
}

.btn-cancel-slot:hover {
  background: #f43f5e;
  color: #fff;
  border-color: #f43f5e;
  transform: scale(1.03);
  box-shadow: 0 4px 14px rgba(244,63,94,.35);
}

/* ===== Divider ===== */
.hr-divider {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  margin: 28px 0;
}

/* ===== Booking form card ===== */
.booking-section-card {
  background: linear-gradient(160deg, #f8faff 0%, #f3f7ff 100%);
  border: 1px solid rgba(37,99,235,.12);
  border-radius: var(--r-xl);
  padding: 26px 30px;
  margin-top: 8px;
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(37,99,235,.05) inset;
  scroll-margin-top: 90px;
  position: relative;
  overflow: hidden;
}

/* Decorative top-left glow */
.booking-section-card::before {
  content: '';
  position: absolute;
  top: -60px;
  left: -60px;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(14,165,233,.12) 0%, transparent 70%);
  pointer-events: none;
}

.booking-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}

.booking-section-header h2 {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-1);
  letter-spacing: -0.02em;
}

.custom-form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

@media (max-width: 720px) {
  .custom-form-grid { grid-template-columns: 1fr; }
}

.full-col { grid-column: 1 / -1; }

.form-actions-row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

/* ===== Footer ===== */
.app-footer {
  margin-top: 32px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
}

.app-footer code {
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 700;
  color: var(--text-2);
}

/* ===== Toast notifications ===== */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 420px;
  animation: toastIn 0.4s cubic-bezier(0.34,1.56,0.64,1) both;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(32px) scale(0.95); }
  to   { opacity: 1; transform: translateX(0)    scale(1);    }
}

.toast {
  padding: 14px 18px;
  border-radius: var(--r-lg);
  box-shadow: 0 12px 32px -4px rgba(0,0,0,.18), 0 4px 12px -2px rgba(0,0,0,.08);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
  font-weight: 600;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  line-height: 1.45;
}

.toast-success {
  background: rgba(236,253,245,.97);
  border: 1.5px solid #34d399;
  color: #065f46;
}

.toast-error {
  background: rgba(255,241,242,.97);
  border: 1.5px solid #f43f5e;
  color: #9f1239;
}

.toast-close {
  background: transparent;
  border: none;
  color: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  margin-left: auto;
  padding: 0 2px;
  opacity: 0.55;
  transition: opacity 0.2s;
  flex-shrink: 0;
}

.toast-close:hover { opacity: 1; }

/* ===== Passkey chip ===== */
#passkeyChip {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  background: rgba(15,23,42,.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: #fff;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 50px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 28px rgba(0,0,0,.3);
  animation: chipIn 0.4s cubic-bezier(0.34,1.56,0.64,1) both;
  font-size: 13px;
}

@keyframes chipIn {
  from { opacity: 0; transform: translateY(16px) scale(0.9); }
  to   { opacity: 1; transform: translateY(0)    scale(1);   }
}

#passkeyChip .chip-icon { font-size: 15px; }

#passkeyChip .chip-label {
  color: #94a3b8;
  font-weight: 500;
  white-space: nowrap;
  font-size: 12px;
}

#passkeyChip .chip-code {
  background: var(--grad-primary);
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 4px;
  padding: 3px 12px;
  border-radius: 20px;
  cursor: pointer;
  user-select: all;
  transition: opacity 0.2s, transform 0.15s;
  box-shadow: 0 0 14px rgba(14,165,233,.4);
}

#passkeyChip .chip-code:hover {
  opacity: 0.88;
  transform: scale(1.04);
}

#passkeyChip .chip-close {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.1);
  color: #64748b;
  font-size: 12px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  line-height: 1;
  transition: background 0.2s, color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font);
}

#passkeyChip .chip-close:hover {
  background: rgba(255,255,255,.18);
  color: #fff;
}

/* ===== Misc legacy class used in PHP ===== */
.device-passkey-tag {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 700;
}

/* ===== Responsive tweaks ===== */
@media (max-width: 500px) {
  .slots-grid { grid-template-columns: 1fr 1fr; }
  .toast-container { left: 12px; right: 12px; max-width: none; }
  #passkeyChip { left: 12px; right: 12px; border-radius: 14px; }
  .form-actions-row { flex-direction: column; }
  .form-actions-row .btn { width: 100%; }
}
