/* SmartSlot Booking - Frontend Styles */

:root {
    --smartslot-primary: #2563EB;
    --smartslot-secondary: #F1F5F9;
    --smartslot-accent: #10B981;
    --smartslot-text: #1E293B;
    --smartslot-text-light: #64748B;
    --smartslot-border: #E2E8F0;
    --smartslot-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --smartslot-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Booking Button */
.smartslot-booking-btn {
    background: var(--smartslot-primary);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--smartslot-shadow);
}

.smartslot-booking-btn:hover {
    background: #1D4ED8;
    transform: translateY(-2px);
    box-shadow: var(--smartslot-shadow-lg);
}

.smartslot-booking-btn:active {
    transform: translateY(0);
}

/* Modal Overlay */
.smartslot-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.smartslot-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Modal Container */
.smartslot-modal {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: var(--smartslot-shadow-lg);
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s ease;
}

.smartslot-modal-overlay.active .smartslot-modal {
    transform: scale(1) translateY(0);
}

/* Modal Header */
.smartslot-modal-header {
    background: var(--smartslot-primary);
    color: white;
    padding: 20px 24px;
    position: relative;
}

.smartslot-modal-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
}

.smartslot-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.smartslot-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Modal Body */
.smartslot-modal-body {
    padding: 24px;
    max-height: 60vh;
    overflow-y: auto;
}

/* Step Navigation */
.smartslot-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 24px;
    padding: 0 16px;
}

.smartslot-step {
    flex: 1;
    text-align: center;
    position: relative;
}

.smartslot-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 15px;
    right: -50%;
    width: 100%;
    height: 2px;
    background: var(--smartslot-border);
    z-index: 1;
}

.smartslot-step.completed:not(:last-child)::after {
    background: var(--smartslot-primary);
}

.smartslot-step-number {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--smartslot-border);
    color: var(--smartslot-text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    margin: 0 auto 8px;
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
}

.smartslot-step.active .smartslot-step-number {
    background: var(--smartslot-primary);
    color: white;
}

.smartslot-step.completed .smartslot-step-number {
    background: var(--smartslot-accent);
    color: white;
}

.smartslot-step-label {
    font-size: 12px;
    color: var(--smartslot-text-light);
    font-weight: 500;
}

.smartslot-step.active .smartslot-step-label {
    color: white;
    font-weight: 600;
}

.smartslot-step.completed .smartslot-step-label {
    color: white;
    font-weight: 600;
}

/* Step Content */
.smartslot-step-content {
    display: none;
}

.smartslot-step-content.active {
    display: block;
    animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Service Selection */
.smartslot-services {
    display: grid;
    gap: 12px;
}

.smartslot-service-item {
    border: 2px solid var(--smartslot-border);
    border-radius: 8px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.smartslot-service-item:hover {
    border-color: var(--smartslot-primary);
    box-shadow: var(--smartslot-shadow);
}

.smartslot-service-item.selected {
    border-color: var(--smartslot-primary);
    background: rgba(37, 99, 235, 0.05);
}

.smartslot-service-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--smartslot-text);
    margin: 0 0 4px 0;
}

.smartslot-service-description {
    font-size: 14px;
    color: var(--smartslot-text-light);
    margin: 0 0 8px 0;
}

.smartslot-service-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.smartslot-service-duration {
    color: var(--smartslot-text-light);
}

.smartslot-service-price {
    font-weight: 600;
    color: var(--smartslot-primary);
}

/* Calendar */
.smartslot-calendar-container {
    margin-bottom: 20px;
}

.smartslot-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.smartslot-calendar-nav {
    background: none;
    border: 1px solid var(--smartslot-border);
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    color: var(--smartslot-text);
    transition: all 0.2s ease;
}

.smartslot-calendar-nav:hover {
    background: var(--smartslot-secondary);
    border-color: var(--smartslot-primary);
}

.smartslot-calendar-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--smartslot-text);
}

.smartslot-calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 20px;
}

.smartslot-calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.smartslot-calendar-day.header {
    background: var(--smartslot-secondary);
    color: var(--smartslot-text-light);
    font-weight: 600;
    cursor: default;
}

