html, body {
  margin: 0;
  padding: 0;
  width: 100%;
}

.calendar-wrapper {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  padding: 0;
  margin: 0;
  background-color: #f9f9f9;
  width: 100%;
  box-sizing: border-box;
}

.custom-select {
  position: relative;
  display: inline-block;
  width: 100%;
  max-width: 280px;
  margin: 0 auto;
  box-sizing: border-box;
}

@media (min-width: 769px) {
  .custom-select {
    max-width: 400px;
  }
}

.custom-select select {
  max-width: 100%;
  width: 100%;
  padding: 10px 40px 10px 10px;
  font-size: 16px;
  border-radius: 6px;
  border: 1px solid #ccc;
  background-color: white;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  text-align: center;
  text-align-last: center;
}

.custom-select::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  pointer-events: none;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid #333;
}

#monthSelector {
  font-weight: bold;
}

button {
  padding: 10px;
  margin: 8px;
  font-size: 16px;
  border-radius: 6px;
  border: 1px solid #ccc;
  background: white;
  cursor: pointer;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 20px 0;
  padding: 0;
  flex-wrap: nowrap;
  width: 100%;
  box-sizing: border-box;
}

.selectors-wrapper {
  display: flex;
  flex-direction: row;
  gap: 15px;
  align-items: center;
  justify-content: center;
}

.nav-arrow {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: #1c2541;
  font-weight: bold;
  padding: 4px 10px;
  flex-shrink: 0;
}

.nav-arrow:hover {
  color: #4a6ee0;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  font-weight: bold;
  text-align: center;
  font-size: 15px;
  margin-top: 20px;
}

.calendar-weekdays div {
  background-color: #edf1f7;
  padding: 12px 0;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  color: #1c2541;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  margin-top: 10px;
  align-items: stretch;
}

#calendar-container {
  position: relative;
}

#calendar {
  width: 100%;
  overflow-x: auto;
}

.calendar-cell {
  border-radius: 10px;
  text-align: center;
  background-color: #f4f4f4;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  min-height: 90px;
  padding: 4px;
  font-size: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
}

.calendar-cell.available {
  background-color: #e6f4ea;
  border: 1px solid #34a853;
  color: #202124;
}

.calendar-cell.unavailable {
  background-color: #fce8e6;
  border: 1px solid #d93025;
  color: #5f2120;
}

.calendar-cell.past-day {
  background-color: #f1f3f4;
  color: #9aa0a6;
}

.calendar-cell.last-tickets {
  background-color: #fff3e0;
  border: 1px solid #f57c00;
  color: #5d3c00;
}

.day-number {
  font-size: 13px;
  font-weight: bold;
  background-color: #e0e0e0;
  padding: 3px 0;
  margin-bottom: 6px;
  width: 100%;
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
}

.availability-count {
  font-weight: bold;
  font-size: 14px;
  line-height: 1.2;
  color: green;
  white-space: nowrap;
}

.book-button {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 6px;
  background: linear-gradient(90deg, #7b7bff, #76d7e3);
  color: white;
  text-decoration: none;
  border-radius: 4px;
  font-weight: bold;
  font-size: 11px;
}

.mobile-book-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  font-weight: bold;
  color: green;
  margin-top: 4px;
}

.desktop-text {
  display: inline !important;
}

.mobile-text {
  display: none !important;
}

@media (max-width: 768px) {
  .calendar-cell {
    min-height: 60px;
    font-size: 12px;
    padding: 4px 2px;
  }

  .day-number {
    font-size: 13px;
    padding: 2px;
  }

  .availability-count {
    font-size: 11px;
  }

  .book-button {
    font-size: 10px;
    padding: 2px 5px;
  }

  .calendar-header {
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: flex-start;
  }

  .selectors-wrapper {
    flex-direction: column;
    gap: 10px;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    text-align: center;
  }

  .calendar-weekdays {
    font-size: 13px;
  }

  .nav-arrow {
    display: none;
  }

  .mobile-text {
    display: inline !important;
  }

  .desktop-text {
    display: none !important;
  }

  .mobile-month-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
  }
}

.mobile-month-row {
  display: none;
}

.mobile-nav-arrow {
  font-size: 22px;
  padding: 6px 12px;
  background: white;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-weight: bold;
  color: #1c2541;
  cursor: pointer;
}

.mobile-nav-arrow:hover {
  background-color: #f0f0f0;
}

.month-wrapper {
  width: auto;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

#loadingOverlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  z-index: 10;
  display: none;
  justify-content: center;
  align-items: center;
  text-align: center;
  font-family: "Segoe UI", sans-serif;
}

#calendar.fade-out {
  opacity: 0;
  transition: opacity 0.3s ease-out;
}

#calendar.fade-in {
  opacity: 1;
  transition: opacity 0.3s ease-in;
}

#calendarLoader {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 200px;
  font-size: 16px;
  color: #888;
}

#calendarLoader::after {
  content: '';
  width: 32px;
  height: 32px;
  border: 4px solid #ccc;
  border-top: 4px solid #1c2541;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-left: 10px;
}

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

.loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 5px solid rgba(0, 0, 0, 0.1);
  border-top: 5px solid #1c2541;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loading-text {
  font-size: 16px;
  color: #1c2541;
  line-height: 1.4;
}

.loading-text strong {
  font-size: 18px;
  font-weight: bold;
}
