/* --- Optimized Popup Message Style --- */
.booking-message {
  z-index: 1;
  position: relative;
  max-width: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  color: #18181b;
  border-radius: 16px;
  padding: 20px 24px;
  font-family: 'Segoe UI', 'Roboto', Arial, sans-serif;
  font-size: 1.1em;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  border: 1px solid #e0e7ff;
  transition: opacity 0.3s ease;
  overflow-wrap: break-word;
  word-break: break-word;
  margin-top: 20px;
  text-align: center;
}

.booking-message.success {
  background: linear-gradient(120deg, #f0fdfa 0%, #dcfce7 100%);
  color: #065f46;
  border-color: #34d399;
}

.booking-message.error {
  background: linear-gradient(120deg, #fef2f2 0%, #ffebeb 100%);
  color: #991b1b;
  border-color: #f87171;
}

.booking-message i {
  font-size: 1.5em;
  flex-shrink: 0;
  margin-right: 6px;
}
.booking-message.success i { color: #10b981; }
.booking-message.error i { color: #ef4444; }
/* Make the message text flex and wrap nicely */
.booking-message > div {
  flex: 1 1 0;
  min-width: 0;
  word-break: break-word;
  overflow-wrap: break-word;
}


/* booking-calendar.css: High-end, animated calendar styles */
.booking-container {
  max-width: 900px;
  margin: 48px auto;
  background: #fff;
  border-radius: 28px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.16);
  padding: 40px 32px 32px 32px;
  font-family: 'Segoe UI', 'Roboto', Arial, sans-serif;
  position: relative;
}
/* Ensure readable text inside the light booking form, even when site is in dark theme */
.booking-container form { color: #0f172a; }
.booking-container form label span { color: #0f172a; }
/* Ensure booking content clears the fixed site header */
.site-header + .booking-container { margin-top: 120px; }
@media (max-width: 1024px) {
  .site-header + .booking-container { margin-top: 88px; }
}
@media (max-width: 768px) {
  .site-header + .booking-container { margin-top: 96px; }
}
@media (max-width: 480px) {
  .site-header + .booking-container { margin-top: 104px; }
}
/* --- New Two-Column Layout --- */
.booking-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: flex-start;
}

.selection-column {
  display: flex;
  flex-direction: column;
}

.confirmation-column {
  position: sticky;
  top: 20px;
}

#confirmation-summary {
  background: #f8fafc;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  border: 1px solid #e0e7ff;
  min-height: 100px;
  margin-bottom: 24px;
}

.summary-placeholder {
  color: #64748b;
  font-style: italic;
  text-align: center;
  padding-top: 20px;
}

.confirmation-summary {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  min-height: 90px;
}
.summary-panel { display: flex; flex-direction: column; gap: 12px; }
.message-container { margin-top: 10px; }
.sr-only { position:absolute !important; width:1px !important; height:1px !important; padding:0 !important; margin:-1px !important; overflow:hidden !important; clip:rect(0,0,0,0) !important; white-space:nowrap !important; border:0 !important; }
/* ===== Mobile & Tablet Layout Refinements ===== */
@media (max-width: 1024px) {
  .booking-container {
    max-width: 100vw;
    margin: 24px auto;
    padding: 24px 16px 16px 16px;
    border-radius: 20px;
  }
  .booking-wrapper {
    grid-template-columns: 1fr; /* collapse to single column */
    gap: 20px;
  }
  .confirmation-column {
    position: static; /* disable sticky to avoid overlap */
    top: auto;
    margin-top: 8px;
  }
  #calendar-root { margin-bottom: 16px; }
  .booking-container h1 { font-size: clamp(1.5rem, 6vw, 2rem); margin-bottom: 16px; }
  .calendar-header { font-size: 1.2em; margin-bottom: 12px; }
  .calendar-month-label { font-size: clamp(1rem, 4.5vw, 1.2rem); }
  .calendar-nav { font-size: clamp(1.4rem, 8vw, 1.8rem); padding: 0 8px; }
  .calendar { gap: 6px; padding: 12px; }
  .calendar-weekdays { font-size: 0.9em; margin-bottom: 6px; }
  .calendar-day { font-size: clamp(0.9rem, 3.6vw, 1.05rem); }
  .time-slots { gap: 12px; margin: 18px 0 12px 0; }
  .slot-period-header { font-size: 1em; margin: 6px 0; }
  .time-slot { padding: 10px 14px; font-size: 1rem; }
}

@media (max-width: 600px) {
  .booking-container {
    max-width: 100vw;
    padding: 18px 12px 18px 12px;
    border-radius: 16px;
  }
  .calendar { gap: 5px; padding: 10px; }
  .calendar-weekdays { font-size: 0.85em; }
  .calendar-day { font-size: clamp(0.85rem, 4vw, 0.98rem); }
  .time-slots { gap: 10px; }
  .time-slot { padding: 10px 12px; font-size: 0.98rem; }
  /* Center month header and compact nav arrows on narrow screens */
  .calendar-header { justify-content: center; gap: 8px; }
  .calendar-header .calendar-nav { padding: 0 6px; }
  /* Reduce motion on touch devices to avoid jank */
  .calendar-day:hover { transform: none; }
}
.booking-container h1 {
  color: #18181b;
  font-size: 2.4em;
  font-weight: 700;
  text-align: left;
  margin-bottom: 24px;
}
.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  color: #18181b;
  font-size: 1.5em;
  font-weight: 700;
  padding: 0 8px;
}
.calendar-month-label {
  color: #18181b;
  font-size: 1.3em;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.calendar-nav {
  background: none;
  border: none;
  color: #18181b;
  font-size: 2.2em;
  font-weight: 900;
  cursor: pointer;
  padding: 0 12px;
  transition: color 0.2s, transform 0.2s;
  line-height: 1;
}
.calendar-nav:hover {
  color: #6366f1;
  transform: scale(1.2);
}
#calendar-root {
  margin-bottom: 32px;
  animation: fadeInBg 2s cubic-bezier(.4,0,.2,1);
  position: relative;
}
.calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  background: linear-gradient(120deg, #e0e7ff 0%, #f0fdfa 100%);
  border-radius: 16px;
  padding: 16px;
  animation: fadeIn 0.7s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 8px 32px rgba(99,102,241,0.08);
  overflow: hidden;
}
.calendar:before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0; bottom: 0;
  background: radial-gradient(circle at 80% 20%, #6366f1 0%, transparent 60%),
              radial-gradient(circle at 20% 80%, #06b6d4 0%, transparent 60%);
  opacity: 0.08;
  pointer-events: none;
  z-index: 0;
  animation: bgPulse 6s infinite alternate;
}
.calendar-day {
  aspect-ratio: 1/1;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1.18em;
  cursor: pointer;
  transition: background 0.25s, color 0.25s, box-shadow 0.25s, transform 0.18s;
  background: #fff !important;
  color: #18181b !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  position: relative;
  z-index: 1;
  will-change: transform;
}
.calendar-day:hover {
  background: linear-gradient(120deg, #e0e7ff 0%, #f0fdfa 100%) !important;
  color: #6366f1 !important;
  box-shadow: 0 4px 16px rgba(99,102,241,0.18);
  transform: scale(1.04); /* slightly less aggressive to reduce layout jank on mobile */
}
.calendar-day:active {
  background: linear-gradient(120deg, #06b6d4 0%, #6366f1 100%) !important;
  color: #fff !important;
  box-shadow: 0 8px 32px rgba(99,102,241,0.22);
  transform: scale(1.12) rotate(-2deg);
}
.calendar-day.available {
  background: linear-gradient(120deg, #e0ffe0 0%, #fffbe6 100%) !important;
  color: #14532d !important;
  border: 2px solid #22c55e;
  box-shadow: 0 2px 8px rgba(34,197,94,0.10);
  animation: slotPop 0.7s cubic-bezier(.4,0,.2,1);
  text-shadow: 0 1px 2px #fff, 0 0px 1px #fff;
}
.calendar-day.unavailable {
  background: #f3f4f6 !important;
  color: #9ca3af !important;
  text-decoration: line-through;
  cursor: not-allowed;
  border: 2px solid #e5e7eb;
  overflow: hidden;
}
.calendar-day.unavailable:after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0; bottom: 0;
  background: repeating-linear-gradient(135deg, #e5e7eb 0 6px, #fff 6px 12px);
  opacity: 0.5;
  pointer-events: none;
  z-index: 2;
  animation: busyStripe 2s linear infinite;
}
.calendar-day.selected {
  background: linear-gradient(120deg, #6366f1 0%, #06b6d4 100%) !important;
  color: #fff !important;
  text-shadow: 0 2px 8px #222b, 0 0px 2px #222b, 0 0 0 #000;
  border: 2px solid #6366f1;
  box-shadow: 0 8px 32px rgba(99,102,241,0.22);
  transform: scale(1.14) rotate(-2deg);
  animation: slotPop 0.7s cubic-bezier(.4,0,.2,1);
}
.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: 10px;
  font-size: 1.1em;
  color: #374151;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.5px;
}
.time-slots {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin: 28px 0 18px 0;
  justify-content: flex-start;
  animation: fadeIn 0.7s cubic-bezier(.4,0,.2,1);
}
.slot-period-header {
  font-size: 1.08em;
  font-weight: 700;
  color: #6366f1;
  margin-bottom: 6px;
  margin-top: 8px;
  letter-spacing: 0.5px;
  text-align: left;
  padding-left: 4px;
  position: sticky;
  top: 0;
  background: #ffffffcc;
  backdrop-filter: blur(2px);
  z-index: 2;
}

.time-slot {
  padding: 12px 26px;
  border-radius: 10px;
  background: #f1f5f9;
  color: #18181b;
  font-weight: 600;
  font-size: 1.12em;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background 0.22s, color 0.22s, border 0.22s, transform 0.18s, box-shadow 0.22s;
  will-change: transform;
  box-shadow: 0 2px 8px rgba(52,211,153,0.08);
}
.time-slot:focus-visible,
.calendar-day:focus-visible {
  outline: 3px solid #22c55e;
  outline-offset: 2px;
}
.time-slot.available {
  background: linear-gradient(90deg, #fef9c3 0%, #a7f3d0 100%);
  color: #14532d;
  border: 2px solid #34d399;
  animation: slotPop 0.7s cubic-bezier(.4,0,.2,1);
}
.time-slot:hover {
  background: linear-gradient(90deg, #e0e7ff 0%, #f0fdfa 100%);
  color: #6366f1;
  border: 2px solid #6366f1;
  box-shadow: 0 8px 32px rgba(99,102,241,0.18);
  transform: scale(1.08);
}
.time-slot:active {
  background: linear-gradient(90deg, #06b6d4 0%, #6366f1 100%);
  color: #fff;
  border: 2px solid #6366f1;
  box-shadow: 0 8px 32px rgba(99,102,241,0.22);
  transform: scale(1.12) rotate(1deg);
}
.time-slot.selected {
  background: linear-gradient(90deg, #6366f1 0%, #06b6d4 100%);
  color: #fff;
  text-shadow: 0 2px 8px #222b, 0 0px 2px #222b, 0 0 0 #000;
  border: 2px solid #6366f1;
  box-shadow: 0 8px 32px rgba(99,102,241,0.22);
  transform: scale(1.14) rotate(1deg);
  animation: slotPop 0.7s cubic-bezier(.4,0,.2,1);
}
@keyframes fadeInBg {
  from { background: #fff; }
  to { background: linear-gradient(120deg, #e0e7ff 0%, #f0fdfa 100%); }
}
@keyframes slotPop {
  0% { transform: scale(0.7); opacity: 0; }
  80% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes busyStripe {
  0% { background-position: 0 0; }
  100% { background-position: 40px 40px; }
}
@keyframes bgPulse {
  0% { opacity: 0.08; }
  100% { opacity: 0.18; }
}
#booking-form-root {
  margin-top: 0;
}
#booking-success, #booking-error {
  margin-top: 24px;
  padding: 16px;
  border-radius: 8px;
  font-weight: 600;
  text-align: center;
  display: none;
}
#booking-success {
  background: #d1fae5;
  color: #065f46;
  border: 2px solid #34d399;
  display: none;
}
#booking-error {
  background: #fee2e2;
  color: #991b1b;
  border: 2px solid #f87171;
  display: none;
}
.hidden { display: none !important; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
/* Senior Rate community banner */
.community-banner {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #065f46;
  border-radius: 9999px;
  padding: 10px 14px;
  margin: 8px 0 16px 0;
  box-shadow: 0 2px 8px rgba(34,197,94,0.08);
  font-weight: 600;
}
.community-banner i { color: #10b981; }
.community-banner.compact { cursor: pointer; border-radius: 9999px; }
.community-banner .compact-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 58vw; }
.community-banner .compact-cta { color: #047857; font-weight: 600; font-size: 0.92em; }
.community-banner i { color: #10b981; }
.community-banner .banner-link { color: #059669; text-decoration: underline; }
.community-banner a {
  color: #1e40af; /* dark blue for better contrast */
  text-decoration: underline;
  font-weight: bold;
  font-size: 1.08em;
}
.community-banner a:hover {
  color: #1e3a8a;
}
@media (max-width: 600px) {
  .community-banner { font-size: 0.95rem; gap: 8px; }
  .community-banner .compact-label { max-width: 62vw; }
}
@media (max-width: 480px) {
  .community-banner { display: flex; flex-direction: row; align-items: center; }
}

/* Community Modal */
/* Inline Accordion Styles */
.community-accordion { position: relative; background: #ffffff; color: #0f172a; border: 1px solid #e5e7eb; border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,0.08); padding: 14px 14px 14px 14px; margin: 8px 0 16px 0; animation: fadeIn 0.2s ease-out; }
.community-accordion.open { animation: fadeIn 0.2s ease-out; }
.community-accordion h2 { font-size: 1.1rem; margin: 0 0 6px 0; color: #0f172a; }
.community-accordion-body p { margin: 8px 0 10px 0; }
.community-accordion-body a {
  color: #1e40af; /* dark blue for better contrast */
  text-decoration: underline;
  font-weight: bold;
  font-size: 1.08em;
}
.community-accordion-body a:hover {
  color: #1e3a8a;
}
.community-accordion-body ul { margin: 6px 0 0 18px; padding: 0; }
.community-accordion-body li { margin: 6px 0; }
.community-accordion-close { position: absolute; right: 8px; top: 8px; background: transparent; border: none; cursor: pointer; font-size: 1.1rem; color: #334155; width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.community-accordion-close:hover { background: #f1f5f9; }
@media (max-width: 820px) {
  .summary-panel { order: 3; }
}
