/* CALENDAR STEP STYLES */

/* --- General Layout & Typography --- */
#all-calendars-wrapper {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  font-family: "Roboto", sans-serif;
}

.calendar-view-container {
  display: flex;
  justify-content: center;
  gap: 2rem;
}

/* --- Ticket List Styling --- */
.ticket-list {
  flex: 0 0 320px;
  padding-top: 10px;
}

.ticket-group {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  margin-bottom: 1rem;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  cursor: pointer;
  background-color: #f7f7f7;
  transition: background-color 0.3s ease;
}

.group-header:hover {
  background-color: #f0f0f0;
}

.group-name {
  font-size: 1rem;
  font-weight: 500;
  color: #212121;
}

.toggle-icon i {
  color: #757575;
  transition: transform 0.3s ease;
}

.ticket-item {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  transition: background-color 0.2s ease, border-left-color 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  border-left: 4px solid transparent;
}

.ticket-item:last-child {
  border-bottom: none;
}

.ticket-item:hover {
  background-color: #f5f5f5;
}

.ticket-item.active {
  background-color: #e3f2fd;
  border-left-color: #1976d2;
}

.ticket-item.configured {
  background-color: #e8f5e9;
  border-left-color: #4CAF50;
}

.ticket-item.error {
  background-color: #ffcdd2;
  border-left-color: #F44336;
}

.selected-date {
  font-size: 0.8rem;
  color: #1976d2;
  font-weight: 500;
}

/* --- Calendar Styling --- */
.calendar-wrapper {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 0;
  margin: 0;
}

.info-section.material-info-section {
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  background-color: #fff;
  width: 100%;
  max-width: 480px;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1rem;
}

.calendar-header h2.current-month {
  font-size: 1.25rem;
  font-weight: 500;
  color: #212121;
  margin: 0;
}

.calendar-header button {
  background: none;
  border: 1px solid #e0e0e0;
  cursor: pointer;
  color: #757575;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.calendar-header button:hover {
  background-color: #f5f5f5;
  color: #212121;
}

.weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e0e0e0;
}

.weekdays div {
  text-align: center;
  font-size: 0.8rem;
  font-weight: 500;
  color: #757575;
}

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

.calendar-day {
  border: 2px solid transparent;
  padding: 0.25rem;
  text-align: center;
  min-height: 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  border-radius: 8px;
  font-size: 0.9rem;
  transition: background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.calendar-day.empty,
.calendar-day.past-date {
  background-color: transparent;
  color: #bdbdbd;
  cursor: default;
  pointer-events: none;
}

.calendar-day.next-month,
.calendar-day.prev-month {
  opacity: 0.5;
}

.calendar-day.available {
  cursor: pointer;
}

.calendar-day.available:hover {
  background-color: #f5f5f5;
  opacity: 1;
}

.calendar-day.not-available {
  color: #bdbdbd;
  cursor: not-allowed;
  background-color: #f9f9f9;
  opacity: 0.7;
}

.calendar-day.selected {
  background-color: #e3f2fd;
  /* Light blue */
  border-color: #1976d2;
  /* Primary blue */
  color: #1976d2;
  font-weight: 700;
}

.calendar-day.selected .price {
  color: #1976d2 !important;
}

.calendar-day.selected-overlap {
  color: #1976d2 !important;
   opacity: 0.5;
}

.calendar-day.selected-overlap .price,
.calendar-day.selected-overlap .availability-count {
  opacity: 0.5;
}

.calendar-day .price {
  font-size: 0.75rem;
  font-weight: 500;
  margin-top: 0.25rem;
}

/* Price colors */
.price-high {
  color: #4CAF50;
}

.price-above-average {
  color: #4CAF50;
}

.price-average {
  color: #4CAF50;
}

.price-low {
  color: #4CAF50;
}

.calendar-day.available.dimmed {
  opacity: 0.6;
}

/* --- Error and Utility Styling --- */
.calendar-error {
  border: 2px solid #F44336;
  box-shadow: 0 0 8px rgba(244, 67, 54, 0.3);
}

.calendar-error-message {
  display: none;
  /* Hidden by default */
}

.calendar-error .calendar-error-message {
  display: block;
  color: #d32f2f;
  font-size: 0.9rem;
  margin-top: 0.5rem;
  text-align: center;
}

.select-all-button {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  border: none;
  border-radius: 4px;
  background-color: #1976d2;
  color: white;
  cursor: pointer;
  transition: background-color 0.3s ease;
  width: 100%;
}

.select-all-button:hover {
  background-color: #1565c0;
}

.confirm-calendar-selection-btn {
  padding: 11px 10px;
}

.calendar-confirm-container {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* --- Responsiveness --- */
@media (max-width: 991px) {
  .calendar-view-container {
    flex-direction: column;
    align-items: stretch;
  }

  .ticket-list {
    flex: 1 1 auto;
    max-width: 100%;
    margin-bottom: 2rem;
  }
}


/* --- Fix for calendar modal layout in shop --- */
#calendarModal {
  text-align: center;
  padding-left: 0 !important;
  /* Overcome BS issue on scrollbar */
  background-color: rgba(0, 0, 0, 0.5);
  overflow-y: auto;
}

@media screen and (min-width: 768px) {
  #calendarModal:before {
    display: inline-block;
    vertical-align: middle;
    content: " ";
    height: 100%;
  }
}

