/**
 * SmartWeb Professional Booking System Styles
 * Modern, responsive design for all business types
 */

/* Container and Main Widget */
.swb-booking-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

.swb-booking-widget {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

/* Header */
.swb-booking-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
}

.swb-booking-title {
    margin: 0 0 10px;
    font-size: 32px;
    font-weight: 600;
}

.swb-booking-subtitle {
    margin: 0;
    font-size: 18px;
    opacity: 0.9;
}

/* Progress Bar */
.swb-progress-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.swb-progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    color: #6c757d;
    transition: all 0.3s ease;
}

.swb-progress-step.active {
    color: #667eea;
}

.swb-progress-step.completed {
    color: #28a745;
}

.swb-step-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e9ecef;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.swb-progress-step.active .swb-step-icon {
    background: #667eea;
    color: white;
    transform: scale(1.1);
}

.swb-progress-step.completed .swb-step-icon {
    background: #28a745;
    color: white;
}

.swb-step-label {
    font-size: 14px;
    font-weight: 500;
}

.swb-progress-line {
    width: 100px;
    height: 2px;
    background: #e9ecef;
    margin: 0 15px;
    position: relative;
    top: -20px;
}

/* Form Container */
.swb-booking-form {
    padding: 40px;
}

/* Steps */
.swb-booking-step {
    display: none;
    animation: fadeIn 0.3s ease;
}

.swb-booking-step.swb-step-active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.swb-step-title {
    margin: 0 0 30px;
    font-size: 24px;
    font-weight: 600;
    color: #212529;
}

/* Service Grid */
.swb-services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.swb-service-card {
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.swb-service-card:hover {
    border-color: #667eea;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.swb-service-card.selected {
    border-color: #667eea;
    background: #f8f9ff;
}

.swb-service-card input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.swb-service-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 15px;
}

.swb-service-name {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 10px;
    color: #212529;
}

.swb-service-desc {
    font-size: 14px;
    color: #6c757d;
    margin: 0 0 15px;
    line-height: 1.5;
}

.swb-service-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
}

.swb-service-duration {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #6c757d;
    font-size: 14px;
}

.swb-service-price {
    font-size: 18px;
    font-weight: 600;
    color: #667eea;
}

/* Calendar Styles */
.swb-datetime-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.swb-calendar-wrapper {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
}

.swb-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.swb-cal-nav {
    background: none;
    border: none;
    font-size: 24px;
    color: #667eea;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 6px;
    transition: all 0.2s;
}

.swb-cal-nav:hover {
    background: #e9ecef;
}

.swb-cal-current {
    font-size: 18px;
    font-weight: 600;
    color: #212529;
}

.swb-calendar-grid {
    width: 100%;
}

.swb-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    margin-bottom: 10px;
}

.swb-weekday {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    padding: 10px 0;
}

.swb-calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}

.swb-cal-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    position: relative;
}

.swb-cal-day:hover:not(.disabled):not(.other-month) {
    background: #e9ecef;
}

.swb-cal-day.today {
    background: #fff3cd;
    color: #856404;
}

.swb-cal-day.selected {
    background: #667eea;
    color: white;
}

.swb-cal-day.disabled {
    color: #dee2e6;
    cursor: not-allowed;
}

.swb-cal-day.other-month {
    color: #dee2e6;
}

.swb-cal-day.has-slots::after {
    content: '';
    position: absolute;
    bottom: 4px;
    width: 4px;
    height: 4px;
    background: #28a745;
    border-radius: 50%;
}

/* Time Slots */
.swb-timeslots-wrapper {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
}

.swb-timeslots-wrapper h4 {
    margin: 0 0 20px;
    font-size: 18px;
    font-weight: 600;
    color: #212529;
}

.swb-timeslots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
}

.swb-timeslot {
    padding: 12px;
    text-align: center;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.swb-timeslot:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.swb-timeslot.selected {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.swb-timeslot.unavailable {
    background: #f8f9fa;
    color: #adb5bd;
    cursor: not-allowed;
    text-decoration: line-through;
}

/* Form Elements */
.swb-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.swb-form-group {
    margin-bottom: 0;
}

.swb-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #495057;
}

.swb-form-half {
    grid-column: span 1;
}

.swb-form-full {
    grid-column: 1 / -1;
}

.swb-input,
.swb-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.2s;
}

.swb-input:focus,
.swb-textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.swb-textarea {
    resize: vertical;
    min-height: 100px;
}

/* Summary Card */
.swb-booking-summary {
    margin-bottom: 30px;
}

.swb-summary-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 25px;
}

.swb-summary-card h4 {
    margin: 0 0 20px;
    font-size: 20px;
    font-weight: 600;
    color: #212529;
}

.swb-summary-content {
    display: grid;
    gap: 15px;
}

.swb-summary-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #e9ecef;
}

.swb-summary-item:last-child {
    border-bottom: none;
}

.swb-summary-label {
    color: #6c757d;
    font-weight: 500;
}

.swb-summary-value {
    color: #212529;
    font-weight: 600;
}

/* Buttons */
.swb-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.swb-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.swb-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.swb-btn-secondary {
    background: #f8f9fa;
    color: #495057;
    border: 2px solid #e9ecef;
}

.swb-btn-secondary:hover {
    background: #e9ecef;
}

.swb-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Navigation */
.swb-form-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #e9ecef;
}

/* Success State */
.swb-booking-success {
    text-align: center;
    padding: 60px 40px;
}

.swb-success-icon {
    width: 80px;
    height: 80px;
    background: #28a745;
    color: white;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.swb-success-icon .dashicons {
    font-size: 40px;
    width: 40px;
    height: 40px;
}

.swb-booking-success h3 {
    font-size: 28px;
    margin-bottom: 15px;
    color: #212529;
}

.swb-success-message {
    font-size: 18px;
    color: #6c757d;
    margin-bottom: 30px;
}

.swb-booking-details {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

/* AI Assistant */
.swb-ai-assistant {
    margin-top: 20px;
    text-align: center;
}

.swb-btn-ai {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.swb-btn-ai:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(240, 147, 251, 0.3);
}

.swb-ai-results {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: left;
}

/* Checkbox */
.swb-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.swb-checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* Loading State */
.swb-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #6c757d;
}

.swb-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .swb-booking-container {
        padding: 10px;
    }
    
    .swb-booking-form {
        padding: 20px;
    }
    
    .swb-services-grid {
        grid-template-columns: 1fr;
    }
    
    .swb-datetime-container {
        grid-template-columns: 1fr;
    }
    
    .swb-form-grid {
        grid-template-columns: 1fr;
    }
    
    .swb-form-half {
        grid-column: 1 / -1;
    }
    
    .swb-progress-bar {
        padding: 20px 10px;
    }
    
    .swb-progress-line {
        width: 50px;
        margin: 0 5px;
    }
    
    .swb-step-label {
        font-size: 12px;
    }
    
    .swb-booking-title {
        font-size: 24px;
    }
    
    .swb-booking-subtitle {
        font-size: 16px;
    }
}

/* Print Styles */
@media print {
    .swb-btn,
    .swb-form-navigation,
    .swb-progress-bar {
        display: none !important;
    }
    
    .swb-booking-step {
        display: block !important;
        page-break-inside: avoid;
    }
}

/* Business Type Specific Styles */
.swb-booking-container.beauty-salon .swb-booking-header {
    background: linear-gradient(135deg, #ff6a88 0%, #ff99ac 100%);
}

.swb-booking-container.medical-clinic .swb-booking-header {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.swb-booking-container.restaurant .swb-booking-header {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.swb-booking-container.fitness .swb-booking-header {
    background: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
}