/**
 * Dynamic Scheduling Widget Styles
 */

/* Main container */
.bs-scheduling-widget {
    font-family: inherit;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
}

/* Loading state */
.scheduling-loading {
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Service cards */
.service-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid #dee2e6;
}

.service-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: #0d6efd;
}

.service-card .card-img-top {
    border-bottom: 1px solid #dee2e6;
}

/* Wizard styles */
.scheduling-wizard-container,
.scheduling-details-container {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Date selector */
.date-selector {
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.date-selector::-webkit-scrollbar {
    height: 6px;
}

.date-selector::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 3px;
}

.date-btn {
    min-width: 70px;
    padding: 8px 12px;
    text-align: center;
}

.date-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Time slots */
.slot-btn {
    min-width: 90px;
    font-weight: 500;
}

.slots-container {
    min-height: 60px;
}

/* Summary card */
.card.bg-light {
    position: sticky;
    top: 20px;
}

/* Confirmation */
.confirmation-container {
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.confirmation-container .bi-check-circle-fill {
    animation: pulse 0.5s ease;
}

@keyframes pulse {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Provider Cards */
.provider-cards-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.provider-card {
    border: 2px solid #dee2e6;
    border-radius: 10px;
    padding: 12px;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    flex: 0 0 calc(50% - 6px);
    max-width: calc(50% - 6px);
}

.provider-card:hover {
    border-color: #0d6efd;
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.15);
}

.provider-card.selected {
    border-color: #0d6efd;
    background-color: #f0f4ff;
    box-shadow: 0 0 0 1px #0d6efd;
}

.provider-card-body {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.provider-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
}

.provider-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.provider-avatar-placeholder {
    background: #d1d5db;
    color: #6b7280;
    font-size: 1.2rem;
}

.provider-initials {
    font-weight: 600;
    font-size: 0.875rem;
    color: #4b5563;
    text-transform: uppercase;
}

.provider-info {
    flex: 1;
    min-width: 0;
}

.provider-name {
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.3;
}

.provider-title {
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: 1px;
}

.provider-bio {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 4px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Location detail */
#locationDetail {
    font-size: 0.85rem;
}

/* Manage booking section */
#toggleManageBooking {
    font-size: 0.9rem;
    text-decoration: none;
}

#toggleManageBooking:hover {
    text-decoration: underline;
}

#manageBookingSection .form-control-sm {
    font-size: 0.875rem;
}

/* Form error */
.booking-form-error {
    animation: fadeIn 0.3s ease;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .bs-scheduling-widget {
        padding: 10px 0;
    }

    .date-btn {
        min-width: 60px;
        padding: 6px 8px;
        font-size: 0.875rem;
    }

    .slot-btn {
        min-width: 80px;
        font-size: 0.875rem;
    }

    .card.bg-light {
        position: static;
        margin-top: 20px;
    }

    .scheduling-header h3 {
        font-size: 1.5rem;
    }

    .provider-card {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* Provider selection dropdown */
#providerSelect {
    max-width: 400px;
}

/* Form styling */
#bookingForm .form-label {
    font-weight: 500;
}

#bookingForm .form-control:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

/* Booking type toggle */
.btn-group[role="group"] .btn-check:checked + .btn-outline-primary {
    background-color: #0d6efd;
    color: white;
}

/* Alert styling */
.scheduling-error {
    text-align: center;
    padding: 30px;
}

/* Price display */
.text-success.fw-bold {
    font-size: 1.1em;
}

/* Service card badges */
.service-card .badge {
    font-weight: 500;
}

/* Spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

/* Back button styling */
#backToServices,
#backToDateTime {
    color: #6c757d;
    text-decoration: none;
    font-size: 0.9rem;
}

#backToServices:hover,
#backToDateTime:hover {
    color: #0d6efd;
    text-decoration: none;
}

#backToServices .bi,
#backToDateTime .bi {
    margin-right: 4px;
}

/* Week navigation */
#weekDisplay {
    font-size: 1rem;
    min-width: 150px;
    text-align: center;
}

/* Confirmation code styling */
.confirmation-container code {
    background-color: #f8f9fa;
    padding: 4px 12px;
    border-radius: 4px;
    font-family: 'SFMono-Regular', Menlo, Monaco, Consolas, monospace;
    letter-spacing: 1px;
}