#calendarModal .modal-dialog {
  display: inline-block;
  text-align: left;
  vertical-align: middle;
}

/* --- Calendar Modal Specific Styles --- */
#calendarModal .modal-dialog {

  width: 90%;
  margin: 1.75rem auto;
}

#calendarModal .info-section.material-info-section {
  max-width: 100%;
  /* Allow calendar to fill the modal width */
  box-shadow: none;
  border: none;
  padding: 1rem;
}

#calendarModal .calendar-day {
  min-height: 75px;
  /* Increase day height */
  font-size: 1rem;
}

#calendarModal .calendar-day .price {
  font-size: 0.85rem;
}

/* Responsive adjustments for the modal calendar */
@media (max-width: 767px) {
  #calendarModal .modal-dialog.modal-lg {
    max-width: 95%;
    width: 95%;
  }

  #calendarModal .calendar-day {
    min-height: 60px;
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  #calendarModal .modal-body {
    padding: 0;
  }

  /* #calendarModal .info-section.material-info-section {
    padding: 0.5rem;
  } */

  #calendarModal .calendar-day {
    min-height: 45px;
    font-size: 0.85rem;
    padding: 2px;
  }

  #calendarModal .calendar-day .price {
    font-size: 0.65rem;
  }

  #calendarModal .calendar-header h2.current-month {
    font-size: 1.1rem;
  }
}

/* --- Responsive Layout for Modal Sidebar & Content --- */
@media (max-width: 991px) {
  .calendar-sidebar {
    min-height: auto;
    border-right: none;
    border-bottom: 1px solid #eee;
    padding: 1.5rem;
  }

  .calendar-modal-content {
    padding: 1.5rem;
  }

  .calendar-batch-list {
    max-height: 200px;
  }
}


/* --- Calendar Modal Sidebar Styling --- */
/* Fix for Bootstrap 3 Row + Flexbox issue causing overflow */
.row.display-flex {
  display: flex;
  flex-wrap: wrap;
  margin: 0;
}

.row.display-flex:before,
.row.display-flex:after {
  display: none;
}

.calendar-modal-body {
  padding: 0;
}

.calendar-sidebar {
  background: #fff;
  padding: 2.5rem 2rem;
  border-right: 1px solid #eee;
  min-height: 550px;
  display: flex;
  flex-direction: column;
}

.calendar-sidebar-title {
  margin-top: 0;
  margin-bottom: 1.5rem;
  font-weight: 500;
  color: #333;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-size: 1.1rem;
  border-bottom: 2px solid #1976d2;
  padding-bottom: 0.75rem;
  display: inline-block;
}

.calendar-batch-controls {
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: flex-end;
}

.calendar-batch-controls button {
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
}

.calendar-batch-controls button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.calendar-batch-list {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 1rem;
  border: none;
  box-shadow: none;
  max-height: 350px;
  /* Prevent it from pushing summary too far down */
}

.calendar-batch-list .list-group-item {
  border: none;
  border-radius: 8px;
  margin-bottom: 0.75rem;
  background-color: #f8f9fa;
  transition: all 0.2s;
  border-left: 4px solid transparent;
  padding: 1rem;
}

.calendar-batch-list .list-group-item:hover {
  background-color: #f8f9fa;
  color: black;
}

.calendar-batch-list .list-group-item.active-slot {
  background-color: #fff;
  border-left-color: #1976d2;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.batch-summary {
  margin-top: auto;
  /* Push to bottom */
  border-top: 1px solid #eee;
  padding-top: 1.5rem;
  background: #fff;
}

.batch-summary strong {
  display: block;
  margin-bottom: 1rem;
  font-size: 1.1rem;
  color: #333;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.batch-summary strong span {
  background: #1976d2;
  color: #fff;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.9rem;
}

#batch-confirm-btn {
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 12px;
  box-shadow: 0 4px 6px rgba(25, 118, 210, 0.2);
  transition: all 0.2s;
}

#batch-confirm-btn:not(:disabled):hover {
  box-shadow: 0 6px 8px rgba(25, 118, 210, 0.3);
  transform: translateY(-1px);
}

.calendar-modal-content {
  padding: 2.5rem;
  background-color: #fff;
}

.list-group-item.batch-slot-item {
  color: black;
}

.qty-btn {
  width: 25px;
  height: 25px;
  min-width: 25px;
  border-radius: 50% !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  line-height: 1 !important;
  margin: 0 !important;
}

.availability-count {
  font-size: 10px;
  color: #555;
}

@media (max-width: 767px) {

  /* On mobile, ensure columns stack nicely if flex is acting up, though wrap should handle it. 
     We enforce 100% width just in case flex behavior tries to squeeze them. */
  .calendar-sidebar,
  .calendar-modal-content {
    width: 100%;
    flex: 0 0 100%;

  }

  .calendar-modal-content {
    padding: 10px;
  }

  .batch-add-container {
    text-align: center;
    display: flex;
    justify-content: center;

  }

  .availability-count {
    font-size: 8px;

  }
}

@media (max-width: 480px) {
  .calendar-day {
    min-height: 50px;
    font-size: 0.8rem;
  }

  .calendar-day .price {
    font-size: 0.65rem;
  }

  .info-section.material-info-section {
    padding: 0.3rem;
  }

  .ticket-list {
    flex-basis: auto;
  }
}