/**
 * Booking Wizard Availability Integration Styles
 * Styles for availability checking and slot selection UI
 */

/* ============================================================================
   AVAILABILITY STATUS INDICATOR
   ============================================================================ */

.availability-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: 6px;
    margin-top: 1rem;
    margin-bottom: 1rem;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
}

.status-indicator {
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
}

.status-indicator.available {
    color: #10b981;
}

.status-indicator.unavailable {
    color: #ef4444;
}

.status-indicator.checking {
    color: #3b82f6;
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.status-message {
    font-size: 0.875rem;
    font-weight: 500;
    flex: 1;
}

.status-message.success {
    color: #059669;
}

.status-message.error {
    color: #dc2626;
}

.status-message.info {
    color: #2563eb;
}

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

/* ============================================================================
   CHECKBOX STYLING
   ============================================================================ */

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
    padding: 0.5rem 0;
}

.form-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #3b82f6;
}

.checkbox-text {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: var(--color-text-primary);
}

.checkbox-text i {
    color: #3b82f6;
}

/* ============================================================================
   AVAILABLE SLOTS PICKER
   ============================================================================ */

.available-slots-picker {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: var(--color-surface-subtle);
    border-radius: 8px;
    border: 1px solid var(--color-border);
}

.available-slots-picker h4 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.available-slots-picker h4 i {
    color: #3b82f6;
}

/* ============================================================================
   SLOTS CALENDAR GRID
   ============================================================================ */

.slots-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.75rem;
}

@media (max-width: 1200px) {
    .slots-calendar-grid {
        gap: 0.5rem;
    }
}

@media (max-width: 768px) {
    .slots-calendar-grid {
        grid-template-columns: repeat(7, 1fr);
        gap: 0.25rem;
    }
}

/* ============================================================================
   CALENDAR DAY CARDS
   ============================================================================ */

.calendar-day {
    background: var(--color-surface);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--color-border);
    transition: all 0.2s ease;
}

.calendar-day:hover {
    border-color: #3b82f6;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}

.day-header {
    padding: 1rem 0.75rem;
    background: var(--color-surface);
    border-bottom: 2px solid #e5e7eb;
    text-align: center;
}

.day-full-date {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.25rem;
    color: var(--color-text-primary);
}

.day-year {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-text-secondary);
}

/* ============================================================================
   WEEKEND DAYS STYLING
   ============================================================================ */

.calendar-day.weekend-day {
    opacity: 0.65;
    background: var(--color-surface-subtle);
}

.calendar-day.weekend-day .day-header {
    background: #f3f4f6;
    border-bottom: 2px solid #d1d5db;
}

.calendar-day.weekend-day .day-full-date {
    color: var(--color-text-secondary);
}

.calendar-day.weekend-day .day-year {
    color: #9ca3af;
}

.calendar-day.weekend-day:hover {
    opacity: 0.75;
    border-color: #9ca3af;
}

.calendar-day.no-slots-day {
    opacity: 0.5;
}

.calendar-day.no-slots-day:hover {
    border-color: #e5e7eb;
    box-shadow: none;
}

/* ============================================================================
   DAY SLOTS
   ============================================================================ */

.day-slots {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
}

.day-slots::-webkit-scrollbar {
    width: 6px;
}

.day-slots::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.day-slots::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.day-slots::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ============================================================================
   SLOT BUTTONS
   ============================================================================ */

.slot-button {
    padding: 0.5rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.slot-button:hover {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

.slot-button:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(59, 130, 246, 0.2);
}

.slot-button.selected {
    background: #3b82f6;
    color: white;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.slot-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f3f4f6;
    color: #9ca3af;
}

.slot-button:disabled:hover {
    transform: none;
    box-shadow: none;
    background: #f3f4f6;
    color: #9ca3af;
}

/* ============================================================================
   NO SLOTS MESSAGE (within day cards)
   ============================================================================ */

.no-slots-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 0.5rem;
    color: #9ca3af;
    text-align: center;
    font-size: 0.8125rem;
    gap: 0.5rem;
}

.no-slots-message i {
    font-size: 1.5rem;
    color: #d1d5db;
}

.no-slots-message span {
    font-weight: 500;
}

/* ============================================================================
   EMPTY STATES
   ============================================================================ */

.no-slots {
    text-align: center;
    color: var(--color-text-secondary);
    font-size: 0.875rem;
    padding: 2rem;
    background: var(--color-surface);
    border-radius: 6px;
    border: 1px dashed var(--color-border);
}

.no-slots i {
    display: block;
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: #9ca3af;
}

