body {
  font-family: 'Inter', sans-serif;
  background: #f5f7fb;
  margin: 0;
  padding: 0;
}

#calendar {
  margin-top: 20px;
  padding: 20px;
  background: #ffffff;
  max-width: 100%;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  border-radius: 10px;
}

.fc-toolbar-title {
  font-size: 1.4rem;
  color: #2c3e50;
  font-weight: 600;
}

/* Event appearance */
.fc-resource-timeline .fc-event {
  border-radius: 0 !important;
  padding: 0 4px !important;
  font-size: 12px !important;
  line-height: 24px !important;
  height: 100% !important;
  display: flex !important;
  align-items: center !important;
}

/* Fix toolbar layout */
.calendar-page .fc-toolbar-chunk {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Buttons */
.calendar-page .fc .fc-button,
.calendar-page .fc-toolbar button,
.calendar-page #refreshButton {
  width: auto;
  padding: 6px 12px;
  font-size: 14px;
  border-radius: 4px;
  cursor: pointer;
  background-color: #401558;
  color: white;
  border: none;
}
.calendar-page #refreshButton:hover {
  background-color: #2c3e50;
}

/* Modal styles (shared) */
#bookingModal,
#manualBookingModal,
#bulkSlotModal {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
  z-index: 9999;
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  color: #2c3e50;
}
#bookingModal {
  padding: 24px 28px;
  width: 360px;
}
#manualBookingModal,
#bulkSlotModal {
  padding: 32px 36px;
  width: 100%;
  max-width: 780px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 12px;
}

/* Modal headers */
#bookingModal h3,
#manualBookingModal h3,
#bulkSlotModal h3 {
  margin-bottom: 20px;
  font-size: 20px;
  font-weight: 600;
  color: #1f2d3d;
  text-align: center;
}

/* Modal form elements */
#bookingModal label,
#manualBookingModal label,
#bulkSlotModal label {
  display: block;
  font-weight: 500;
  margin: 12px 0 6px;
}
#bookingModal input,
#manualBookingModal input,
#manualBookingModal select,
#bulkSlotModal input,
#bulkSlotModal select {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #f9f9f9;
  box-sizing: border-box;
  margin-bottom: 12px;
}

/* Button groups in modals */
#bookingModal .btn-group,
#manualBookingModal .btn-group,
#bulkSlotModal .btn-group {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}
#bookingModal .btn,
#manualBookingModal button,
#bulkSlotModal button {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s ease;
}

/* Buttons colors */
.btn-success {
  background-color: #28a745;
  color: white;
}
.btn-success:hover {
  background-color: #218838;
}
.btn-default {
  background-color: #e0e0e0;
  color: #333;
}
.btn-default:hover {
  background-color: #d5d5d5;
}
.btn-danger {
  background-color: #dc3545;
  color: white;
}
.btn-danger:hover {
  background-color: #c82333;
}
.btn-warning {
  background-color: #f0ad4e;
  color: white;
}
.btn-warning:hover {
  background-color: #ec971f;
}

/* Modal close buttons */
#bookingModal .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
#bookingModal .close-btn,
#manualBookingModal .close-btn,
#bulkSlotModal .close-btn {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: #555;
  float: right;
}

/* Bulk checkbox layout */
#bulkSlotModal .bulk-checkbox-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}
#bulkSlotModal #bulkBookingName {
  margin-bottom: 20px;
}

/* Event status visuals */
.fc-event.maintenance {
  background-color: #b58900 !important;
  color: white !important;
  font-weight: 600;
}
.fc-event.checked-in {
  background-color: grey !important;
  color: white !important;
}
.fc-event.noshow {
  background-color: black !important;
  color: white !important;
}

/* Row height fix — ensure perfect alignment */
.fc-datagrid-cell-frame,
.fc-timeline-lane-frame,
.fc-timeline-slot-frame,
.fc-timeline-events.fc-scrollgrid-sync-inner {
  height: 36px !important;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  padding: 0 !important;
  line-height: 1;
}

/* Horizontal grid lines */
.fc-timeline-lane-frame {
  border-bottom: 1px solid #ccc !important;
  background: none !important;
  z-index: 2;
}

/* Overlay and visual stacking fix */
.fc-timeline-bg {
  z-index: 1 !important;
  pointer-events: none;
}
.fc-timeline-events.fc-scrollgrid-sync-inner {
  z-index: 3;
}

/* Extra fix to eliminate injected ghost row */
.fc-scrollgrid-section tbody tr:has(td:empty) {
  display: none;
}

/* Left-side lane name spacing */
.fc-datagrid-cell-cushion {
  padding-left: 10px !important;
  padding-right: 10px !important;
  overflow: visible !important;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.fc-col-header-cell-cushion,
.fc-datagrid-cell-main {
  overflow: visible !important;
}

/* Resource column width */
.fc .fc-resource-area {
  min-width: 140px !important;
}

.datepicker-dropdown {
  background-color: #fff !important;
  border: 1px solid #ccc !important;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15) !important;
  padding: 8px;
  border-radius: 4px;
  z-index: 9999 !important;
}

.fc-event.pending-event {
  background-color: #ccc !important;
  border-color: #aaa !important;
  color: #000 !important;
  cursor: default !important;
  pointer-events: none !important;
  opacity: 0.9;
}

.fade-in {
  animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ========================== */
/* Mobile Responsive Calendar */
/* ========================== */

@media (max-width: 1024px) {
  #calendar {
    padding: 15px;
    margin-top: 10px;
  }

  .fc-toolbar-title {
    font-size: 1.2rem;
  }

  .fc .fc-button {
    padding: 5px 10px;
    font-size: 13px;
  }
}

@media (max-width: 768px) {
  #calendar-wrapper {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  #calendar {
    width: 100% !important;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
  }

  /* Toolbar layout */
  .calendar-page .fc-toolbar {
    flex-direction: column;
    align-items: center;
    gap: 6px;
  }

  .calendar-page .fc-toolbar-chunk {
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
  }

  .fc-toolbar-title {
    font-size: 1.1rem;
    text-align: center;
    width: 100%;
  }

  /* Hide resource area on mobile */
  .fc .fc-resource-area {
    display: none !important;
  }

  /* Events shrink */
  .fc-event {
    font-size: 11px !important;
    line-height: 16px !important;
    padding: 2px !important;
  }

  /* Modals scale to viewport */
  #manualBookingModal,
  #bulkSlotModal {
    width: 95%;
    max-width: 95%;
    padding: 20px;
  }

  #bookingModal {
    width: 90%;
    padding: 20px;
  }

  #bookingModal h3,
  #manualBookingModal h3,
  #bulkSlotModal h3 {
    font-size: 18px;
  }
}


@media (max-width: 480px) {
  /* Buttons and titles */
  .fc .fc-button {
    padding: 5px 8px;
    font-size: 12px;
  }

  .fc-toolbar-title {
    font-size: 1rem;
  }

  /* Modals */
  #bookingModal,
  #manualBookingModal,
  #bulkSlotModal {
    padding: 15px;
    border-radius: 8px;
  }

  #bookingModal h3,
  #manualBookingModal h3,
  #bulkSlotModal h3 {
    font-size: 16px;
  }

  /* Modal form inputs */
  #bookingModal input,
  #manualBookingModal input,
  #manualBookingModal select,
  #bulkSlotModal input,
  #bulkSlotModal select {
    font-size: 13px;
    padding: 8px 10px;
  }
}


