/**
 * Styles for Booking Widget and Chatbot
 */

/*** Booking Widget Styles ***/

.booking-widget-container {
    margin: 40px auto;
    max-width: 800px;
}

.booking-widget {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    background-color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Header */
.booking-widget-header {
    margin-bottom: 25px;
    text-align: center;
}

.booking-widget-title {
    margin: 0;
    color: #2c3e50;
    font-size: 24px;
    font-weight: 600;
}

/* Progress Indicator */
.booking-progress {
    margin-bottom: 30px;
}

.booking-progress-steps {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.booking-progress-steps::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background-color: #e6e6e6;
    z-index: 1;
}

.booking-progress-step {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: #fff;
    color: #95a5a6;
    border: 2px solid #e6e6e6;
    font-weight: 500;
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
}

.booking-progress-step.active {
    background-color: #3498db;
    color: #fff;
    border-color: #3498db;
}

.booking-progress-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    color: #7f8c8d;
    font-size: 12px;
    padding: 0 8px;
}

/* Step Content */
.booking-step-content {
    padding: 20px 0;
}

.booking-step-title {
    margin-top: 0;
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 500;
}

/* Service Options */
.booking-service-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.booking-service-option {
    padding: 15px;
    border-radius: 4px;
    background-color: #f9f9f9;
    border: 1px solid #e6e6e6;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 16px;
    color: #34495e;
}

.booking-service-option:hover {
    background-color: #f0f7ff;
    border-color: #bbd6fb;
}

.booking-service-option.selected {
    background-color: #ebf5ff;
    border-color: #3498db;
    color: #2980b9;
}

/* Date Grid */
.booking-date-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

@media (min-width: 600px) {
    .booking-date-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.booking-date-option {
    padding: 10px;
    border-radius: 4px;
    background-color: #f9f9f9;
    border: 1px solid #e6e6e6;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    color: #34495e;
}

.booking-date-option:hover {
    background-color: #f0f7ff;
    border-color: #bbd6fb;
}

.booking-date-option.selected {
    background-color: #ebf5ff;
    border-color: #3498db;
    color: #2980b9;
}

/* Time Grid */
.booking-time-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.booking-time-option {
    padding: 12px;
    border-radius: 4px;
    background-color: #f9f9f9;
    border: 1px solid #e6e6e6;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    color: #34495e;
}

.booking-time-option:hover {
    background-color: #f0f7ff;
    border-color: #bbd6fb;
}

.booking-time-option.selected {
    background-color: #ebf5ff;
    border-color: #3498db;
    color: #2980b9;
}

/* Form Styling */
.booking-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.booking-form-field {
    display: flex;
    flex-direction: column;
}

.booking-form-field label {
    margin-bottom: 5px;
    font-size: 14px;
    color: #34495e;
    font-weight: 500;
}

.booking-form-field input,
.booking-form-field textarea {
    padding: 12px;
    border-radius: 4px;
    border: 1px solid #e6e6e6;
    font-size: 16px;
    transition: border-color 0.2s;
}

.booking-form-field input:focus,
.booking-form-field textarea:focus {
    outline: none;
    border-color: #3498db;
}

.booking-error {
    padding: 10px;
    background-color: #ffe9e9;
    border-left: 3px solid #e74c3c;
    color: #c0392b;
    margin-bottom: 15px;
    font-size: 14px;
}

/* Navigation Buttons */
.booking-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.booking-back-button,
.booking-next-button {
    padding: 12px 20px;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.booking-back-button {
    background-color: #f9f9f9;
    border: 1px solid #e6e6e6;
    color: #7f8c8d;
}

.booking-back-button:hover {
    background-color: #f0f0f0;
}

.booking-next-button {
    background-color: #3498db;
    border: 1px solid #3498db;
    color: white;
}

.booking-next-button:hover {
    background-color: #2980b9;
}

.booking-next-button:disabled {
    background-color: #bdc3c7;
    border-color: #bdc3c7;
    cursor: not-allowed;
}

/* Confirmation Screen */
.booking-confirmation {
    text-align: center;
    padding: 30px 20px;
    background-color: #f1fdf6;
    border-radius: 8px;
    border: 1px solid #d4f5e2;
}

.booking-confirmation-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #2ecc71;
    color: white;
    font-size: 30px;
    margin-bottom: 20px;
}

.booking-confirmation-title {
    color: #27ae60;
    font-size: 24px;
    margin-bottom: 15px;
}

.booking-confirmation-text {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 16px;
    line-height: 1.6;
}

.booking-confirmation-button {
    margin-top: 20px;
    padding: 12px 24px;
    background-color: #2ecc71;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.booking-confirmation-button:hover {
    background-color: #27ae60;
}

/*** Chatbot Styles ***/

.chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Chat Button */
.chatbot-toggle-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #3498db;
    color: #fff;
    border: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: absolute;
    bottom: 0;
    right: 0;
    font-size: 24px;
}

.chatbot-toggle-button:hover {
    background-color: #2980b9;
    transform: scale(1.05);
}

.chatbot-toggle-button.active {
    background-color: #e74c3c;
}

.chatbot-toggle-button.active:hover {
    background-color: #c0392b;
}

/* Chat Widget */
.chatbot-widget {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 330px;
    height: 500px;
    border-radius: 10px;
    overflow: hidden;
    background-color: #fff;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
}

/* Chat Header */
.chatbot-header {
    background-color: #3498db;
    color: #fff;
    padding: 15px 20px;
}

.chatbot-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 500;
}

.chatbot-subheader {
    margin: 4px 0 0;
    font-size: 12px;
    opacity: 0.8;
}

