/* Access Collins Booking Widget Styles */
/* Define CSS Custom Properties */
:root {
  --color-white: #ffffff;
  --color-grey-border: #e0e0e0;
  --color-black: #000000;
  --color-orange: #ffbb5f;
  --color-action: #29343E;
  --color-green: #9ac9a5;
  --color-slip: #F6F6F6;
  --box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  --header-font-family: "Contax75Bold", Arial, Helvetica, sans-serif;
}

.access-collins-content {
  max-width: 800px;
  margin: 20px auto 0;
}

.access-collins-booking-widget {
  background: var(--color-white);
  border: 1px solid var(--color-grey-border);
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0;
  box-shadow: var(--box-shadow);
}

.booking-form-container h3 {
  color: var(--color-black);
  text-align: center;
}

div.ui-datepicker-inline {
  width: 100%
}

/* override all styles so we control */
/* ignore the highlight class - as we don't want attention drawn to todays date.*/

form#access-collins-booking-form a.ui-state-default,
form#access-collins-booking-form a.ui-state-highlight {
  border: 1px solid var(--color-action);
  background: var(--color-slip);
  color: var(--color-action);
  text-align: center;
}
form#access-collins-booking-form td span {
  text-align: center;
}

/* only apply the style to the active state after first click */
form#access-collins-booking-form.date-selected a.ui-state-active {
  border: 1px solid var(--color-action);
  background: var(--color-action);
  color: var(--color-white);
}

/* Event Times Styles */
.event-type-times-wrapper {
  margin-top: 1rem;
  margin-bottom: 1rem;
}

.times-list {
  justify-content: center;
}

.time-option label {
  display: inline-block;
  padding: 10px 16px;
  background: var(--color-green);
  border: 2px solid var(--color-grey-border);
  color: var(--color-black);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  user-select: none;
}

/* May enquire styling - Orange theme - hatched */

.time-option.may-enquire label, .availability span.enquire {
  border-color: var(--color-orange);
  color: var(--color-black);
  position: relative;
  background: repeating-linear-gradient(
    45deg,
    var(--color-orange),
    var(--color-orange) 12px,
    #f5a85a 12px,
    #f5a85a 14px
  );
}

/* Selected option styling */
.time-option.selected label {
  border-color: var(--color-action);
  box-shadow: var(--box-shadow);
  position: relative;
}

/* Tick mark overlay on selected time */
.time-option.selected label::after {
  content: "✓";
  position: absolute;
  right: 1px;
  bottom: 1px;
  width: 24px;
  height: 24px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--color-action);
  line-height: 1;
}

.time-option label:hover {
  box-shadow: 0 2px 4px rgba(0, 123, 255, 0.2);
  transform: translateY(-1px);
}

/* Conflict and buffer styles */
div.time-option.conflicted {
  opacity: 0.5;
  cursor: not-allowed;

}

div.time-option.conflicted label {
  pointer-events: none;
}

/* Override checkbox styling to match radio button behavior */
.time-option input[type="checkbox"] {
  display: none;
}

.hide {
  display: none;
}

/* Booking button styling */
#booking-button-group {
  margin-top: 20px;
  text-align: center;
}

#book-now-btn {
  background: var(--color-action);
  font-family: var(--header-font-family);
}

/* When date-selected is NOT on the form, disable the buttons */
form#access-collins-booking-form button.event-type-button:not(.available) {
  opacity: 0.2;
  pointer-events: none;
  cursor: not-allowed;
}

#access-collins-booking-form button.event-type-button.not-available {
  opacity: 0.2;
  pointer-events: none;
  cursor: not-allowed;
}

/* Event Type Button with Arrow Icon */
#access-collins-booking-form button.event-type-button {
  background: var(--color-action);
  font-family: var(--header-font-family);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  transition: opacity 0.3s ease;
  line-height: 2rem;
  text-align: left;
}

span.spacer {
  width: 30px;
}

button.available span.spacer, button.loading span.spacer {
  display: none;
}

