/* ================================================================
   Master Appointments - Booking Grid
   Layout tipo Calendário
   ================================================================ */

/* Importar font Outfit */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&display=swap');

/* Reset e base */
#ma-booking-grid {
  font-family: 'Outfit', sans-serif;
  color: #1b2440;
  background-color: #ffffff;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

#ma-booking-grid * {
  font-family: 'Outfit', sans-serif;
}

/* ================================================================
   CALENDAR CONTAINER (Principal)
   ================================================================ */

.ma-calendar-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
}

/* ================================================================
   CALENDAR HEADER (Mês/Ano com setas)
   ================================================================ */

.ma-calendar-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 16px 0;
  border-bottom: 2px solid #f0f0f0;
}

.ma-month-year {
  font-size: 24px;
  font-weight: 600;
  color: #1b2440;
  min-width: 200px;
  text-align: center;
}

.ma-nav-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 8px;
  background-color: #f7f9fa;
  color: #1b2440;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
  font-size: 18px;
  font-weight: 600;
}

.ma-nav-arrow:hover {
  background-color: #24bdc0;
  color: #ffffff;
}

.ma-nav-arrow:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.ma-nav-prev-month::before {
  content: '◀';
}

.ma-nav-next-month::before {
  content: '▶';
}

.ma-nav-prev-days::before {
  content: '◀';
}

.ma-nav-next-days::before {
  content: '▶';
}

/* ================================================================
   DAYS LIST CONTAINER (Dias em scroll horizontal)
   ================================================================ */

.ma-days-list-container {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  overflow-x: auto;
  padding: 0 0 12px 0;
}

.ma-days-list {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding-right: 10px;
  flex: 1;
}

.ma-days-list::-webkit-scrollbar {
  height: 6px;
}

.ma-days-list::-webkit-scrollbar-track {
  background: #f0f0f0;
  border-radius: 10px;
}

.ma-days-list::-webkit-scrollbar-thumb {
  background: #24bdc0;
  border-radius: 10px;
}

.ma-days-list::-webkit-scrollbar-thumb:hover {
  background: #1a9a97;
}

/* ================================================================
   DAY BUTTON (Cada dia na lista)
   ================================================================ */

.ma-day-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 70px;
  width: 70px;
  height: 80px;
  padding: 8px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  background-color: #ffffff;
  color: #1b2440;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
  white-space: nowrap;
}

.ma-day-button.available {
  background-color: #f7f9fa;
  border-color: #e0e0e0;
}

.ma-day-button.available:hover {
  background-color: #e8f6f5;
  border-color: #24bdc0;
}

.ma-day-button.selected {
  background-color: #24bdc0;
  color: #ffffff;
  border-color: #24bdc0;
  font-weight: 600;
}

.ma-day-button.unavailable {
  background-color: #f0f0f0;
  color: #adacac;
  border-color: #e0e0e0;
  cursor: not-allowed;
  opacity: 0.6;
}

.ma-day-name {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #8a2be2;
  text-transform: uppercase;
}

.ma-day-button.selected .ma-day-name {
  color: #ffffff;
}

.ma-day-number {
  display: block;
  font-size: 18px;
  font-weight: 700;
}

/* ================================================================
   SLOTS CONTAINER (Container dos horários)
   ================================================================ */

.ma-slots-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 12px;
}

/* ================================================================
   SELECTED DATE LABEL (Texto "Horários disponíveis para...")
   ================================================================ */

.ma-selected-date-label {
  font-size: 16px;
  font-weight: 600;
  color: #1b2440;
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
}

/* ================================================================
   SLOTS GRID (Grid de horários)
   ================================================================ */

.ma-slots-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
}

.ma-slot-time {
  padding: 12px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  background-color: #f7f9fa;
  color: #1b2440;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
  font-family: 'Outfit', sans-serif;
}

.ma-slot-time.available {
  background-color: #f7f9fa;
  border-color: #b3e1e2;
  color: #1b2440;
}

.ma-slot-time.available:hover {
  background-color: #24bdc0;
  color: #ffffff;
  border-color: #24bdc0;
}

.ma-slot-time.available:focus {
  outline: none;
  background-color: #24bdc0;
  color: #ffffff;
  border-color: #24bdc0;
}

.ma-slot-time.unavailable,
.ma-slot-time:disabled {
  background-color: #f0f0f0;
  color: #adacac;
  border-color: #e0e0e0;
  cursor: not-allowed;
  opacity: 0.6;
  text-decoration: line-through;
}

/* ================================================================
   NO SLOTS MESSAGE
   ================================================================ */

.ma-no-slots {
  color: #6b7280;
  font-size: 14px;
  text-align: center;
  padding: 20px 0;
}

/* ================================================================
   LOAD MORE BUTTON
   ================================================================ */