/* Chat Messages */
.chatbot-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background-color: #f8f9fa;
}

.chatbot-message {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
}

.user-message {
    align-items: flex-end;
}

.bot-message {
    align-items: flex-start;
}

.message-bubble {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 18px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    word-wrap: break-word;
}

.user-message .message-bubble {
    background-color: #3498db;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.bot-message .message-bubble {
    background-color: #fff;
    color: #34495e;
    border-bottom-left-radius: 4px;
}

/* Typing Indicator */
.message-bubble.typing {
    background-color: #e6e6e6;
    min-width: 40px;
    padding: 12px;
}

.typing-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #95a5a6;
    margin-right: 4px;
    animation: typing-bounce 1.4s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
    margin-right: 0;
}

@keyframes typing-bounce {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-5px);
    }
}

/* Chat Options */
.chatbot-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 5px;
}

.chatbot-option-button {
    padding: 8px 12px;
    background-color: #eef6fd;
    color: #3498db;
    border: 1px solid #d0e8fa;
    border-radius: 18px;
    cursor: pointer;
    font-size: 14px;
    text-align: left;
    transition: all 0.2s;
}

.chatbot-option-button:hover {
    background-color: #d0e8fa;
}

/* Chat Input */
.chatbot-input {
    display: flex;
    padding: 10px;
    background-color: #fff;
    border-top: 1px solid #e6e6e6;
}

.chatbot-input-field {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #e6e6e6;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
}

.chatbot-input-field:focus {
    border-color: #3498db;
}

.chatbot-send-button {
    margin-left: 10px;
    padding: 0 15px;
    background-color: #3498db;
    color: #fff;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.chatbot-send-button:hover {
    background-color: #2980b9;
}

/* Booking Widget in Chatbot */
.chatbot-booking-container {
    padding: 15px;
    background-color: #fff;
    border-top: 1px solid #e6e6e6;
}

.chatbot-booking-title {
    margin: 0 0 10px;
    font-size: 16px;
    color: #2c3e50;
    text-align: center;
}

.chatbot-booking-widget {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

.chatbot-booking-message {
    margin-bottom: 15px;
    font-size: 14px;
    color: #7f8c8d;
}

.chatbot-booking-complete {
    padding: 8px 16px;
    background-color: #3498db;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.chatbot-booking-complete:hover {
    background-color: #2980b9;
}

/* Responsive Adjustments */
@media (max-width: 480px) {
    .chatbot-widget {
        width: calc(100vw - 40px);
        right: 0;
    }
}

/*** Styles for Booking Widget embedded in Chatbot ***/
.chatbot-booking-widget .booking-widget.chatbot-embedded-widget {
    max-width: 100%; /* Ensure it fits chatbot width */
    padding: 15px; /* Reduce padding */
    box-shadow: none; /* Remove its own shadow if chatbot has one */
    border: 1px solid #e0e0e0; /* Optional: add a light border */
    border-radius: 6px;
    background-color: #f9f9f9; /* Light background for the embedded widget area */
}

.chatbot-booking-widget .booking-widget.chatbot-embedded-widget .booking-widget-header {
    margin-bottom: 15px; /* Reduce margin */
}

.chatbot-booking-widget .booking-widget.chatbot-embedded-widget .booking-widget-title {
    font-size: 18px; /* Smaller title */
}

.chatbot-booking-widget .booking-widget.chatbot-embedded-widget .booking-progress {
    margin-bottom: 15px; /* Reduce margin */
}

.chatbot-booking-widget .booking-widget.chatbot-embedded-widget .booking-progress-step {
    width: 24px; /* Smaller steps */
    height: 24px;
    font-size: 12px;
}

.chatbot-booking-widget .booking-widget.chatbot-embedded-widget .booking-progress-labels {
    font-size: 10px; /* Smaller labels */
    padding: 0 4px;
}

.chatbot-booking-widget .booking-widget.chatbot-embedded-widget .booking-step-title {
    font-size: 16px; /* Smaller step titles */
    margin-bottom: 10px;
}

.chatbot-booking-widget .booking-widget.chatbot-embedded-widget .booking-service-option,
.chatbot-booking-widget .booking-widget.chatbot-embedded-widget .booking-date-option,
.chatbot-booking-widget .booking-widget.chatbot-embedded-widget .booking-time-option {
    padding: 8px 10px; /* Reduce padding on options */
    font-size: 13px;
}

.chatbot-booking-widget .booking-widget.chatbot-embedded-widget .booking-date-grid,
.chatbot-booking-widget .booking-widget.chatbot-embedded-widget .booking-time-grid {
    gap: 6px; /* Reduce gap in grids */
}

.chatbot-booking-widget .booking-widget.chatbot-embedded-widget .booking-form-field input,
.chatbot-booking-widget .booking-widget.chatbot-embedded-widget .booking-form-field textarea {
    padding: 8px 10px; /* Smaller input fields */
    font-size: 14px;
}

.chatbot-booking-widget .booking-widget.chatbot-embedded-widget .booking-form-field label {
    font-size: 13px;
}

.chatbot-booking-widget .booking-widget.chatbot-embedded-widget .booking-navigation button {
    padding: 8px 15px; /* Smaller nav buttons */
    font-size: 14px;
}

/* Ensure the chatbot message area can scroll if booking widget makes it too tall */
.chatbot-messages {
    max-height: 300px; /* Adjust as needed, or manage dynamically */
    overflow-y: auto;
}

.chatbot-booking-container {
    overflow-y: auto; /* Allow scrolling within the booking container itself */
    max-height: calc(100% - 120px); /* Example: adjust based on header/input height */
    padding: 10px;
}