/* Main container */
.appointment-calendar-interface {
  max-width: 100%;
  margin: 20px auto 0px auto;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  transition: all 0.4s ease;
  gap: 40px;
  flex-wrap: nowrap;
  clear: both;
}

/* When no timeslots are shown, center the calendar */
.appointment-calendar-interface:not(.has-selection) {
  justify-content: center;
}

.appointment-calendar-interface:not(.has-selection) .calendar-wrapper {
  margin: 0 auto;
}

/* When timeslots are shown, slide calendar to left */
.appointment-calendar-interface.has-selection {
  justify-content: center;
  max-width: 900px;
  margin: 20px auto 0px auto;
}

.appointment-calendar-interface.has-selection .calendar-wrapper {
  transform: translateX(0);
}

/* Calendar wrapper */
.calendar-wrapper {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  padding-bottom: 0px;
  flex-shrink: 0;
  width: 396px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Navigation */
.calendar-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding: 0 10px;
}

.calendar-nav-btn {
  background: #fff;
  border: 2px solid #e0e0e0;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  cursor: pointer;
  font-size: 20px;
  font-weight: bold;
  color: #263238;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.calendar-nav-btn.next-month::after {
  content: "";
  border-right: 1px solid;
  border-bottom: 1px solid;
  width: 10px;
  height: 10px;
  color: #212529;
  display: inline-block;
  transform: rotate(-45deg);
  margin-right: 5px;
}

.calendar-nav-btn.prev-month::after {
  content: "";
  border-right: 1px solid;
  border-bottom: 1px solid;
  width: 10px;
  height: 10px;
  color: #212529;
  display: inline-block;
  transform: rotate(135deg);
  margin-left: 3px;
}

.calendar-nav-btn:hover {
  border-color: #212529;
}

.current-month-year {
  font-size: 20px;
  font-weight: 500;
  color: #263238;
}

/* Calendar grid */
.calendar-grid {
  width: 100%;
  max-width: 356px;
}

.calendar-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.calendar-day-name {
  text-align: center;
  font-weight: 400;
  color: #3C413F;
  padding: 8px 0;
  font-size: 13.71px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 12px;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #fff;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 17.4px;
  font-weight: 400;
  background: #F7F9FB;
  color: #263238;
  position: relative;
}

.calendar-day:not(.past):not(.empty):hover {
  background: #F7F9FB;
  border-color: #212529;
}

.calendar-day.empty {
  border: none;
  cursor: default;
  background: transparent;
}

.calendar-day.past {
  color: #BFC9C9;
  cursor: not-allowed;
  background: #fff;
}

.calendar-day.active {
  border-color: #212529 !important;
}

/* Timeslots */
.timeslots-wrapper {
  flex-shrink: 0;
  width: 232px;
  opacity: 0;
  transform: translateX(20px);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  display: none;
}

.timeslots-wrapper.show {
  opacity: 1;
  transform: translateX(0);
  pointer-events: all;
  display: block;
}

.timeslots-container {
  background: #fff;
  border-radius: 12px;
  padding: 32px 10px 32px 0px;
  min-height: 200px;
  display: flex;
  flex-direction: column;
}

.selected-date-label {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 20px;
  color: #263238;
  text-align: left;
  flex-shrink: 0;
}

/* Timeslot buttons */
.timeslot-button {
  padding: 13.5px 20px;
  border: 1px solid #E2E6F0;
  border-radius: 28px;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 16px;
  font-weight: 400;
  color: #212529;
  text-align: center;
  flex-shrink: 0;
}

.timeslot-button:hover {
  background: #fff;
  border-color: #212529;
}

.timeslot-button.active {
  border-color: #212529;
}

/* Disabled timeslots */
.timeslot-button.disabled {
  background: #F0F0F0;
  color: #BFC9C9;
  border-color: #E8EBED;
  cursor: not-allowed;
  opacity: 0.6;
}

.timeslot-button.disabled:hover {
  background: #F0F0F0;
  border-color: #E8EBED;
  transform: none;
}

.timeslot-button.booked {
  position: relative;
}

.slot-status {
  display: block;
  font-size: 12px;
  margin-top: 4px;
  color: #999;
  font-weight: 400;
}
/* Meeting Type Toggle */
.appointment-field-wrapper {
  max-width: 100%;
}

/* Hide the default Drupal title/legend */
.js-form-item-field-request-appointment-0-meeting-type > label,
.form-item--meeting-type > label,
div[id*="edit-field-request-appointment"][id*="meeting-type"] > label {
  display: none !important;
}

/* Radio buttons container */
div[id*="edit-field-request-appointment"][id*="meeting-type"] {
  margin-bottom: 40px;
  display: flex;
}

