/* =====================================================
   TIME SLOTS COMPONENT - External CSS
   File: /home/ittz/site/css/time-slots.css
   Purpose: CLAUDE.md compliance - no inline styles in JS
   Mobile-first: 344px baseline
   WCAG 2.1 AAA compliant
   Extracted from: booking-calendar.js inline styles
   ===================================================== */

/* ===========================================
   TIME SLOTS CONTAINER
   Original: booking-calendar.js lines 351-357
   =========================================== */
#time-slots-container {
    margin-top: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    border: 2px solid #cbd5e0;
    border-radius: 12px;
}

/* Mobile-first: 344px viewport */
@media (max-width: 374px) {
    #time-slots-container {
        margin-top: 1.5rem;
        padding: 1rem;
        border-radius: 8px;
    }
}

/* ===========================================
   TIME SLOT HEADER
   Original: booking-calendar.js lines 414-426
   =========================================== */
.time-slots-header {
    text-align: center;
    margin-bottom: 1rem;
}

.time-slots-header h4 {
    color: var(--sage-700, #5a685a);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

@media (max-width: 374px) {
    .time-slots-header h4 {
        font-size: 1rem;
    }
}

/* ===========================================
   TIME SLOTS GRID
   Original: booking-calendar.js line 427
   =========================================== */
.time-slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;  /* 16px = 2 × 8pt grid - better breathing room */
}

@media (max-width: 480px) {
    .time-slots-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 0.75rem;  /* 12px = 1.5 × 8pt grid */
    }
}

@media (max-width: 374px) {
    .time-slots-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;  /* 8px = 1 × 8pt grid (8pt compliant) */
    }
}

/* ===========================================
   TIME SLOT BUTTONS - Base State
   Original: booking-calendar.js lines 431-441
   WCAG 2.1 AAA: 44px minimum touch target
   =========================================== */
