/* Chatbot Container */
#startpt-chatbot {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99999;
    font-family: 'Inter', 'Segoe UI', sans-serif;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

/* Welcome Bubble */
#chatbot-welcome-bubble {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 290px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: opacity 0.4s ease, transform 0.4s ease, visibility 0.4s;
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, 0.05);
    z-index: 99999;
}

.chatbot-bubble-hidden {
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px);
    pointer-events: none;
}

.chatbot-bubble-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

#chatbot-welcome-bubble .bubble-content {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

#chatbot-welcome-bubble .bubble-icon {
    width: 38px;
    height: 38px;
    object-fit: contain;
    border-radius: 8px;
}

#chatbot-welcome-bubble .bubble-text {
    font-size: 14.5px;
    color: #1e293b;
    font-weight: 500;
    line-height: 1.4;
}

#bubble-close {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 16px;
    cursor: pointer;
    padding: 0 0 0 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    outline: none;
}

#bubble-close:hover {
    color: #fe0101; /* Accent red */
}

#chatbot-welcome-bubble .bubble-tail {
    position: absolute;
    bottom: -10px;
    right: 25px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid #ffffff;
    filter: drop-shadow(0 4px 2px rgba(0,0,0,0.05));
}

/* Launcher Button */
#chatbot-launcher {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #003a43;
    /* Primary Teal */
    color: #fff;
    border: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: transform 0.3s ease, background-color 0.3s ease;
}

#chatbot-launcher:hover {
    transform: scale(1.05);
    background-color: #fe0101;
    /* Accent Red on hover */
}

/* Main Window */
#chatbot-window {
    width: 350px;
    height: 600px;
    max-height: 80vh;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
    margin-bottom: 15px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    animation: slideUp 0.3s ease-out forwards;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header */
#chatbot-header {
    background-color: #003a43;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

#chatbot-logo {
    height: 35px;
    margin-right: 12px;
    object-fit: contain;
}

#chatbot-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff !important;
}

#chatbot-subtitle {
    margin: 0;
    font-size: 12px;
    opacity: 0.9;
    color: #ffffff !important;
}

#chatbot-close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.8;
}

#chatbot-close:hover {
    opacity: 1;
}

/* Messages Area */
#chatbot-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: #f4f4f6;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Bubble Styles */
.chat-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 15px;
    font-size: 13px;
    line-height: 1.4;
    word-wrap: break-word;
}

.chat-msg.assistant {
    background-color: #fff;
    color: #231f20;
    align-self: flex-start;
    border-bottom-left-radius: 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.chat-msg.user {
    background-color: #408dd4;
    /* Secondary Blue */
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 2px;
}

.chat-msg.urgent {
    background-color: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #fe0101;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 5px;
    margin-bottom: 10px;
}

.btn-quick-action {
    background: white;
    border: 1px solid #408dd4;
    color: #408dd4;
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 11.5px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-quick-action:hover {
    background: #408dd4;
    color: white;
}

/* Input Area */
#chatbot-input-area {
    padding: 15px;
    background: white;
    display: flex;
    gap: 10px;
    border-top: 1px solid #eee;
}

#chatbot-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    outline: none;
    font-family: inherit;
    font-size: 13px;
}

#chatbot-input:focus {
    border-color: #408dd4;
}

#chatbot-send {
    background: #003a43;
    color: #fff;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

#chatbot-send:hover {
    background: #fe0101;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 8px 12px;
    background: #fff;
    border-radius: 15px;
    align-self: flex-start;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ccc;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) {
    animation-delay: 0s;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-4px);
    }
}

/* Form Container */
#chatbot-lead-form {
    padding: 15px 20px;
    background: #f4f4f6;
    height: 100%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

#chatbot-lead-form .form-header {
    text-align: center;
    margin-bottom: 12px;
}

#chatbot-lead-form .form-header h5 {
    color: #003a43;
    font-weight: 700;
    margin-bottom: 3px;
    font-size: 18px;
}

#chatbot-lead-form .form-header p {
    font-size: 13px;
    color: #4b5563;
}

#chatbot-lead-form .form-group input, 
#chatbot-lead-form .form-group textarea, 
#chatbot-lead-form .form-group select {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px 12px;
    background: white;
    transition: border-color 0.2s;
    font-size: 13.5px;
}

#chatbot-lead-form .form-group input:focus, 
#chatbot-lead-form .form-group textarea:focus, 
#chatbot-lead-form .form-group select:focus {
    box-shadow: none;
    border-color: #003a43;
}

#chatbot-lead-form .btn-primary {
    background-color: #003a43;
    border: none;
    padding: 12px;
    font-weight: 700;
    margin-top: 10px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#chatbot-lead-form .btn-primary:hover {
    background-color: #fe0101;
}

/* Chatbot Booking CTA Button */
.chatbot-booking-btn {
    display: inline-block;
    background-color: #fe0101;
    color: #ffffff !important;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    margin-top: 10px;
    margin-bottom: 5px;
    text-align: center;
    width: 100%;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px rgba(254, 1, 1, 0.2);
    border: 1px solid #d10000;
}

.chatbot-booking-btn:hover {
    background-color: #d10000;
    transform: translateY(-1px);
    box-shadow: 0 6px 8px rgba(254, 1, 1, 0.25);
    text-decoration: none;
    color: #ffffff !important;
}

/* Mobile Responsiveness */
@media screen and (max-width: 450px) {
    #chatbot-window {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        bottom: 0;
        right: 0;
        border-radius: 0;
        margin-bottom: 0;
    }

    #chatbot-header {
        border-radius: 0;
    }

    #chatbot-launcher {
        bottom: 15px;
        right: 15px;
    }
}

/* reCAPTCHA Positioning Adjustments */
/* Move reCAPTCHA badge to the left to avoid overlapping with the chatbot on the right */
.grecaptcha-badge {
    left: -90px !important;
    right: auto !important;
    border-radius: 0 4px 4px 0 !important;
    box-shadow: 2px 0 10px rgba(0,0,0,0.15) !important;
    transition: left 0.3s ease !important;
    width: 120px !important;
    overflow: hidden !important;
}

.grecaptcha-badge:hover {
    left: 0 !important;
}

/* Optional: nudge it slightly when hovered if needed, 
   but default v3 behavior of expanding is usually fine. */