/* ================================================================= */
/* ============ EQUINOTEC PROFESSIONAL WEEK CALENDAR ============= */
/* ================================================================= */

/* Esconder calendários existentes */
.ui-datepicker, 
.hasDatepicker, 
.flatpickr-calendar,
input[name="delivery_date"],
input[name="previsao_de_entrega"] {
  display: none !important;
}

/* ===== CONTAINER PRINCIPAL ===== */
.equi-professional-calendar {
  background: linear-gradient(135deg, #122449 0%, #1c5fa8 100%);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(18, 36, 73, 0.4);
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  max-width: 380px; /* LIGEIRAMENTE MENOR: era 480px */
  margin: 20px 0;
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: none; /* Escondido por padrão, mostrado pelo checkbox */
}
input[name="previsao_de_entrega"] {
  display: none !important;
}

/* ===== CONTAINER PRINCIPAL ===== */
.equi-professional-calendar {
  background: linear-gradient(135deg, #122449 0%, #1c5fa8 100%);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(18, 36, 73, 0.4);
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  max-width: 380px;
  margin: 20px 0;
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: none; /* Escondido por padrão, mostrado pelo checkbox */
}

.equi-cal-wrapper {
  padding: 0;
}

/* ===== HEADER ===== */
.equi-cal-header {
  background: #122449; /* Azul escuro sólido */
  padding: 16px; /* LIGEIRAMENTE MENOR: era 20px */
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.equi-cal-title h4 {
  margin: 0 0 8px 0;
  color: white; /* Letras brancas */
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.5px;
}

.equi-cal-subtitle {
  margin: 0 0 12px 0;
  color: rgba(255, 255, 255, 0.9); /* Letras brancas */
  font-size: 14px;
  font-weight: 400;
}

.equi-cal-info {
  margin: 0;
}

.equi-min-week {
  display: inline-block;
  background: rgba(255, 255, 255, 0.2);
  padding: 6px 12px;
  border-radius: 20px;
  color: white; /* Letras brancas */
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.3px;
}

/* ===== NAVEGAÇÃO ===== */
.equi-cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px; /* LIGEIRAMENTE MENOR: era 16px 20px */
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.equi-nav-btn {
  background: #1c5fa8; /* Azul médio para botões */
  border: 1px solid #1c5fa8;
  border-radius: 8px;
  color: white;
  font-size: 16px; /* LIGEIRAMENTE MENOR: era 18px */
  font-weight: 600;
  width: 32px; /* LIGEIRAMENTE MENOR: era 36px */
  height: 32px; /* LIGEIRAMENTE MENOR: era 36px */
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.equi-nav-btn:hover {
  background: #0f4a8a; /* Azul mais escuro ao hover */
  border-color: #0f4a8a;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(28, 95, 168, 0.4);
}

.equi-month-year {
  color: white;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.3px;
}

/* ===== CONTAINER DO CALENDÁRIO ===== */
.equi-cal-container {
  padding: 0;
}

.equi-cal-grid {
  background: transparent;
}

/* ===== HEADER DOS DIAS ===== */
.equi-cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: #122449; /* Azul escuro */
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.equi-weekday {
  padding: 12px 8px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8); /* Letras brancas */
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ===== SEMANAS (LINHAS) ===== */
.equi-cal-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  cursor: pointer;
  transition: all 0.15s ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.equi-cal-week:hover:not(.equi-week-selected) {
  background: rgba(28, 95, 168, 0.2); /* Azul médio para hover */
  transform: scale(1.005);
}

.equi-cal-week.equi-week-hover:not(.equi-week-selected) {
  background: rgba(28, 95, 168, 0.3); /* Azul médio */
  box-shadow: inset 0 0 0 1px rgba(28, 95, 168, 0.5);
}

.equi-cal-week.equi-week-selected {
  background: #1c5fa8; /* Azul médio para seleção */
  box-shadow: inset 0 0 0 2px #1c5fa8;
  transform: scale(1.01);
}

.equi-cal-week:last-child {
  border-bottom: none;
}

/* ===== DIAS INDIVIDUAIS ===== */
.equi-cal-day {
  padding: 14px 6px; /* LIGEIRAMENTE MENOR: era 16px 8px */
  text-align: center;
  position: relative;
  transition: all 0.15s ease;
}

.equi-day-number {
  display: block;
  font-size: 15px; /* LIGEIRAMENTE MENOR: era 16px */
  font-weight: 500;
  color: white;
  line-height: 1;
}

.equi-cal-day.equi-other-month .equi-day-number {
  color: rgba(255, 255, 255, 0.3);
}

.equi-cal-day.equi-disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.equi-cal-day.equi-disabled .equi-day-number {
  color: rgba(255, 255, 255, 0.2);
}

.equi-cal-day.equi-selected .equi-day-number {
  color: white;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

/* ===== ESTADOS DE HOVER ===== */
.equi-cal-week.equi-week-hover .equi-cal-day:not(.equi-disabled) .equi-day-number {
  color: white;
  font-weight: 600;
  transform: scale(1.1);
}

.equi-cal-week.equi-week-selected .equi-cal-day .equi-day-number {
  color: white;
  font-weight: 600;
}

/* ===== FEEDBACK DE SELEÇÃO ===== */
.equi-calendar-feedback {
  position: fixed;
  top: 20px;
  right: 20px;
  background: linear-gradient(135deg, #4caf50 0%, #43a047 100%);
  color: white;
  padding: 16px 24px;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  font-size: 14px;
  font-weight: 600;
  z-index: 10001;
  animation: slideInFade 0.4s ease;
  max-width: 400px;
  text-align: center;
  line-height: 1.5;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.equi-calendar-feedback.error {
  background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
}

@keyframes slideInFade {
  from {
    opacity: 0;
    transform: translateX(100%) translateY(-10px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateX(0) translateY(0) scale(1);
  }
}

/* ===== TOOLTIPS ===== */
.equi-cal-day[title]:hover::after {
  content: attr(title);
  position: absolute;
  bottom: -40px;
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a1a;
  color: white;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  white-space: nowrap;
  z-index: 1000;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.equi-cal-day[title]:hover::before {
  content: '';
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-bottom-color: #1a1a1a;
  z-index: 1001;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .equi-professional-calendar {
    max-width: 100%;
    margin: 16px 0;
    border-radius: 12px;
  }
  
  .equi-cal-header {
    padding: 16px;
  }
  
  .equi-cal-title h4 {
    font-size: 16px;
  }
  
  .equi-cal-subtitle {
    font-size: 13px;
  }
  
  .equi-cal-nav {
    padding: 12px 16px;
  }
  
  .equi-nav-btn {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }
  
  .equi-month-year {
    font-size: 14px;
  }
  
  .equi-weekday {
    padding: 10px 4px;
    font-size: 11px;
  }
  
  .equi-cal-day {
    padding: 12px 4px;
  }
  
  .equi-day-number {
    font-size: 14px;
  }
  
  .equi-cal-day.equi-selected .equi-day-number {
    width: 28px;
    height: 28px;
    border-radius: 6px;
  }
  
  .equi-calendar-feedback {
    top: 10px;
    right: 10px;
    left: 10px;
    max-width: none;
    font-size: 13px;
    padding: 12px 18px;
  }
}

/* ===== ANIMAÇÕES SUAVES ===== */
@media (prefers-reduced-motion: no-preference) {
  .equi-cal-week {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  .equi-cal-day {
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  .equi-day-number {
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  .equi-nav-btn {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  }
}

/* ===== ACESSIBILIDADE ===== */
@media (prefers-contrast: high) {
  .equi-professional-calendar {
    border: 2px solid white;
  }
  
  .equi-cal-week.equi-week-selected {
    box-shadow: inset 0 0 0 3px white;
  }
  
  .equi-nav-btn {
    border: 2px solid #1c5fa8;
  }
}

/* ===== FOCUS STATES ===== */
.equi-nav-btn:focus {
  outline: 2px solid rgba(28, 95, 168, 0.5);
  outline-offset: 2px;
}

.equi-cal-week:focus {
  outline: 2px solid rgba(28, 95, 168, 0.5);
  outline-offset: -2px;
}