/* Custom Delivery Calendar Styles */

/* Backdrop overlay */
.delivery-calendar-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1055;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.delivery-calendar-backdrop.show {
  opacity: 1;
}

/* Calendar modal container */
.delivery-calendar {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(255, 111, 155, 0.15);
  padding: 20px;
  width: 420px;
  font-family: 'Poppins', sans-serif;
}

.delivery-calendar-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  z-index: 1060;
  opacity: 0;
  transition: all 0.3s ease;
}

.delivery-calendar-modal.show {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding: 8px;
  background: linear-gradient(135deg, #ff99bb 0%, #ff6f9b 100%);
  border-radius: 8px;
}

.calendar-month-year {
  color: white;
  font-weight: 600;
  font-size: 16px;
}

.calendar-nav-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.calendar-nav-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 8px;
  background: #fff6f9;
  padding: 8px 4px;
  border-radius: 6px;
}

.calendar-weekdays > div {
  text-align: center;
  color: #ff6f9b;
  font-weight: 600;
  font-size: 12px;
}

.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  cursor: pointer;
  position: relative;
  font-size: 16px;
  transition: all 0.2s ease;
  border: 2px solid transparent;
  min-height: 50px;
}

.calendar-day:not(.disabled):not(.prev-month):not(.next-month):hover {
  background: #ffe6f0;
  border-color: #ffcce0;
  transform: scale(1.05);
}

.calendar-day.prev-month,
.calendar-day.next-month {
  color: #ccc;
  cursor: default;
}

.calendar-day.disabled {
  color: #ddd;
  cursor: not-allowed;
  text-decoration: line-through;
}

.calendar-day.today {
  border-color: #ff6f9b;
  font-weight: bold;
  color: #ff6f9b;
}

.calendar-day.selected {
  background: #ff6f9b;
  color: white;
  font-weight: bold;
  box-shadow: 0 2px 8px rgba(255, 111, 155, 0.3);
}

.calendar-day.has-orders {
  font-weight: 600;
}

.calendar-day.rush-date:not(.disabled) {
  background: #fff8e6;
  border-color: #ffd966;
}

.calendar-day.rush-date.selected {
  background: #ff6f9b;
  border-color: #ff6f9b;
}

.calendar-day .day-number {
  position: relative;
  z-index: 1;
  font-weight: 600;
}

.calendar-day .order-count {
  position: absolute;
  bottom: 3px;
  right: 3px;
  background: #ff6f9b;
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  z-index: 2;
}

.calendar-day.selected .order-count {
  background: white;
  color: #ff6f9b;
}

.calendar-day .rush-indicator {
  position: absolute;
  top: 3px;
  left: 3px;
  color: #ffa726;
  font-size: 10px;
  z-index: 2;
}

.calendar-day.selected .rush-indicator {
  color: #fff3e0;
}

.calendar-day .full-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(220, 53, 69, 0.9);
  color: white;
  font-size: 8px;
  font-weight: bold;
  padding: 2px 4px;
  border-radius: 3px;
  z-index: 3;
  white-space: nowrap;
  pointer-events: none;
}

.calendar-day.disabled .full-indicator {
  background: rgba(220, 53, 69, 0.7);
}

.calendar-footer {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-top: 1px solid #f0f0f0;
  margin-top: 12px;
}

.calendar-btn {
  flex: 1;
  padding: 8px 16px;
  border: 1px solid #ff6f9b;
  background: white;
  color: #ff6f9b;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.calendar-btn:hover {
  background: #ff6f9b;
  color: white;
}

.calendar-btn-today {
  background: #ff6f9b;
  color: white;
}

.calendar-btn-today:hover {
  background: #ff5587;
}

.calendar-legend {
  display: flex;
  gap: 12px;
  padding: 8px;
  background: #fff9fc;
  border-radius: 6px;
  margin-top: 8px;
  font-size: 11px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.legend-icon {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.legend-icon.has-orders-icon {
  background: #ff6f9b;
  color: white;
  font-weight: bold;
}

.legend-icon.has-orders-icon::after {
  content: '3';
  font-size: 9px;
  color: white;
}

.legend-icon.rush-icon {
  background: #fff8e6;
  color: #ffa726;
  font-size: 10px;
  border: 1px solid #ffd966;
}

.legend-text {
  color: #666;
  font-size: 11px;
}

/* Responsive adjustments */
@media (max-width: 576px) {
  .delivery-calendar {
    width: calc(100vw - 32px);
    max-width: 100%;
    padding: 16px;
    border-radius: 8px;
  }
  
  .delivery-calendar-modal {
    width: calc(100vw - 32px);
    max-width: 100%;
  }
  
  .calendar-header {
    padding: 6px;
    margin-bottom: 12px;
  }
  
  .calendar-month-year {
    font-size: 14px;
  }
  
  .calendar-nav-btn {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }
  
  .calendar-weekdays {
    padding: 6px 4px;
    gap: 2px;
  }
  
  .calendar-weekdays > div {
    font-size: 11px;
  }
  
  .calendar-days {
    gap: 4px;
  }
  
  .calendar-day {
    min-height: 42px;
    font-size: 14px;
    border-radius: 6px;
  }
  
  .calendar-day .day-number {
    font-size: 14px;
  }
  
  .calendar-day .order-count {
    width: 18px;
    height: 18px;
    font-size: 9px;
    bottom: 2px;
    right: 2px;
  }
  
  .calendar-day .rush-indicator {
    font-size: 9px;
    top: 2px;
    left: 2px;
  }
  
  .calendar-footer {
    padding: 6px 0;
    gap: 6px;
  }
  
  .calendar-btn {
    padding: 6px 12px;
    font-size: 12px;
  }
  
  .calendar-legend {
    padding: 8px;
    gap: 8px;
  }
  
  .legend-icon {
    width: 14px;
    height: 14px;
  }
  
  .legend-text {
    font-size: 10px;
  }
}

@media (max-width: 400px) {
  .delivery-calendar {
    width: calc(100vw - 24px);
    padding: 12px;
  }
  
  .delivery-calendar-modal {
    width: calc(100vw - 24px);
  }
  
  .calendar-header {
    padding: 4px;
    margin-bottom: 10px;
  }
  
  .calendar-month-year {
    font-size: 13px;
  }
  
  .calendar-nav-btn {
    width: 26px;
    height: 26px;
    font-size: 11px;
  }
  
  .calendar-weekdays {
    padding: 4px 2px;
  }
  
  .calendar-weekdays > div {
    font-size: 10px;
  }
  
  .calendar-days {
    gap: 3px;
  }
  
  .calendar-day {
    min-height: 38px;
    font-size: 13px;
    border-radius: 4px;
  }
  
  .calendar-day .day-number {
    font-size: 13px;
  }
  
  .calendar-day .order-count {
    width: 16px;
    height: 16px;
    font-size: 8px;
  }
  
  .calendar-day .rush-indicator {
    font-size: 8px;
  }
  
  .calendar-footer {
    padding: 4px 0;
    gap: 4px;
  }
  
  .calendar-btn {
    padding: 5px 10px;
    font-size: 11px;
  }
  
  .calendar-legend {
    padding: 6px;
    gap: 6px;
  }
  
  .legend-icon {
    width: 12px;
    height: 12px;
    font-size: 8px;
  }
  
  .legend-text {
    font-size: 9px;
  }
}
