/* Calendar Status Messages */
.status-msg {
    font-size: 0.875rem;
    margin-top: 0.25rem;
    padding: 0.25rem 0;
    border-radius: 0.25rem;
    transition: all 0.3s ease;
}

.status-msg.info {
    color: #3b82f6;
    background-color: #eff6ff;
    border: 1px solid #dbeafe;
}

.status-msg.success {
    color: #059669;
    background-color: #ecfdf5;
    border: 1px solid #a7f3d0;
}

.status-msg.warning {
    color: #d97706;
    background-color: #fffbeb;
    border: 1px solid #fed7aa;
}

.status-msg.error {
    color: #dc2626;
    background-color: #fef2f2;
    border: 1px solid #fecaca;
}

.status-msg.loading {
    color: #7c3aed;
    background-color: #f3f4f6;
    border: 1px solid #e5e7eb;
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: .5;
    }
}

/* Calendar Input Styling */
.field-input:disabled {
    background-color: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Nights Dropdown Styling */
#nightsSelect {
    transition: all 0.3s ease;
}

#nightsSelect:disabled {
    background-color: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
    opacity: 0.6;
}

#nightsSelect.loading {
    background-color: #fef3c7;
    color: #92400e;
    border-color: #fbbf24;
}

#nightsSelect.loading option {
    color: #92400e;
}

#nightsSelect.error {
    background-color: #fef2f2;
    color: #dc2626;
    border-color: #f87171;
}

#nightsSelect.error option {
    color: #dc2626;
}

#nightsSelect:not(:disabled) {
    background-color: #ffffff;
    color: #374151;
    border-color: #d1d5db;
}

#nightsSelect:not(:disabled):hover {
    border-color: #9ca3af;
}

#nightsSelect:not(:disabled):focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Date Input Loading States */
#checkInFromInput.loading {
    background-color: #fef3c7;
    color: #92400e;
    border-color: #fbbf24;
    cursor: not-allowed;
}

#checkInFromInput.loading::placeholder {
    color: #92400e;
}

/* Date Input Error States */
#checkInFromInput.error {
    background-color: #fef2f2;
    color: #dc2626;
    border-color: #f87171;
    cursor: not-allowed;
}

#checkInFromInput.error::placeholder {
    color: #dc2626;
}

/* Destination Select Error States */
#destinationSelect.error {
    background-color: #fef2f2;
    color: #dc2626;
    border-color: #f87171;
    cursor: not-allowed;
}

#destinationSelect.error option {
    color: #dc2626;
}

/* Enhanced Calendar Styling */
.flatpickr-calendar {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
}

.flatpickr-day.flatpickr-enabled:hover {
    background-color: #f3f4f6;
}

.flatpickr-day.selected {
    background-color: #3b82f6;
    color: #ffffff;
}

.flatpickr-day.selected:hover {
    background-color: #2563eb;
}

/* Available dates styling */
.flatpickr-day.available {
    background-color: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
    position: relative;
}

.flatpickr-day.available:hover {
    background-color: #d1fae5;
    color: #047857;
}

/* First available date highlight */
.flatpickr-day.available:first-of-type {
    background-color: #dbeafe;
    color: #1d4ed8;
    border: 2px solid #3b82f6;
    font-weight: 600;
    position: relative;
}

.flatpickr-day.available:first-of-type::after {
    content: '★';
    position: absolute;
    top: -2px;
    right: -2px;
    font-size: 8px;
    color: #3b82f6;
    background: white;
    border-radius: 50%;
    width: 12px;
    height: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #3b82f6;
}

.flatpickr-day.available:first-of-type:hover {
    background-color: #bfdbfe;
    color: #1e40af;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

/* Enhanced available dates with offers count */
.flatpickr-day.available {
    background-color: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
    position: relative;
    transition: all 0.2s ease;
}

.flatpickr-day.available:hover {
    background-color: #d1fae5;
    color: #047857;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.3);
}

/* Unavailable dates styling */
.flatpickr-day.unavailable {
    color: #d1d5db;
    background-color: #f9fafb;
    cursor: not-allowed;
}

/* Calendar header styling */
.flatpickr-current-month {
    font-weight: 600;
    color: #1e293b;
    font-size: 1.1rem;
}

.flatpickr-monthDropdown-months {
    font-weight: 500;
}

/* Weekday headers */
.flatpickr-weekdays {
    background-color: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
}

.flatpickr-weekday {
    color: #64748b;
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.5rem 0;
}

/* Today's date styling */
.flatpickr-day.today {
    background-color: #3b82f6;
    color: white;
    border: 2px solid #1d4ed8;
    font-weight: 600;
}

.flatpickr-day.today:hover {
    background-color: #2563eb;
    border-color: #1e40af;
}

/* Selected date styling */
.flatpickr-day.selected {
    background-color: #059669;
    color: white;
    border: 2px solid #047857;
    font-weight: 600;
}

.flatpickr-day.selected:hover {
    background-color: #047857;
    border-color: #065f46;
}

/* Navigation arrows */
.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
    color: #6b7280;
}

.flatpickr-months .flatpickr-prev-month:hover,
.flatpickr-months .flatpickr-next-month:hover {
    color: #374151;
}

/* Loading animation for calendar */
.flatpickr-calendar.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 32px;
    height: 32px;
    margin: -16px 0 0 -16px;
    border: 3px solid #f3f4f6;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 10;
}

/* Smooth transitions for calendar elements */
.flatpickr-day {
    transition: all 0.2s ease;
}

.flatpickr-day:hover {
    transform: scale(1.05);
}

.flatpickr-day.available:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.3);
}

/* Responsive calendar */
@media (max-width: 768px) {
    .flatpickr-calendar {
        font-size: 14px;
        width: 280px;
        max-width: 90vw;
    }
    
    .flatpickr-day {
        height: 36px;
        line-height: 36px;
        font-size: 13px;
    }
    
    .flatpickr-months {
        padding: 0.5rem 0;
    }
    
    .flatpickr-current-month {
        font-size: 1rem;
    }
    
    .flatpickr-weekday {
        font-size: 0.75rem;
        padding: 0.375rem 0;
    }
}

@media (max-width: 480px) {
    .flatpickr-calendar {
        width: 260px;
        font-size: 13px;
    }
    
    .flatpickr-day {
        height: 32px;
        line-height: 32px;
        font-size: 12px;
    }
    
    .flatpickr-current-month {
        font-size: 0.9rem;
    }
    
    .flatpickr-weekday {
        font-size: 0.7rem;
        padding: 0.25rem 0;
    }
}

/* Accessibility improvements */
.flatpickr-day:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.flatpickr-day:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .flatpickr-day.available {
        background-color: #000;
        color: #fff;
        border: 2px solid #000;
    }
    
    .flatpickr-day.available:first-of-type {
        background-color: #000;
        color: #fff;
        border: 3px solid #000;
    }
    
    .flatpickr-day.selected {
        background-color: #000;
        color: #fff;
        border: 3px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .flatpickr-day {
        transition: none;
    }
    
    .flatpickr-day:hover {
        transform: none;
    }
    
    .flatpickr-day.available:hover {
        transform: none;
    }
    
    .flatpickr-day.available:first-of-type:hover {
        transform: none;
    }
}
