/* Calendar Styles */
#calendarGrid {
  background-color: #fff;
  padding: 16px 8px;
  border-radius: var(--base-border-radius);
  box-shadow: var(--base-box-shadow);
  border: var(--base-border);
}

.calendar-container {
  background-color: #fff;
  margin-bottom: 24px;
}

@media (min-width: 996px) {
  #bookingCalendar {
    border-right: 1px solid #ededed;
    padding-left: 16px;
    margin-bottom: 0px;
  }
  .calendar-container {
    border-right: 1px solid #ededed;
    padding-right: 20px;
  }
  #calendarGrid {
    padding: 24px 16px;
    max-height: 640px;
  }
}

.weekdays {
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.weekdays div {
  width: calc(100% / 7);
  text-align: center;
  color: #666;
}

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

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.4s;
  font-size: 14px;
  position: relative;
  color: #4d535e
}

.calendar-day:hover:not(.empty) {
  background-color: #f3f4f6;
}



.calendar-day.today {
  font-weight: 700;
  border-color: #3b82f6;
  color:var(--base-color);
}

.calendar-day.has-bookings {
  background-color: #f3f3f3;
  border-color: #7F919E;
  color:var(--base-color);
}

.calendar-day.selected {
  background-color: var(--brand-color);
  color: white;
  border-color: var(--brand-color);
}

.calendar-day.selected.has-bookings {
  background-color: var(--brand-color);
  border-color: var(--brand-color);
}

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

.booking-count {
  display: block;
  font-size: 11px;
  margin-top: 2px;
  color: #0369a1;
}

.calendar-day.selected .booking-count {
  color: white;
}

/* Day Bookings Display */
.day-bookings-container {

  height: 100%;

}

@media (min-width: 996px) {
  .day-bookings-container {
    /* max-height: 600px; */
    overflow-y: auto;
  }
}

.day-bookings {
  max-height: 500px;
  overflow-y: auto;
}

.booking-area {
  margin-bottom: 24px;
}

.area-name {
  font-size: 16px;
  font-weight: 500;
  padding-bottom: 8px;
  margin-bottom: 0px;
}

.booking-card {
  background-color: #fff;
  border: 1px solid #f3f3f3;
  border-left: 3px solid var(--primary-color);
  padding: 12px;
  border-radius: var(--base-border-radius);
  font-size: var(--font-14);
  margin-bottom: 8px;
  transition: background-color 0.3s ease;
}

.booking-card:hover {
  cursor: pointer;
  background-color: #f3f3f3;
}


.booking-card.disabled {
  opacity: 0.5;
}

.booking-time {
  margin-bottom: 4px;
}

@media (min-width: 992px) {

  /* When JS adds this class, add extra padding for scrollbar */
  .day-bookings.has-scrollbar {
    padding-right: 16px; /* Adjust this value based on your scrollbar width */
  }
}


.customer-email {
  color: #6c757d;
  font-size: 0.8rem;
  margin-bottom: 4px;
  word-break: break-all;
}

.booking-details {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 0.8rem;
}

.booking-ref {
  color: #6c757d;
}

.booking-price {
  font-weight: 500;
}

/* List View Styles */
.calendar-list-view {
  background-color: #fff;
  border-radius: 8px;
}

.list-date-section {
  margin-bottom: 16px;
}

.list-date-header {
  font-size: 18px;
  font-weight: 600;
  padding: 12px 15px;
  background-color: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
  border-top: 1px solid #dee2e6;
}

.list-hour-header {
  color: #6c757d;
  padding: 10px 15px;
  font-weight: 600;
  background-color: #f8f9fa;
  border-bottom: 1px solid #eee;
}

.list-booking-card {
  border-bottom: 1px solid #f4f4f4;
  padding: 12px 15px;
}

.list-booking-content {
  padding: 8px;
}

.booking-service {
  font-weight: 500;
  margin-bottom: 4px;
}

.area-tag {
  background-color: #007bff;
  color: white;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.75rem;
  margin-right: 6px;
  font-weight: 500;
  display: inline-block;
}

.time-suffix {
  font-size: 0.7rem;
  color: #999;
  margin-left: 2px;
  text-transform: lowercase;
}

/* Filter Styles */
.input-group-text {
  background-color: #f8f9fa;
  font-weight: 500;
}

.form-select:focus {
  border-color: #FB5D45;
}