.event-type-button .arrow-icon {
  margin-left: 10px;
  fill: currentColor;
  transition: transform 0.3s ease;
  flex-shrink: 0;
  display: none;
}

button.available svg.arrow-icon {
  display: inline-block;
}

/* Rotate arrow when button is active (content is expanded) */
.event-type-button.active .arrow-icon {
  transform: rotate(180deg);
}

/* Optional: Add some hover effect */
.event-type-button:hover .arrow-icon {
  transform: translateY(2px);
}

.event-type-button.active:hover .arrow-icon {
  transform: rotate(180deg) translateY(-2px);
}

/* Availability Key Styles */
.availability {
  margin: 15px 0;
  padding: 10px;
  background: var(--color-slip);
  border-radius: 6px;
}

.availability p {
  display: flex;
  align-items: center;
  margin: 8px 0;
  font-size: 0.9rem;
  color: var(--color-action);
}

.availability span.good,
.availability span.enquire {
  display: inline-block;
  width: 2rem;
  height: 1rem;
  border-radius: 4px;
  margin-left: 1rem;
}

.availability span.good {
  background: var(--color-green);
}

/* loading spinner */

/* Loading Spinner Icon */
.event-type-button .spinner-icon {
  width: 20px;
  height: 20px;
  margin-left: 10px;
  display: none;
  flex-shrink: 0;
}

.event-type-button.loading .spinner-icon {
  display: inline-block;
  animation: spin 1.2s linear infinite;
}

.event-type-button.loading .arrow-icon {
  display: none;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Elegant spinner design - thin elegant circle */
.spinner-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.spinner-icon circle {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.spinner-icon circle.spinner-track {
  stroke: rgba(255, 255, 255, 0.2);
}

.spinner-icon circle.spinner-progress {
  stroke-dasharray: 50, 100;
  opacity: 0.8;
}

div.unavailable-message {
  padding-left: 1rem;
  padding-bottom: 1rem;
  font-size: 0.9rem;
  padding-right: 1rem;
}

/* Position and show spinner when form is loading */
div#inline-datepicker {
  position: relative;
}

form#access-collins-booking-form.ajax-loading svg.calendar-loading-spinner {
  display: block!important;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  animation: spin 1s linear infinite;
}

/* Create the backdrop element with initial state */
form#access-collins-booking-form div#inline-datepicker::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--color-white);
  opacity: 0;
  z-index: -1; /* Behind calendar so it doesn't block clicks */
  transition: opacity 0.3s ease-in-out, z-index 0s 0.3s; /* Delay z-index change */
}

/* Show backdrop when loading */
form#access-collins-booking-form.ajax-loading div#inline-datepicker::after,
form#access-collins-booking-form.no-party-size div#inline-datepicker::after {
  opacity: 0.6;
  z-index: 1; /* In front when loading */
  transition: opacity 0.3s ease-in-out, z-index 0s 0s; /* No delay when showing */
}

/* Disable entire table cells during AJAX loading to prevent hover effects */
form#access-collins-booking-form.ajax-loading .ui-datepicker-calendar td,
form#access-collins-booking-form.no-party-size .ui-datepicker-calendar td {
  pointer-events: none !important;
  opacity: 0.4;
  transition: opacity 0.3s ease;
}

/* Party size attention glow when no selection is made */
form#access-collins-booking-form.no-party-size #party-size {
  position: relative;
  box-shadow: 0 0 0 2px rgba(41, 52, 62, 0.3);
  animation: party-size-pulse 2s ease-in-out infinite;
  border-color: var(--color-action);
}

@keyframes party-size-pulse {
  0% {
    box-shadow: 0 0 0 2px rgba(41, 52, 62, 0.3);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(41, 52, 62, 0.2), 0 0 0 2px rgba(41, 52, 62, 0.4);
  }
  100% {
    box-shadow: 0 0 0 2px rgba(41, 52, 62, 0.3);
  }
}

/* Remove the glow when a selection is made or on focus */
form#access-collins-booking-form #party-size:focus,
form#access-collins-booking-form:not(.no-party-size) #party-size {
  animation: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}


