/**
 * W_Booking Form Styles
 * 
 * @package W_Booking
 * @version 1.0.0
 * @author W System Team
 */

/* ===== BOOKING FORM CONTAINER ===== */
.w-booking-form {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
}

.booking-form-container {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.booking-form {
    padding: 0;
}

/* ===== BOOKING SECTIONS ===== */
.booking-section {
    padding: 30px;
    border-bottom: 1px solid #e9ecef;
    position: relative;
}

.booking-section:last-child {
    border-bottom: none;
}

.section-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #007bff;
    display: inline-block;
}

/* ===== SERVICE SELECTION ===== */
.service-selection {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.service-selector select {
    width: 100%;
    padding: 15px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 16px;
    background: white;
    transition: all 0.3s ease;
}

.service-selector select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.service-details {
    margin-top: 15px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    display: none;
}

.service-details.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.service-price,
.service-duration {
    display: inline-block;
    margin-right: 20px;
    font-weight: 500;
}

.price-value {
    color: #28a745;
    font-weight: 700;
    font-size: 18px;
}

.duration-value {
    color: #6c757d;
}

/* ===== STAFF SELECTION ===== */
.w-booking-staff-selection {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.w-staff-item {
    position: relative;
}

.w-staff-item input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.w-staff-checkbox-label {
    display: block;
    padding: 20px;
    border: 2px solid #dee2e6;
    border-radius: 12px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.w-staff-checkbox-label:hover {
    border-color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.w-staff-item input:checked + .w-staff-checkbox-label {
    border-color: #e91e63;
    background: linear-gradient(135deg, #e91e63 0%, #ad1457 100%);
    box-shadow: 0 0 0 3px rgba(233, 30, 99, 0.2);
    color: white;
}

.w-staff-item input:checked + .w-staff-checkbox-label::after {
    content: "✓";
    position: absolute;
    top: 10px;
    right: 15px;
    background: #007bff;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
}

.w-staff-info {
    display: block !important;
    padding: 20px !important;
    border: 2px solid #f8bbd9 !important;
    border-radius: 12px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    background: linear-gradient(135deg, #ff9eb5 0%, #ff6b9d 100%) !important;
    color: white !important;
    position: relative !important;
    margin-bottom: 0 !important;
    gap: 15px;
}

.w-staff-avatar {
    flex-shrink: 0;
}

.w-staff-avatar img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #e9ecef;
}

.w-staff-avatar-placeholder {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    text-transform: uppercase;
}

.w-staff-details {
    flex: 1;
}

.w-staff-name {
    font-size: 18px;
    font-weight: 600;
    color: white !important;
    margin-bottom: 5px;
}

.w-staff-position {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.w-staff-specialties {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8) !important;
    margin-bottom: 6px;
}

.w-staff-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.w-staff-rating .rating-stars {
    color: #ffc107;
    font-size: 14px;
    line-height: 1;
}

.w-staff-rating .rating-number {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8) !important;
    font-weight: 500;
}

.w-staff-experience {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
}

/* Additional Services Styling */
.service-additional-services {
    margin-top: 10px;
    padding: 10px;
    background: #f0f8ff;
    border-radius: 4px;
    border-left: 3px solid #007bff;
}

.service-additional-services h5 {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #495057;
    font-weight: 600;
}

.additional-total-price {
    color: #28a745;
    font-weight: 700;
}

.additional-services-list {
    list-style: none;
    padding: 0;
    margin: 0 0 8px 0;
}

.additional-service-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    border-bottom: 1px dotted #dee2e6;
}

.additional-service-item:last-child {
    border-bottom: none;
}

.addon-name {
    font-size: 13px;
    color: #6c757d;
}

.addon-price {
    font-size: 12px;
    color: #28a745;
    font-weight: 500;
}

.additional-services-note {
    text-align: center;
    margin-top: 8px;
}

.additional-services-note small {
    color: #6c757d;
    font-style: italic;
}

/* Selected Staff Summary */
.w-booking-selected-staff {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.w-booking-selected-staff h5 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

.w-selected-staff-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.w-selected-staff-item {
    background: white;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.w-selected-staff-item .staff-name {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.w-selected-staff-item .staff-specialties {
    font-size: 12px;
    color: #6c757d;
}

/* Responsive Design */
@media (max-width: 768px) {
    .w-booking-staff-selection {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .w-staff-info {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .w-staff-checkbox-label {
        padding: 15px;
    }
    
    .w-selected-staff-list {
        flex-direction: column;
    }
}

/* Legacy Staff Selection (keeping for compatibility) */
.staff-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.staff-option {
    position: relative;
}

.staff-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.staff-card {
    display: block;
    padding: 20px;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.staff-card:hover {
    border-color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.staff-option input:checked + .staff-card {
    border-color: #007bff;
    background: #f8f9ff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.staff-avatar {
    margin-bottom: 10px;
}

.staff-avatar img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #e9ecef;
}

.staff-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.staff-specialties {
    font-size: 13px;
    color: #6c757d;
    margin: 0;
}

/* ===== CALENDAR SECTION ===== */
.calendar-section {
    margin-bottom: 25px;
}

.booking-calendar {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    overflow: hidden;
    max-width: 400px;
    margin: 0 auto;
}

.calendar-header {
    background: #007bff;
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.calendar-nav {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.calendar-nav:hover {
    background: rgba(255, 255, 255, 0.2);
}

.calendar-month-year {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.calendar-grid {
    padding: 15px;
}

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

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

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

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.calendar-day.available {
    background: #f8f9fa;
    color: #333;
}

.calendar-day.available:hover {
    background: #e9ecef;
    transform: scale(1.05);
}

.calendar-day.unavailable {
    background: #f8d7da;
    color: #721c24;
    cursor: not-allowed;
}

.calendar-day.selected {
    background: #007bff;
    color: white;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.3);
}

.day-number {
    font-size: 14px;
}

/* ===== TIME SLOTS ===== */
.time-slots-section {
    margin-top: 20px;
}

.time-slots-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
}

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

.time-slot {
    position: relative;
}

.time-slot input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.time-label {
    display: block;
    padding: 12px 8px;
    text-align: center;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 14px;
}

.time-slot.available .time-label:hover {
    border-color: #007bff;
    background: #f8f9ff;
}

.time-slot input:checked + .time-label {
    border-color: #007bff;
    background: #007bff;
    color: white;
}

.time-slot.unavailable .time-label {
    background: #f8d7da;
    color: #721c24;
    cursor: not-allowed;
    opacity: 0.6;
}

/* ===== CUSTOMER INFO ===== */
.customer-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.field-group {
    display: flex;
    flex-direction: column;
}

.field-group label {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 14px;
}

.field-group input,
.field-group textarea {
    padding: 12px 15px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.field-group input:focus,
.field-group textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.field-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* ===== BOOKING SUMMARY ===== */
.submit-actions {
    background: #f8f9fa;
}

.booking-summary {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    margin-bottom: 25px;
}

.booking-summary h5 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #dee2e6;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.summary-item.total {
    font-weight: 700;
    font-size: 16px;
    color: #333;
    border-top: 2px solid #dee2e6;
    padding-top: 15px;
    margin-top: 10px;
}

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

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

.summary-item.total .summary-value {
    color: #28a745;
    font-size: 18px;
}

/* ===== FORM ACTIONS ===== */
.form-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.form-actions .btn {
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    min-width: 150px;
}

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-primary:hover {
    background: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #545b62;
    transform: translateY(-2px);
}

/* ===== LOADING OVERLAY ===== */
.booking-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 1000;
}

.booking-loading-overlay.active {
    display: flex;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

.loading-text {
    color: #6c757d;
    font-weight: 500;
}

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

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

/* ===== ADDITIONAL SERVICES (DỊCH VỤ ĐI KÈM) ===== */
.service-additional-services {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #28a745;
}

.service-additional-services h5 {
    font-size: 14px;
    font-weight: 600;
    color: #28a745;
    margin: 0 0 10px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.additional-service-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

.additional-service-item:last-child {
    border-bottom: none;
}

.addon-name {
    font-size: 13px;
    color: #495057;
    flex: 1;
}

.addon-price {
    font-size: 13px;
    font-weight: 600;
    color: #28a745;
    background: #e8f5e8;
    padding: 4px 8px;
    border-radius: 4px;
}

/* ===== PRESELECTED SERVICES ENHANCEMENT ===== */
.w-preselected-service-item {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
}

.w-preselected-service-item .service-info {
    padding: 15px;
}

.w-preselected-service-item .service-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    display: block;
    margin-bottom: 8px;
}

.w-preselected-service-item .service-details {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
}

.w-preselected-service-item .service-price,
.w-preselected-service-item .service-duration {
    font-size: 14px;
    color: #666;
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
}

.w-preselected-service-item .service-price {
    color: #007bff;
    font-weight: 600;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .w-booking-form {
        padding: 10px;
    }
    
    .booking-section {
        padding: 20px 15px;
    }
    
    .staff-options {
        grid-template-columns: 1fr;
    }
    
    .customer-fields {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
    
    .time-slots-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .booking-calendar {
        max-width: 100%;
    }
    
    .service-additional-services {
        padding: 12px;
    }
    
    .additional-service-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .addon-price {
        align-self: flex-end;
    }
}

@media (max-width: 480px) {
    .section-title {
        font-size: 18px;
    }
    
    .time-slots-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .calendar-weekdays,
    .calendar-days {
        gap: 2px;
    }
    
    .weekday {
        font-size: 10px;
        padding: 6px 2px;
    }
    
    .day-number {
        font-size: 12px;
    }
}

/* ===== THEME VARIATIONS ===== */
.w-booking-form[data-theme="modern"] {
    --primary-color: #6c5ce7;
    --secondary-color: #a29bfe;
}

.w-booking-form[data-theme="modern"] .section-title {
    border-bottom-color: var(--primary-color);
}

.w-booking-form[data-theme="modern"] .btn-primary {
    background: var(--primary-color);
}

.w-booking-form[data-theme="modern"] .btn-primary:hover {
    background: var(--secondary-color);
}

.w-booking-form[data-theme="minimal"] {
    box-shadow: none;
}

.w-booking-form[data-theme="minimal"] .booking-form-container {
    box-shadow: none;
    border: 1px solid #dee2e6;
}

.w-booking-form[data-theme="minimal"] .booking-section {
    padding: 20px;
}

/* ===== W-TIME-SLOT BUTTONS ===== */
.w-time-slots {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.w-time-slot {
    padding: 12px 8px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    text-align: center;
    transition: all 0.3s ease;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Available time slots */
.w-time-slot.available {
    border-color: #28a745;
    color: #28a745;
}

.w-time-slot.available:hover {
    border-color: #007bff;
    background: #f8f9ff;
    color: #007bff;
}

.w-time-slot.selected {
    border-color: #007bff;
    background: #007bff;
    color: white;
}

/* Unavailable time slots are now completely hidden from display */
/* No need for unavailable styles since they're not rendered */

/* Unavailable time slots styling */
.w-time-slot.unavailable {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #f5f5f5;
    color: #999;
}

.w-time-slot.unavailable:hover {
    background-color: #f5f5f5;
    color: #999;
    transform: none;
}

/* Keep disabled style for edge cases */
.w-time-slot:disabled {
    pointer-events: none;
}