.ma-load-more-container {
  display: flex;
  justify-content: center;
  padding: 16px 0 0 0;
  border-top: 1px solid #f0f0f0;
}

.ma-load-more-btn {
  padding: 12px 32px;
  border: 2px solid #24bdc0;
  border-radius: 8px;
  background-color: #ffffff;
  color: #24bdc0;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Outfit', sans-serif;
}

.ma-load-more-btn:hover {
  background-color: #24bdc0;
  color: #ffffff;
}

.ma-load-more-btn:focus {
  outline: none;
  background-color: #24bdc0;
  color: #ffffff;
}

/* ================================================================
   TABLET RESPONSIVIDADE (768px - 1099px)
   ================================================================ */

@media (min-width: 768px) and (max-width: 1099px) {
  #ma-booking-grid {
    padding: 16px;
  }

  .ma-calendar-header {
    gap: 16px;
  }

  .ma-month-year {
    font-size: 20px;
  }

  .ma-nav-arrow {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  .ma-days-list-container {
    gap: 10px;
  }

  .ma-day-button {
    min-width: 65px;
    width: 65px;
    height: 75px;
  }

  .ma-day-name {
    font-size: 11px;
  }

  .ma-day-number {
    font-size: 16px;
  }

  .ma-slots-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .ma-slot-time {
    padding: 10px 14px;
    font-size: 13px;
  }

  .ma-selected-date-label {
    font-size: 14px;
    padding: 10px 0;
  }
}

/* ================================================================
   MOBILE RESPONSIVIDADE (até 767px)
   ================================================================ */

@media (max-width: 767px) {
  #ma-booking-grid {
    padding: 12px;
    border-radius: 8px;
  }

  .ma-calendar-container {
    gap: 16px;
  }

  .ma-calendar-header {
    gap: 12px;
    padding: 12px 0;
  }

  .ma-month-year {
    font-size: 18px;
    min-width: 150px;
  }

  .ma-nav-arrow {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  .ma-days-list-container {
    gap: 8px;
    padding: 0 0 8px 0;
  }

  .ma-days-list {
    gap: 8px;
  }

  .ma-day-button {
    min-width: 60px;
    width: 60px;
    height: 70px;
    padding: 6px;
    gap: 3px;
    border-radius: 8px;
  }

  .ma-day-name {
    font-size: 10px;
  }

  .ma-day-number {
    font-size: 14px;
  }

  .ma-slots-container {
    gap: 12px;
    padding-top: 8px;
  }

  .ma-selected-date-label {
    font-size: 13px;
    padding: 8px 0;
  }

  .ma-slots-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .ma-slot-time {
    padding: 10px 12px;
    font-size: 12px;
    border-radius: 6px;
  }

  .ma-load-more-container {
    padding: 12px 0 0 0;
  }

  .ma-load-more-btn {
    padding: 10px 24px;
    font-size: 13px;
    border-radius: 6px;
  }

  .ma-no-slots {
    padding: 16px 0;
    font-size: 13px;
  }
}

/* ================================================================
   DESKTOP RESPONSIVIDADE (1100px+)
   ================================================================ */

@media (min-width: 1100px) {
  #ma-booking-grid {
    padding: 24px;
  }

  .ma-calendar-container {
    gap: 28px;
  }

  .ma-calendar-header {
    gap: 24px;
    padding: 20px 0;
  }

  .ma-month-year {
    font-size: 28px;
    min-width: 220px;
  }

  .ma-nav-arrow {
    width: 44px;
    height: 44px;
    font-size: 20px;
  }

  .ma-days-list-container {
    gap: 14px;
  }

  .ma-days-list {
    gap: 12px;
  }

  .ma-day-button {
    min-width: 75px;
    width: 75px;
    height: 85px;
    padding: 10px;
    gap: 5px;
  }

  .ma-day-name {
    font-size: 13px;
  }

  .ma-day-number {
    font-size: 20px;
  }

  .ma-slots-container {
    gap: 20px;
    padding-top: 16px;
  }

  .ma-selected-date-label {
    font-size: 18px;
    font-weight: 700;
    padding: 14px 0;
  }

  .ma-slots-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
  }

  .ma-slot-time {
    padding: 14px 18px;
    font-size: 15px;
    border-radius: 10px;
  }

  .ma-load-more-container {
    padding: 20px 0 0 0;
  }

  .ma-load-more-btn {
    padding: 14px 36px;
    font-size: 15px;
  }
}

#ma-booking-grid .ma-days-list-container {
  overflow: hidden !important;
}

#ma-booking-grid .ma-days-list {
  overflow: visible !important;
  overflow-x: hidden !important;
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
}

#ma-booking-grid .ma-day-button {
  min-width: 0 !important;
  width: 100%;
}

@media (max-width: 1099px) and (min-width: 768px) {
  #ma-booking-grid .ma-days-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  #ma-booking-grid .ma-days-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }
}