/* Responsive Adjustments */
@media (max-width: 767px) {
  .calendar-container, 
  .day-bookings-container {
    margin-bottom: 16px;
  }
  
  .day-bookings {
    max-height: none;
  }
  
  .days-grid {
    gap: 3px;
  }
  
  .calendar-day {
    font-size: 14px;
  }
  
  .booking-count {
    font-size: 9px;
  }
}

/* New Booking Form Styles */
.calendar-nav > a:hover {
  cursor: pointer;
}

.weekdays {
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.weekdays div {
  width: calc(100% / 7);
  text-align: center;
  color: #666;
}

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

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.4s;
  font-size: 14px;
}

.calendar-day.available {
  /* border: 1px solid #EDEDED; */
  font-weight: 500;
  /* box-shadow: var(--base-box-shadow); */
}

.calendar-day.selected {
  background-color: var(--brand-color);
  color: white;
  border-color: var(--brand-color);
  box-shadow: var(--base-box-shadow);
}

.calendar-day.disabled {
  color: #d1d5db;
  cursor: not-allowed;
}

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

.time-slots-container {
  margin-top: 16px;
}

/* .time-slots-area-name {
    position: sticky;
    top: -2px;
    background: white;
    z-index: 10;
    padding-bottom: 4px;
  } */
.time-slots-container h3 {
  position: sticky;
  top: 0;
  background: white;
  z-index: 10;
  padding-bottom: 4px;
}

.time-slots-container {
  max-height: 400px;
  overflow: auto;
}

.month-nav-btn {
  background-color: #f3f4f6;
  border: var(--base-border);
  color:var(--base-color);
  border-radius: 8px;
  padding: 4px 8px;
  border:none;
}

/* Mobile styles */
@media (max-width: 996px) {
  .time-slots-container {
    max-height: none;
    overflow: visible; /* Allow sticky elements to work relative to viewport */
  }
}

/* Desktop styles */
@media (min-width: 996px) {
  .calendar-day:hover:not(.empty):not(.disabled) {
    background-color: var(--brand-color);
    color: white;
  }

  .time-slots-container {
    min-height: 100%;
    padding: 0 16px;
    margin-top: 0;
  }

  .days-grid {
    gap: 8px;
  }
}

.time-slots {
  display: flex;
  flex-direction: column;
  gap: 10px;
}


/* Selected state */
.time-slots-grid .time-slot.selected {
  color: var(--base-color);
  border-color: #58a7e7;
  background: #f3f8fc;
}

/* Selected hover state - make this the most specific */
@media (min-width: 996px){
  .time-slots-grid .time-slot.selected:hover {
    background-color: var(--brand-color);; /* Slightly darker orange */
  }
  .time-slots-grid .time-slot:hover:not(.disabled) {
  border-color: var(--brand-color);
  background-color: #f3f8fc;
  color: var(--base-color);
}
}

/* Regular hover state */



.time-slot.disabled {
  background-color: #f3f4f6;
  cursor: not-allowed;
  color: #9ca3af;
}

.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid #f3f4f6;
  border-radius: 50%;
  border-top-color: #f97316;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.time-slots-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.time-slot {
  padding: 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
  background: #fff;
  border: var(--base-border);
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  justify-content: space-between;
  align-items: center;
  /* box-shadow: var(--base-box-shadow); */
  background-color: #fff;
}

@media (min-width: 996px){
  .time-slot:not(.disabled):hover {
    border-color: var(--brand-color);
    background-color: var(--brand-color);
    color: white;
  }
}

.time-slot.selected {
  background-color: var(--brand-color);
  color: white;
  border-color: var(--brand-color);
}

/* .time-slot.selected .time-slot-status {
  color: rgba(255, 255, 255, 0.8);
} */

.time-slot.disabled {
  background-color: #f3f4f6;
  cursor: not-allowed;
  opacity: 0.7;
}

.time-slot-time {
  font-weight: 500;
}

.time-slot-status {
  color: #6b7280;
  text-align: right;
}
.quantity-control {
  border: none; 
  padding: 2px;
}

.quantity-control button {
  width: 28px;
    height: 28px;
    padding: 0;
    background: #f3f3f3;
    font-weight: 600;
    color: var(--brand-color);
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    padding-bottom: 2px;
    
}

.quantity-control button:disabled {
  opacity: 0.4;
}

.quantity-control-text {
  font-weight: 600;
  padding: 4px 6px;
  font-size: 16px;
  border: none;
}