.time-slot-btn {
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    /* Optimized transitions - GPU accelerated */
    transition: background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
    color: var(--sage-700, #5a685a);

    /* WCAG 2.1 AAA: Touch target */
    min-height: 44px;
    min-width: 44px;

    /* Remove default button styles */
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

/* Hover state - brand sage green accent */
.time-slot-btn:hover:not(.time-slot-selected) {
    background: rgba(138, 167, 123, 0.08);  /* Subtle sage tint */
    border-color: #8aa77b;  /* Brand sage green */
    transform: scale(1.02);  /* Subtle lift for interactivity */
}

/* Focus state - WCAG 2.1 AAA visible focus with brand colors */
.time-slot-btn:focus-visible {
    box-shadow: 0 0 0 3px rgba(138, 167, 123, 0.3);  /* Sage green ring */
    outline: 3px solid #8aa77b;
    outline-offset: 2px;
}

/* ===========================================
   TIME SLOT BUTTONS - Selected State
   Matches calendar selected date styling
   Sky blue border with warm orange glow
   =========================================== */
.time-slot-selected,
.time-slot-btn.time-slot-selected {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #d97706 100%);  /* Gold gradient (matches calendar hover) */
    color: #0c4a6e;  /* Dark blue text (matches calendar selected) */
    border: 2px solid #0284c7;  /* Sky blue border (matches calendar selected) */
    border-radius: 6px;
    transform: translateY(-3px) scale(1.05);  /* Lift + emphasis (matches calendar) */
    box-shadow: 0 8px 25px rgba(217, 119, 6, 0.5),  /* Orange glow (matches calendar) */
                0 4px 12px rgba(0, 0, 0, 0.25);     /* Dark shadow (matches calendar) */
    font-weight: 600;  /* Bolder text for "locked in" feel */
}

.time-slot-selected:hover,
.time-slot-btn.time-slot-selected:hover {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 50%, #b45309 100%);  /* Darker gold on hover */
    border-color: #0369a1;  /* Darker sky blue */
    box-shadow: 0 12px 30px rgba(217, 119, 6, 0.6),  /* Enhanced orange glow */
                0 6px 16px rgba(0, 0, 0, 0.3);       /* Enhanced shadow */
    transform: translateY(-4px) scale(1.06);  /* More lift on hover */
}

/* ===========================================
   TIME SLOT BUTTONS - Mobile Optimizations
   =========================================== */
@media (max-width: 480px) {
    .time-slot-btn {
        padding: 0.6rem 0.75rem;
        font-size: 0.85rem;
        border-radius: 6px;
    }
}

@media (max-width: 374px) {
    .time-slot-btn {
        padding: 0.5rem;
        font-size: 0.8rem;
        min-height: 44px; /* Maintain touch target */
    }
}

/* ===========================================
   LOADING STATE
   Original: booking-calendar.js lines 1121-1134
   =========================================== */
.time-slots-loading {
    text-align: center;
    padding: 2rem;
}

.time-slots-loading .spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid #e2e8f0;
    border-top: 3px solid var(--sage-600, #8aa77b);
    border-radius: 50%;
    animation: time-slots-spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes time-slots-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.time-slots-loading p {
    color: var(--sage-600, #8aa77b);
    font-weight: 500;
    margin: 0;
}

/* ===========================================
   ERROR STATE
   Original: booking-calendar.js lines 1136-1147
   =========================================== */
.time-slots-error {
    text-align: center;
    padding: 2rem;
}

.time-slots-error p {
    color: var(--sage-600, #8aa77b);
    margin: 0 0 1rem 0;
}

.time-slots-error .error-subtitle {
    color: var(--sage-500, #a3b899);
    font-size: 0.9rem;
}

.time-slots-error .retry-btn {
    padding: 0.5rem 1rem;
    background: var(--sage-600, #8aa77b);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    min-height: 44px;
    min-width: 44px;
    transition: background 0.2s ease;
}

.time-slots-error .retry-btn:hover {
    background: var(--sage-700, #5a685a);
}

.time-slots-error .retry-btn:focus {
    box-shadow: 0 0 0 3px rgba(138, 167, 123, 0.4);
    outline: 2px solid transparent;
}

/* ===========================================
   NO TIMES AVAILABLE CONTAINER
   Original: booking-calendar.js lines 530-651
   Note: styles.css already has .no-times-available-container
   This section provides fallback/override if needed
   =========================================== */
.no-times-available-container {
    text-align: center;
    padding: 2rem 1.5rem;
    background: linear-gradient(135deg, #f8fffe 0%, #f1f9f7 100%);
    border: 2px solid #d4edda;
    border-radius: 16px;
    margin: 1rem 0;
    box-shadow: 0 4px 12px rgba(138, 167, 123, 0.1);
}

.no-times-available-container .spa-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #8aa77b;
    opacity: 0.8;
}

.no-times-available-container h4 {
    color: #2d5a3d;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    line-height: 1.4;
}

.no-times-available-container .conversion-message {
    color: #4a5d4f;
    font-size: 1rem;
    margin: 0 0 1.5rem 0;
    line-height: 1.6;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.no-times-available-container .business-hours-box {
    background: rgba(138, 167, 123, 0.1);
    border-radius: 12px;
    padding: 1rem;
    margin: 1.5rem 0;
    border: 1px solid rgba(138, 167, 123, 0.2);
}

.no-times-available-container .business-hours-box .hours-title {
    color: #2d5a3d;
    font-size: 0.9rem;
    margin: 0 0 0.5rem 0;
    font-weight: 500;
}

.no-times-available-container .business-hours-box .hours-text {
    color: #4a5d4f;
    font-size: 0.85rem;
    margin: 0;
    line-height: 1.4;
}

.no-times-available-container .suggestions-section {
    margin-top: 1.5rem;
}

.no-times-available-container .suggestions-title {
    color: #2d5a3d;
    font-size: 0.95rem;
    margin: 0 0 1rem 0;
    font-weight: 500;
}

.no-times-available-container .suggestions-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 1rem;
}

/* Suggested date buttons */
.suggested-date-btn {
    padding: 0.6rem 1rem;
    border: 2px solid #8aa77b;
    border-radius: 8px;
    background: white;
    color: #2d5a3d;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-height: 44px;
}

.suggested-date-btn:hover {
    background: #8aa77b;
    color: white;
}

.suggested-date-btn:focus {
    box-shadow: 0 0 0 3px rgba(138, 167, 123, 0.4);
    outline: 2px solid transparent;
}

.no-times-available-container .calendar-hint {
    color: #6b7280;
    font-size: 0.8rem;
    margin: 1rem 0 0 0;
    font-style: italic;
}

/* Mobile optimizations for no-times container */
@media (max-width: 480px) {
    .no-times-available-container {
        padding: 1.5rem 1rem;
        border-radius: 12px;
    }

    .no-times-available-container h4 {
        font-size: 1.1rem;
    }

    .no-times-available-container .conversion-message {
        font-size: 0.9rem;
    }
}

@media (max-width: 374px) {
    .no-times-available-container {
        padding: 1rem;
        margin: 0.5rem 0;
    }

    .no-times-available-container .spa-icon {
        font-size: 2rem;
    }

    .no-times-available-container h4 {
        font-size: 1rem;
    }

    .suggested-date-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
}

/* ===========================================
   REDUCED MOTION SUPPORT
   =========================================== */
@media (prefers-reduced-motion: reduce) {
    .time-slot-btn {
        transition: none;
    }

    .time-slots-loading .spinner {
        animation: none;
        border: 3px solid var(--sage-600, #8aa77b);
    }

    .suggested-date-btn {
        transition: none;
    }
}

/* ===========================================
   HIGH CONTRAST MODE
   =========================================== */
@media (prefers-contrast: high) {
    .time-slot-btn {
        border-width: 3px;
        border-color: #000;
    }

    .time-slot-selected,
    .time-slot-btn.time-slot-selected {
        background: #000;
        color: #fff;
        border-color: #000;
    }

    #time-slots-container {
        border-width: 3px;
        border-color: #000;
    }

    .no-times-available-container {
        border-width: 3px;
        border-color: #000;
    }

    .suggested-date-btn {
        border-width: 3px;
        border-color: #000;
    }
}

/* ===========================================
   PRINT STYLES
   =========================================== */
@media print {
    #time-slots-container {
        background: white;
        border: 2px solid #000;
        box-shadow: none;
    }

    .time-slot-btn {
        background: white;
        border: 1px solid #000;
        color: #000;
    }

    .time-slot-selected,
    .time-slot-btn.time-slot-selected {
        background: #ccc;
        border: 2px solid #000;
    }

    .no-times-available-container {
        background: white;
        border: 2px solid #000;
        box-shadow: none;
    }
}

/* =====================================================
   BOOKING STEP PROGRESS INDICATOR
   Mobile-first: 344px baseline
   WCAG 2.1 AAA compliant
   Luxury spa aesthetic with sage theme
   ===================================================== */

.booking-progress-container {
    margin-bottom: 1.5rem;
    padding: 0 0.5rem;
}

.booking-progress-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.25rem;
    position: relative;
}

/* Connecting line behind dots */
.booking-progress-indicator::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: calc(100% - 2rem);
    max-width: 280px;
    height: 2px;
    background: var(--sage-300, #b8c9b8);
    z-index: 0;
    border-radius: 1px;
}

.booking-progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
    flex: 0 0 auto;
    min-width: 36px;
}

.booking-progress-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--sage-300, #b8c9b8);
    border: 2px solid var(--sage-300, #b8c9b8);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

/* Touch target expansion */
.booking-progress-dot::after {
    content: '';
    position: absolute;
    inset: -16px;
}

/* Completed steps */
.booking-progress-step.completed .booking-progress-dot {
    background: var(--sage-600, #5d7a5d);
    border-color: var(--sage-600, #5d7a5d);
}

/* Completed checkmark */
.booking-progress-step.completed .booking-progress-dot::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4px;
    height: 6px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: translate(-50%, -60%) rotate(45deg);
}

/* Active step */
.booking-progress-step.active .booking-progress-dot {
    background: white;
    border-color: var(--sage-600, #5d7a5d);
    border-width: 3px;
    box-shadow: 0 0 0 4px rgba(93, 122, 93, 0.2);
    width: 14px;
    height: 14px;
}

.booking-progress-step.active .booking-progress-dot::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    background: var(--sage-600, #5d7a5d);
    border-radius: 50%;
}

/* Step labels - hidden on mobile */
.booking-progress-label {
    font-size: 0.6rem;
    font-weight: 500;
    color: var(--sage-400, #9eb09e);
    margin-top: 0.4rem;
    text-align: center;
    white-space: nowrap;
    transition: color 0.3s ease;
}

.booking-progress-step.completed .booking-progress-label {
    color: var(--sage-600, #5d7a5d);
}

.booking-progress-step.active .booking-progress-label {
    color: var(--sage-700, #4a614a);
    font-weight: 600;
}

/* Progress text */
.booking-progress-text {
    text-align: center;
    font-size: 0.875rem;
    color: var(--sage-600, #5d7a5d);
    font-weight: 500;
    margin-top: 0.75rem;
}

.booking-progress-text .current-step {
    font-weight: 700;
    color: var(--sage-700, #4a614a);
}

/* Mobile: 344px */
@media (max-width: 374px) {
    .booking-progress-container {
        margin-bottom: 1rem;
        padding: 0 0.25rem;
    }

    .booking-progress-indicator {
        gap: 0.1rem;
    }

    .booking-progress-indicator::before {
        max-width: 240px;
    }

    .booking-progress-step {
        min-width: 28px;
    }

    .booking-progress-dot {
        width: 10px;
        height: 10px;
    }

    .booking-progress-step.active .booking-progress-dot {
        width: 12px;
        height: 12px;
    }

    .booking-progress-label {
        display: none;
    }

    .booking-progress-text {
        font-size: 0.8rem;
    }
}

/* Tablet+ */
@media (min-width: 768px) {
    .booking-progress-indicator {
        gap: 0.5rem;
    }

    .booking-progress-indicator::before {
        max-width: 400px;
    }

    .booking-progress-dot {
        width: 14px;
        height: 14px;
    }

    .booking-progress-step.active .booking-progress-dot {
        width: 16px;
        height: 16px;
    }

    .booking-progress-label {
        font-size: 0.7rem;
    }

    .booking-progress-step {
        min-width: 48px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .booking-progress-dot,
    .booking-progress-step.active .booking-progress-dot {
        transition: none;
    }
}

/* High contrast */
@media (prefers-contrast: high) {
    .booking-progress-dot {
        border-width: 3px;
        border-color: #000;
    }

    .booking-progress-step.completed .booking-progress-dot {
        background: #000;
        border-color: #000;
    }

    .booking-progress-step.active .booking-progress-dot {
        border-color: #000;
    }

    .booking-progress-indicator::before {
        background: #000;
        height: 3px;
    }
}

/* =====================================================
   SKELETON LOADING STATE
   Replaces spinner with modern skeleton pattern
   ===================================================== */

.time-slots-skeleton-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.skeleton-slot {
    height: 44px;
    background: linear-gradient(90deg,
        var(--sage-100, #f0f4f0) 25%,
        var(--sage-50, #f8faf8) 50%,
        var(--sage-100, #f0f4f0) 75%);
    background-size: 200% 100%;
    border-radius: 8px;
    border: 2px solid var(--sage-200, #d9e2d9);
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
}

.skeleton-header {
    height: 1.1rem;
    width: 180px;
    margin: 0 auto 1rem;
    background: linear-gradient(90deg,
        var(--sage-200, #d9e2d9) 25%,
        var(--sage-100, #f0f4f0) 50%,
        var(--sage-200, #d9e2d9) 75%);
    background-size: 200% 100%;
    border-radius: 4px;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
}

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

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 480px) {
    .time-slots-skeleton-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 0.5rem;
    }
}

@media (max-width: 374px) {
    .time-slots-skeleton-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.4rem;
    }

    .skeleton-slot {
        height: 40px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .skeleton-slot,
    .skeleton-header {
        animation: none;
        background: var(--sage-100, #f0f4f0);
    }
}