div[id*="edit-field-request-appointment"][id*="meeting-type"] .form-radios {
  display: flex;
  gap: 0px;
  justify-content: center;
  flex-wrap: nowrap;
  margin-bottom: 0;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

/* Individual radio form items */
div[id*="edit-field-request-appointment"][id*="meeting-type"] .form-item {
  margin: 0;
  flex: 1 1 50%;
  min-width: 0;
  display: inline-flex;
}

/* Hide the actual radio input */
div[id*="edit-field-request-appointment"][id*="meeting-type"] input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* Style the label as a toggle button - DEFAULT STATE */
div[id*="edit-field-request-appointment"][id*="meeting-type"] .form-item label {
  display: block !important;
  padding: 9px 40px;
  border: 1px solid #E3E6EF;
  border-radius: 28px;
  background: #F7F9FB;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
  font-weight: 500;
  color: #212529;
  white-space: nowrap;
  margin: 0;
  height: auto;
  width: 100%;
}

/* Hover state */
div[id*="edit-field-request-appointment"][id*="meeting-type"] .form-item label:hover {
  border-color: #263238;
  background: #F7F9FB;
}

/* Checked/Selected state - WHITE background with BLACK border */
div[id*="edit-field-request-appointment"][id*="meeting-type"] input[type="radio"]:checked + label {
  border-color: #212529;
  background: #fff;
  font-weight: 500;
  box-shadow: none;
  outline: none;
}

/* Focus state for accessibility */
div[id*="edit-field-request-appointment"][id*="meeting-type"] input[type="radio"]:focus + label {
  outline: 2px solid #4A90E2;
  outline-offset: 2px;
  outline: none;
}
/* First button - remove right border radius */
div[id*="edit-field-request-appointment"][id*="meeting-type"] .form-item:first-child label {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

/* Second button - remove left border radius */
div[id*="edit-field-request-appointment"][id*="meeting-type"] .form-item:last-child label {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

/* Desktop: Single column timeslots with scrollbar */
@media (min-width: 1025px) {
  .time-slots-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 300px;
    padding-right: 8px;
    cursor: pointer;
    -webkit-overflow-scrolling: touch;
  }

  .time-slots-grid::-webkit-scrollbar {
    width: 6px;
    background-color: #F7F9FB;
  }

  .time-slots-grid::-webkit-scrollbar-track {
    background-color: #F7F9FB;
    border-radius: 10px;
  }

  .time-slots-grid::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
  }

  .timeslot-button {
    width: 211px;
  }
  fieldset.meeting-type-toggle.form-radios-inline {
    margin-top: 35px;
  }
}


/* Tablet and Mobile: 2 columns, no scrollbar */
@media (max-width: 1024px) {
  .time-slots-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    overflow-y: visible;
    overflow-x: hidden;
    max-height: none;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .time-slots-grid::-webkit-scrollbar {
    display: none;
  }

  .appointment-calendar-interface {
    flex-direction: column;
    align-items: center;
    gap: 24px;
  }

  .appointment-calendar-interface.has-selection {
    max-width: 100%;
  }

  .calendar-wrapper,
  .timeslots-wrapper {
    width: 100%;
    max-width: 420px;
  }

  .timeslots-wrapper {
    transform: translateY(20px);
    max-width: 356px;
  }

  .timeslots-wrapper.show {
    transform: translateY(0);
  }

  div[id*="edit-field-request-appointment"][id*="meeting-type"] .form-radios {
    display: flex;
    gap: 0; /* Changed from 16px to 0 */
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 0;
  }
  .timeslots-container {
    padding: 0px 10px 0px 0px;
  }
  div[id*="edit-field-request-appointment"][id*="meeting-type"] .form-item label {
    padding: 11px 40px;
  }
}

@media (max-width: 1024px) {
  .calendar-day {
    font-size: 14px;
  }

  .current-month-year {
    font-size: 18px;
  }

  .calendar-wrapper,
  .timeslots-wrapper {
    padding: 0px 16px 0px 16px;
  }
  .meeting-type-mobile-hidden {
    display: none !important;
  }
  .timeslots-header {
    margin-bottom: 24px !important;
  }
}

/* Appointment Step in Enquiry Modal */
#appointment_step {
  padding: 0;
}

#appointment_step h2.h5 {
  margin-bottom: 20px;
  text-align: center;
}

#appointment_step .appointment-step-content {
  /*margin-bottom: 20px;*/
}

/* Validation error styling */
#appointment_step.has-error .appointment-calendar-interface {
  /*border: 1px solid #dc3545;*/
  /*border-radius: 12px;*/
  /*padding: 10px;*/
}

.appointment-validation-error {
  font-size: 14px;
  margin-top: 10px;
}

/* Mobile appointment view split handling */
@media (max-width: 1024px) {
  .appointment-mobile-date-view,
  .appointment-mobile-time-view {
    width: 100%;
  }

  .appointment-mobile-time-view {
    padding: 20px 0;
  }

  .appointment-mobile-time-view .back-to-date {
    margin-bottom: 15px;
    display: inline-block;
    color: #212529;
    text-decoration: underline;
    cursor: pointer;
    font-size: 14px;
  }

  /* Ensure calendar interface fits well in modal on mobile */
  #appointment_step .appointment-calendar-interface {
    padding: 0;
  }

  #appointment_step .calendar-wrapper {
    width: 100%;
    padding: 10px;
    max-width: 356px;
  }
}

/* Ensure proper spacing in enquiry modal context */
#enquiryFormModal #appointment_step .appointment-calendar-interface {
  max-width: 100%;
}
/* Timeslots header with date and change link */
.timeslots-header {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  font-weight: 700;
  font-size: 16px;
}

.selected-date-display {
  color: #212529;
}

.change-date-link {
  color: #212529;
  text-decoration: underline;
  font-weight: 700;
  font-size: 16px;
  display: none;
}

/* Show change link only on mobile */
@media (max-width: 1024px) {
  .change-date-link {
    display: inline;
  }

  /* When in mobile timeslots view, ensure proper layout */
  .appointment-calendar-interface.mobile-timeslots-view .timeslots-wrapper {
    display: block !important;
  }

  .appointment-calendar-interface.mobile-timeslots-view .calendar-wrapper {
    display: none !important;
  }
}
