/* Table Availability Checker Styles */

.availability-status {
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.availability-message {
    margin-bottom: 0;
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.availability-loading {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    color: #6c757d;
    font-size: 0.875rem;
    animation: pulse 1.5s ease-in-out infinite;
}

.availability-loading i {
    animation: spin 1s linear infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Custom alert styles for availability status */
.availability-message.alert-success {
    background-color: #d1edff;
    border-color: #bee5eb;
    color: #0c5460;
}

.availability-message.alert-danger {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.availability-message.alert-warning {
    background-color: #fff3cd;
    border-color: #ffecb5;
    color: #856404;
}

.availability-message.alert-info {
    background-color: #cce7ff;
    border-color: #b0d4f1;
    color: #004085;
}

/* Form enhancement */
.php-email-form input[type="date"]:focus,
.php-email-form input[type="number"]:focus,
.php-email-form select:focus {
    border-color: #ce1212;
    box-shadow: 0 0 0 0.2rem rgba(206, 18, 18, 0.25);
}

/* Chrome Date Picker Fixes */
.php-email-form input[type="date"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    font-family: inherit;
    color: #495057;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23666' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 0a.5.5 0 0 1 .5.5V1h8V.5a.5.5 0 0 1 1 0V1h1a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1V.5a.5.5 0 0 1 .5-.5zM1 4v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4H1z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px;
    padding-right: 2.5rem;
}

/* Chrome specific date picker enhancements */
.php-email-form input[type="date"]::-webkit-calendar-picker-indicator {
    opacity: 0;
    position: absolute;
    right: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.php-email-form input[type="date"]::-webkit-datetime-edit {
    padding: 0;
}

.php-email-form input[type="date"]::-webkit-datetime-edit-fields-wrapper {
    padding: 0;
}

.php-email-form input[type="date"]::-webkit-datetime-edit-text {
    color: #6c757d;
    padding: 0 0.2em;
}

.php-email-form input[type="date"]::-webkit-datetime-edit-month-field,
.php-email-form input[type="date"]::-webkit-datetime-edit-day-field,
.php-email-form input[type="date"]::-webkit-datetime-edit-year-field {
    color: #495057;
    padding: 0 0.1em;
}

/* Firefox date picker support */
.php-email-form input[type="date"]::-moz-focus-inner {
    border: 0;
    padding: 0;
}

/* Mobile date picker improvements */
@media (max-width: 768px) {
    .php-email-form input[type="date"] {
        font-size: 16px; /* Prevents zoom on iOS */
        min-height: 44px; /* iOS touch target minimum */
    }
}

/* Custom Time Picker Styling */
.time-picker-container {
    position: relative;
    width: 100%;
}

.time-picker-container .form-control {
    cursor: pointer;
    background-color: #fff;
    padding-right: 2.5rem;
}

.time-picker-container .form-control:focus {
    border-color: #ce1212;
    box-shadow: 0 0 0 0.2rem rgba(206, 18, 18, 0.25);
}

.time-arrow {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    pointer-events: none;
    transition: transform 0.2s ease;
}

.time-picker-container.open .time-arrow {
    transform: translateY(-50%) rotate(180deg);
}

.time-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid #ced4da;
    border-top: none;
    border-radius: 0 0 0.25rem 0.25rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.time-dropdown.show {
    display: block;
}

.time-option {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid rgba(248, 249, 250, 0.8);
    transition: all 0.15s ease;
    color: #212529;
    background-color: transparent;
}

.time-option:hover {
    background-color: rgba(206, 18, 18, 0.1);
    color: #ce1212;
}

.time-option:last-child {
    border-bottom: none;
}

.time-option.selected {
    background-color: #ce1212;
    color: #fff;
}

.time-option.selected:hover {
    background-color: #b10e0e;
    color: #fff;
}

/* Responsive adjustments for time picker */
@media (max-width: 768px) {
    .time-dropdown {
        max-height: 150px;
        position: fixed !important;
        z-index: 9999 !important;
        left: 1rem !important;
        right: 1rem !important;
        top: auto !important;
        bottom: 50% !important;
        transform: translateY(50%) !important;
        border-radius: 0.375rem !important;
        border: 1px solid #ced4da !important;
    }
    
    .time-dropdown.show {
        display: block;
        animation: slideInUp 0.3s ease-out;
    }
    
    .time-option {
        padding: 0.75rem 1rem;
        font-size: 1rem;
        border-bottom: 1px solid #dee2e6;
    }
    
    /* Mobile overlay for time picker */
    .time-dropdown::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.3);
        z-index: -1;
        pointer-events: none;
    }
    
    /* Close button for mobile */
    .time-dropdown::after {
        content: '×';
        position: absolute;
        top: 0.5rem;
        right: 1rem;
        font-size: 2rem;
        color: #6c757d;
        cursor: pointer;
        line-height: 1;
        z-index: 10;
    }
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(50%);
        opacity: 1;
    }
}

/* Submit button disabled state */
.php-email-form button[type="submit"]:disabled {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .availability-status {
        margin-top: 0.75rem;
        margin-bottom: 0.75rem;
    }
    
    .availability-message,
    .availability-loading {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
    
    /* Mobile select adjustments */
    .php-email-form select {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.5rem 2rem 0.5rem 0.75rem;
    }
}