.smartslot-calendar-day.disabled {
    color: #CBD5E1;
    cursor: not-allowed;
}

.smartslot-calendar-day.available:hover {
    background: var(--smartslot-secondary);
    border-color: var(--smartslot-primary);
}

.smartslot-calendar-day.selected {
    background: var(--smartslot-primary);
    color: white;
}

.smartslot-calendar-day.today {
    border-color: var(--smartslot-accent);
    font-weight: 600;
}

/* Time Slots */
.smartslot-timeslots {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
    padding: 4px;
}

.smartslot-timeslot {
    padding: 10px 12px;
    border: 2px solid var(--smartslot-border);
    border-radius: 6px;
    text-align: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    background: white;
}

.smartslot-timeslot:hover {
    border-color: var(--smartslot-primary);
    background: rgba(37, 99, 235, 0.05);
}

.smartslot-timeslot.selected {
    background: var(--smartslot-primary);
    color: white;
    border-color: var(--smartslot-primary);
}

.smartslot-timeslot.unavailable {
    background: #F8FAFC;
    color: #94A3B8;
    cursor: not-allowed;
    border-color: #E2E8F0;
}

/* Form Fields */
.smartslot-form-group {
    margin-bottom: 16px;
}

.smartslot-form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--smartslot-text);
    font-size: 14px;
}

.smartslot-form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--smartslot-border);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
}

.smartslot-form-input:focus {
    outline: none;
    border-color: var(--smartslot-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.smartslot-form-textarea {
    resize: vertical;
    min-height: 80px;
}

/* Buttons */
.smartslot-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.smartslot-btn-primary {
    background: var(--smartslot-primary);
    color: white;
}

.smartslot-btn-primary:hover {
    background: #1D4ED8;
    transform: translateY(-1px);
}

.smartslot-btn-secondary {
    background: var(--smartslot-secondary);
    color: var(--smartslot-text);
    border: 1px solid var(--smartslot-border);
}

.smartslot-btn-secondary:hover {
    background: #E2E8F0;
}

.smartslot-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Modal Footer */
.smartslot-modal-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--smartslot-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

/* Loading States */
.smartslot-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.smartslot-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: smartslot-spin 1s linear infinite;
}

@keyframes smartslot-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Messages */
.smartslot-message {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0;
    font-size: 14px;
    font-weight: 500;
}

.smartslot-message.success {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.smartslot-message.error {
    background: rgba(239, 68, 68, 0.1);
    color: #DC2626;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.smartslot-message.info {
    background: rgba(37, 99, 235, 0.1);
    color: var(--smartslot-primary);
    border: 1px solid rgba(37, 99, 235, 0.3);
}

/* Payment Summary */
.smartslot-payment-summary {
    background: var(--smartslot-secondary);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.smartslot-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 14px;
}

.smartslot-summary-row:last-child {
    margin-bottom: 0;
    font-weight: 600;
    font-size: 16px;
    padding-top: 8px;
    border-top: 1px solid var(--smartslot-border);
}

.smartslot-summary-label {
    color: var(--smartslot-text-light);
}

.smartslot-summary-value {
    color: var(--smartslot-text);
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .smartslot-modal {
        width: 95%;
        margin: 20px;
    }
    
    .smartslot-modal-body {
        padding: 20px;
    }
    
    .smartslot-steps {
        padding: 0 8px;
    }
    
    .smartslot-step-label {
        font-size: 11px;
    }
    
    .smartslot-timeslots {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    }
    
    .smartslot-calendar {
        gap: 2px;
    }
    
    .smartslot-calendar-day {
        font-size: 12px;
    }
    
    .smartslot-modal-footer {
        flex-direction: column;
        gap: 8px;
    }
    
    .smartslot-modal-footer .smartslot-btn {
        width: 100%;
    }
}

/* Accessibility */
.smartslot-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;
}

/* Focus styles for keyboard navigation */
.smartslot-service-item:focus,
.smartslot-calendar-day:focus,
.smartslot-timeslot:focus,
.smartslot-form-input:focus,
.smartslot-btn:focus {
    outline: 2px solid var(--smartslot-primary);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --smartslot-border: #000000;
        --smartslot-text-light: #000000;
    }
}