.loading-slots {
    text-align: center;
    color: var(--color-text-secondary);
    font-size: 0.875rem;
    padding: 2rem;
}

.loading-slots i {
    display: block;
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: #3b82f6;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* ============================================================================
   AVAILABILITY CONFLICTS
   ============================================================================ */

.availability-conflicts {
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
}

.conflicts-header {
    font-size: 0.875rem;
    font-weight: 600;
    color: #dc2626;
    margin-bottom: 0.5rem;
}

.conflicts-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.conflicts-list li {
    font-size: 0.8125rem;
    color: #991b1b;
    padding: 0.25rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.conflicts-list li i {
    color: #ef4444;
    font-size: 0.75rem;
}

/* ============================================================================
   ALTERNATIVE SUGGESTIONS
   ============================================================================ */

.alternative-suggestions {
    margin-top: 1rem;
    padding: 0.75rem;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
}

.suggestions-header {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1e40af;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.suggestions-header i {
    color: #3b82f6;
}

.suggestions-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.suggestion-slot {
    padding: 0.5rem;
    background: var(--color-surface);
    border: 1px solid #93c5fd;
    border-radius: 4px;
    font-size: 0.875rem;
    color: #1e3a8a;
    cursor: pointer;
    transition: all 0.2s ease;
}

.suggestion-slot:hover {
    background: #dbeafe;
    border-color: #3b82f6;
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

@media (max-width: 1024px) {
    .available-slots-picker {
        padding: 1rem;
    }
    
    .day-header {
        padding: 0.75rem 0.5rem;
    }
    
    .day-full-date {
        font-size: 0.75rem;
    }
    
    .day-year {
        font-size: 0.65rem;
    }
}

@media (max-width: 640px) {
    .availability-status {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .available-slots-picker {
        padding: 0.75rem;
    }
    
    .day-header {
        padding: 0.5rem 0.25rem;
    }
    
    .day-full-date {
        font-size: 0.625rem;
        line-height: 1.2;
    }
    
    .day-year {
        font-size: 0.5rem;
    }
    
    .day-slots {
        padding: 0.5rem;
        max-height: 200px;
    }
    
    .slot-button {
        font-size: 0.75rem;
        padding: 0.375rem 0.25rem;
    }
}

/* ============================================================================
   WIZARD CALENDAR - ISOLATED BEM STYLES (Calendly-style)
   ============================================================================ */

/* Main Container - Side by side layout, expands to fill width */
.wizard-calendar {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 32px;
    align-items: flex-start;
    width: 100%;
}

/* Calendar Widget (left side) - fixed width square calendar */
.wizard-calendar__widget {
    width: 320px;
    flex-shrink: 0;
    background: transparent;
}

/* Calendar Header with Navigation */
.wizard-calendar__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 0;
}

.wizard-calendar__month {
    font-size: 18px;
    font-weight: 700;
    color: #111;
    flex: 1;
    text-align: center;
}

.wizard-calendar__nav {
    background: transparent;
    border: 1px solid #ddd;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    color: #666;
    border-radius: 50%;
    transition: all 0.15s ease;
}

.wizard-calendar__nav:hover {
    border-color: #1E3A5F;
    color: #1E3A5F;
}

/* Weekdays Row */
.wizard-calendar__weekdays {
    display: grid;
    grid-template-columns: repeat(7, 40px);
    gap: 4px;
    margin-bottom: 8px;
    justify-content: center;
}

.wizard-calendar__weekday {
    text-align: center;
    font-weight: 600;
    font-size: 11px;
    color: #888;
    padding: 8px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Calendar Grid */
.wizard-calendar__grid {
    display: grid;
    grid-template-columns: repeat(7, 40px);
    gap: 4px;
    justify-content: center;
}

/* Calendar Day Cells */
.wizard-calendar__day {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 500;
    font-size: 14px;
    cursor: default;
    color: var(--color-text-primary);
    background: transparent;
    border: 2px solid transparent;
    transition: all 0.15s ease;
}

.wizard-calendar__day--other-month {
    visibility: hidden;
}

.wizard-calendar__day--past {
    color: #ccc;
    cursor: default;
}

.wizard-calendar__day--today {
    border-color: #1E3A5F;
    font-weight: 700;
}

.wizard-calendar__day--available {
    cursor: pointer;
}

.wizard-calendar__day--available:hover {
    background: #fdf2f8;
}

.wizard-calendar__day--selected {
    background: #1E3A5F;
    color: white;
    border-color: #1E3A5F;
}

.wizard-calendar__day--unavailable {
    color: #ddd;
    cursor: default;
}

/* Calendar grid skeleton (shown before availability data loads) */
.wizard-calendar__grid--skeleton .wizard-calendar__day-skeleton {
    aspect-ratio: 1;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--color-border-light) 0%, var(--color-border) 50%, var(--color-border-light) 100%);
    background-size: 200% 100%;
    animation: wizard-calendar-skeleton-shimmer 1.4s ease-in-out infinite;
}

@keyframes wizard-calendar-skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Time Slots Container (right side) - fills remaining space */
.wizard-calendar__slots {
    flex: 1;
    min-width: 200px;
    padding: 0;
}

/* "Choose a date" CTA placeholder shown until user picks a date */
.wizard-calendar__slots-cta {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 240px;
    padding: 32px 16px;
    text-align: center;
    color: #6c757d;
    background: var(--color-surface-subtle);
    border: 1px dashed var(--color-border);
    border-radius: 8px;
}

.wizard-calendar__slots-cta i {
    font-size: 32px;
    color: #1E3A5F;
    margin-bottom: 12px;
    opacity: 0.6;
}

.wizard-calendar__slots-cta p {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    max-width: 240px;
}

.wizard-calendar__slots-title {
    margin: 0 0 16px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-primary);
}

/* Responsive grid of time slots - fills available space */
.wizard-calendar__slots-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 8px;
    align-content: start;
}

/* Time Slot Buttons */
.wizard-calendar__slot {
    width: 100%;
    height: 44px;
    padding: 0 8px;
    background: var(--color-surface);
    border: 2px solid #1E3A5F;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #1E3A5F;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.wizard-calendar__slot:hover {
    background: #1E3A5F;
    color: white;
}

.wizard-calendar__slot--active {
    background: #1E3A5F;
    color: white;
    box-shadow: 0 0 0 3px rgba(226, 13, 193, 0.2);
}

.wizard-calendar__slot--booked {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fecaca;
    cursor: not-allowed;
    opacity: 0.75;
}

.wizard-calendar__slot--booked:hover {
    background: #fee2e2;
    color: #991b1b;
}

.wizard-calendar__slot--past {
    background: #f6f8fa;
    color: #d0d7de;
    border-color: #e8e8e8;
    cursor: not-allowed;
    text-decoration: line-through;
    opacity: 0.6;
}

.wizard-calendar__slot--past:hover {
    background: #f6f8fa;
    color: #d0d7de;
    transform: none;
    box-shadow: none;
}

.wizard-calendar__slot-label {
    font-size: 8px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1;
    color: #dc2626;
}

/* Responsive - Stack on mobile */
@media (max-width: 600px) {
    .wizard-calendar {
        flex-direction: column;
        max-width: 100%;
    }

    .wizard-calendar__widget {
        flex: none;
        width: 100%;
    }

    .wizard-calendar__slots {
        width: 100%;
        min-width: unset;
        margin-top: 24px;
    }

    .wizard-calendar__slots-list {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
}

/* ============================================================================
   LEGACY TIME SLOTS (for other contexts if needed)
   ============================================================================ */

.time-slots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.5rem;
}

/* ============================================================================
   SELECTED DATETIME DISPLAY
   ============================================================================ */

/* Selected datetime display - compact card inside slots area */
#selected-datetime-display {
    grid-column: 1 / -1; /* Span full width when inside grid */
}

.selected-datetime-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #1E3A5F 0%, #2A4F7A 100%);
    border-radius: 8px;
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(253, 125, 1, 0.2);
}

.selected-datetime-card i {
    font-size: 1.25rem;
    opacity: 0.9;
}

.selected-datetime-card span {
    flex: 1;
}

/* ============================================================================
   DARK MODE SUPPORT (if needed in future)
   ============================================================================ */

@media (prefers-color-scheme: dark) {
    .available-slots-picker {
        background: #1f2937;
        border-color: var(--color-text-primary);
    }

    .available-slots-picker h4 {
        color: #f9fafb;
    }

    .slot-button {
        background: #1f2937;
        border-color: #4b5563;
        color: #e5e7eb;
    }

    .no-slots {
        background: #111827;
        border-color: var(--color-text-primary);
        color: #9ca3af;
    }

    /* Wizard Calendar Dark Mode */
    .wizard-calendar__day {
        color: #e5e7eb;
    }

    .wizard-calendar__slot {
        background: #1f2937;
        border-color: #1E3A5F;
        color: #1E3A5F;
    }

    .wizard-calendar__slot:hover {
        background: #1E3A5F;
        color: white;
    }
}
