/* ============================
   Calendar (FullCalendar)
============================ */

/* Calendar container sizing */
#leefhub-calendar {
  max-width: 1100px;   /* cap the width for readability */
  min-width: 320px;    /* don’t collapse too small */
  width: 90%;          /* use most of the available space */
  margin: 2rem auto;   /* center it nicely */
}

/* Events use global calendar vars */
.fc-event {
  display: block;
  background: var(--leefhub-calendar-event-bg, #0073aa);
  color: var(--leefhub-calendar-event-text, #ffffff);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 0.85rem;
  line-height: 1.4;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
  white-space: normal;      /* wrap long titles */
  word-break: break-word;   /* break long words/urls */
  overflow: hidden;
  text-overflow: ellipsis;
  box-sizing: border-box;
  width: 100%;
  margin: 0 0 4px 0;        /* vertical space between stacked events */
}

.fc-event:hover {
  background: var(--leefhub-calendar-event-hover, #005f8d);
  transform: translateY(-2px);
}

/* Event title & time for clarity */
.fc-event .event-title {
  font-weight: 600;
  font-size: 0.85rem;
  margin: 0 0 2px;
}
.fc-event .event-time {
  font-size: 0.75rem;
  opacity: 0.9;
  margin: 0;
}

/* Responsive tweaks */
@media (max-width: 768px) {
  #leefhub-calendar {
    width: 95%;
    max-width: 100%; /* allow more fluid layout on tablets */
  }
  .fc-event {
    font-size: 0.8rem;
    padding: 4px 6px;
    line-height: 1.3;
  }
  .fc-event .event-title {
    font-size: 0.8rem;
  }
  .fc-event .event-time {
    font-size: 0.7rem;
  }
}

@media (max-width: 480px) {
  #leefhub-calendar {
    width: 100%;
    margin: 1rem auto;
  }
  .fc-event {
    font-size: 0.75rem;
    padding: 3px 5px;
  }
}

/* ============================
   FullCalendar Toolbar Buttons
============================ */

/* Base buttons */
.fc .fc-button {
  background: var(--leefhub-calendar-event-bg, #0073aa) !important;
  color: var(--leefhub-calendar-event-text, #ffffff) !important;
  border: none !important;
  border-radius: 6px !important;
  padding: 6px 12px !important;
  font-size: 0.9rem !important;
  font-weight: 500 !important;
  text-transform: capitalize;
  transition: background 0.2s ease, transform 0.15s ease;
  box-shadow: none !important;
  margin: 0 2px !important;  
}

/* Hover + active states */
.fc .fc-button:hover,
.fc .fc-button.fc-button-active {
  background: var(--leefhub-calendar-event-hover, #005f8d) !important;
  color: var(--leefhub-calendar-event-text, #ffffff) !important;
  transform: translateY(-1px);
}

/* Disabled state */
.fc .fc-button:disabled {
  background: #ccc !important;
  color: #666 !important;
  cursor: not-allowed;
  transform: none;
}

/* Optional: adjust entire toolbar alignment & spacing */
.fc .fc-toolbar-chunk {
  display: flex;
  align-items: center;
  gap: 6px;           /* ✅ adds consistent spacing between groups */
}
.fc .fc-toolbar {
  margin-bottom: 20px !important;
  padding: 6px 2px;
}

/* ============================
   Event Cards (List/Grid view)
============================ */

.leefhub-events-grid {
  display: block;
  margin: 2rem 0;
}

.leefhub-card.leef-event {
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  margin-bottom: 20px;
}
.leefhub-card.leef-event:last-child {
  margin-bottom: 0;
}

.leefhub-card-body {
  padding: 16px;
}
.leefhub-card-title {
  margin: 0 0 8px;
  font-size: 1.1rem;
}
.leefhub-card-time {
  color: #666;
  margin: 0;
}
.leefhub-card-footer {
  border-top: 1px solid #eee;
  padding: 12px 16px;
  text-align: right;
}

/* ============================
   Call-to-action buttons
============================ */

.leefhub-card-button,
.leefhub-book-btn {
  background: var(--leefhub-shortcode-btn-bg, #0073aa);
  color: var(--leefhub-shortcode-btn-text, #fff);
  border: none;
  border-radius: 6px;
  padding: 10px 16px;
  font-size: 1rem;
  font-weight: 600;
  display: inline-block;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
  text-decoration: none;      /* removes underline */
}

.leefhub-card-button:hover,
.leefhub-book-btn:hover {
  background: var(--leefhub-shortcode-btn-hover, #005f8d);
  text-decoration: none;      /* prevent underline on hover */
}

/* ============================
   Booking Form
============================ */

.leefhub-booking-form {
  max-width: 700px;
  margin: 60px auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  padding: 40px;
  font-size: 17px;
  line-height: 1.6;
  color: #333;
}

.leefhub-booking-title {
  font-size: 26px;
  font-weight: 600;
  margin-bottom: 10px;
}

.leefhub-booking-time {
  font-size: 18px;
  margin-bottom: 20px;
  color: #666;
}

.leefhub-booking-user {
  background: #f8f8f8;
  border-radius: 6px;
  padding: 12px 15px;
  margin-bottom: 25px;
  font-size: 16px;
}

.leefhub-form-row {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 30px;
}

.leefhub-form-row label {
  font-weight: 600;
  font-size: 18px;
}

.leefhub-form-row input {
  width: 90px;
  font-size: 18px;
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
}

.leefhub-btn {
  background: var(--leefhub-accent, var(--leefhub-shortcode-btn-bg, #0073aa));
  color: var(--leefhub-shortcode-btn-text, #ffffff);
  border: none;
  border-radius: 8px;
  padding: 14px 28px;
  font-size: 18px;
  cursor: pointer;
  transition: all .2s;
}

.leefhub-btn:hover {
  background: var(--leefhub-accent-hover, var(--leefhub-shortcode-btn-hover, #005f8d));
}

/* ============================
   My Bookings List
============================ */

.leefhub-bookings-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.leefhub-booking-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #eee;
}
.leefhub-booking-item:last-child {
  border-bottom: none;
}
.leefhub-booking-details {
  display: flex;
  flex-direction: column;
}
.leefhub-booking-title {
  font-weight: 600;
  margin-bottom: 4px;
}
.leefhub-booking-time,
.leefhub-booking-seats {
  font-size: 0.9rem;
  color: #666;
}

/* ============================
   Status Badges
============================ */

.leefhub-badge {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
  min-width: 80px;
  text-align: center;
}

.leefhub-status-confirmed { background: #2e8540; }
.leefhub-status-pending   { background: #e0a800; }
.leefhub-status-cancelled { background: #dc3545; }

/* ============================
   Button Row
============================ */

.leefhub-button-row {
  display: flex;
  gap: 12px;            /* space between buttons */
  flex-wrap: wrap;      /* allows stacking on small screens */
}

.leefhub-button-row .leefhub-form {
  flex: 1;
  margin: 0;
}

.leefhub-button-row .leefhub-book-btn {
  width: 100%;
}

/* ============================
   Loader Overlay (Calendar)
============================ */
#leefhub-calendar-loader {
  position: fixed;
  inset: 0; /* shorthand for top:0; right:0; bottom:0; left:0; */
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(var(--leefhub-surface-rgb, 255, 255, 255), 0.88);
  z-index: 9999;
  backdrop-filter: blur(3px); /* subtle blur for depth */
}

/* Spinner centered and theme-aware */
#leefhub-calendar-loader .spinner {
  --spinner-size: 56px;
  border: 5px solid var(--leefhub-border, #e0e0e0);
  border-top: 5px solid var(--leefhub-accent, #fc36e7);
  border-radius: 50%;
  width: var(--spinner-size);
  height: var(--spinner-size);
  animation: leefhub-spin 0.9s linear infinite;
  box-shadow: 0 0 10px rgba(var(--leefhub-accent-rgb, 252, 54, 231), 0.3);;
}

/* Smooth spin animation */
@keyframes leefhub-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
