/* Chatbot Container */
html,
body {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}


*,
*:before,
*:after {
    box-sizing: inherit;
}

:root {
    --bookwp-chatbot-primary: var(--color-blue-500);
    --bookwp-chatbot-primary-dark: var(--color-blue-600);
    --bookwp-chatbot-primary-light: var(--color-blue-300);
    --bookwp-chatbot-bg: #f8fafc;
    --bookwp-chatbot-text: #1e293b;
    --bookwp-chatbot-text-light: var(--color-gray-400);
    --bookwp-chatbot-border: #e2e8f0;
}

body {
    margin: 0 !important;
    padding: 0 !important;
    --wp--style--root--padding-left: 0 !important;
    --wp--style--root--padding-right: 0 !important;
    font-size: medium !important;
    font-weight: 400 !important;
}

.bookwp-chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99999;
}

/* Toggle Button */
.bookwp-chatbot-toggle {
    width: 60px;
    height: 60px;
    background-color: var(--bookwp-chatbot-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px var(--color-blue-200);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.bookwp-chatbot-toggle:hover {
    transform: scale(1.1) rotate(5deg);
}

.bookwp-chatbot-toggle .dashicons {
    color: #fff;
    font-size: 30px !important;
    width: 30px !important;
    height: 30px !important;
}

/* Chatbot Window */
.bookwp-chatbot-window {
    display: none;
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 620px;
    background-color: #fff;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    flex-direction: column;
    overflow: hidden !important;
    /* Lock window scroll */
    transform-origin: bottom right;
}

.bookwp-chatbot-window.open {
    display: flex;
    animation: bookwp-pop-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes bookwp-pop-in {
    from {
        opacity: 0;
        transform: scale(0.5) translateY(40px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.bookwp-chatbot-view {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden !important;
    overflow-y: hidden !important;
    /* Lock view scroll */
}

/* Header Styles */
.bookwp-chatbot-header {
    background-color: var(--bookwp-chatbot-primary);
    color: #fff;
    padding: 16px 20px !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bookwp-header-home {
    margin: 0 0 0px !important;
    font-size: 28px !important;
    font-weight: 700 !important;
    color: #fff;
}

.bookwp-home-greeting p {
    margin: 0 !important;
    font-size: 15px !important;
    opacity: 0.9 !important;
    line-height: 1.4 !important;
}

.bookwp-home-greeting h2 {
    color: #fff !important;
    margin: 0 0 8px 0 !important;
    font-size: 28px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
}

.bookwp-header-conversation {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bookwp-header-left {
    display: flex;
    align-items: center;
    gap: 12px !important;
}

.bookwp-bot-avatar-header {
    width: 36px !important;
    height: 36px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 50%;
}

.bookwp-header-info {
    display: flex;
    flex-direction: column;
}

.bookwp-header-info h3 {
    margin: 0 !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    color: #fff;
}

.bookwp-header-info span {
    font-size: 12px !important;
    opacity: 0.9 !important;
    font-weight: 400 !important;
}

.bookwp-header-right {
    display: flex;
    align-items: center;
    gap: 8px !important;
    position: relative;
}

#bookwp-chatbot-menu {
    cursor: pointer;
    padding: 4px;
    border-radius: 8px;
    transition: background 0.2s;
}

#bookwp-chatbot-menu:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Dropdown Menu Styling */
.bookwp-chatbot-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 10px;
    background: #fff;
    min-width: 160px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    z-index: 100;
    overflow: hidden;
    border: 1px solid var(--bookwp-chatbot-border);
    animation: bookwp-slide-down 0.2s ease-out;
}

.bookwp-chatbot-dropdown.show {
    display: block;
}

/* Responsive Design */
@media screen and (max-width: 767px) {
    .bookwp-chatbot-window {
        --bookwp-chat-height: 100vh;
        width: 100vw !important;
        max-width: 100% !important;
        height: var(--bookwp-chat-height, 100vh) !important;
        position: fixed !important;
        inset: 0 !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        border-radius: 0 !important;
        z-index: 9999999 !important;
        overflow-x: hidden !important;
        overflow-y: hidden !important;
        display: none;
        flex-direction: column;
        background: #fff;
    }

    /* Hide redundant footer nav on mobile */
    .bookwp-chatbot-footer-nav {
        display: none !important;
    }
}

@media screen and (max-width: 480px) {
    .bookwp-chatbot-container {
        bottom: 10px;
        right: 10px;
    }

    .bookwp-chatbot-toggle {
        width: 50px;
        height: 50px;
    }

    .bookwp-chatbot-toggle .dashicons {
        font-size: 24px !important;
        width: 24px !important;
        height: 24px !important;
    }

    .bookwp-chatbot-window {
        --bookwp-chat-height: 100vh;
        width: 100vw !important;
        max-width: 100% !important;
        height: var(--bookwp-chat-height, 100vh) !important;
        position: fixed !important;
        inset: 0 !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        border-radius: 0 !important;
        z-index: 9999999 !important;
        overflow-x: hidden !important;
        overflow-y: hidden !important;
        display: none;
        flex-direction: column;
        background: #fff;
    }

    /* Hide redundant footer nav on mobile */
    .bookwp-chatbot-footer-nav {
        display: none !important;
    }

    .bookwp-chatbot-window.open {
        animation: bookwp-mobile-pop 0.3s ease-out;
    }

    @keyframes bookwp-mobile-pop {
        from {
            opacity: 0;
            transform: translateY(100%);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .bookwp-chatbot-header {
        padding: 12px 16px !important;
        border-radius: 0 !important;
    }

    .bookwp-header-home h2 {
        font-size: 20px !important;
    }

    .bookwp-home-greeting p {
        font-size: 15px !important;
    }

    .bookwp-chatbot-messages {
        padding: 15px !important;
    }

    .bookwp-chatbot-message {
        padding: 10px 14px !important;
        font-size: 16px !important;
    }

    .bookwp-chatbot-input-area-new {
        padding: 10px 12px !important;
        border-radius: 0 !important;
    }

    .bookwp-chatbot-minimize-trigger {
        display: block !important;
    }
}


@media screen and (orientation: landscape) and (max-height: 500px) {
    .bookwp-chatbot-window {
        height: calc(100vh - 20px);
        top: 10px;
    }
}

@keyframes bookwp-slide-down {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bookwp-dropdown-item {
    padding: 12px 16px !important;
    color: var(--bookwp-chatbot-text);
    font-size: 16px !important;
    display: flex;
    align-items: center;
    gap: 10px !important;
    cursor: pointer;
    transition: background 0.2s;
    font-weight: 500 !important;
}

.bookwp-dropdown-item:hover {
    background: #f8fafc;
    color: var(--bookwp-chatbot-primary);
}

.bookwp-dropdown-item .dashicons {
    font-size: 18px !important;
    width: 18px !important;
    height: 18px !important;
}

#bookwp-clear-chat {
    color: #ef4444;
}

#bookwp-clear-chat:hover {
    background: #fef2f2;
}

.bookwp-chatbot-minimize-trigger {
    display: none;
    /* Hidden by default (Desktop) */
    cursor: pointer;
    font-size: 24px !important;
    padding: 4px;
    border-radius: 8px;
    transition: background 0.2s;
}


.bookwp-chatbot-minimize-trigger:hover {
    background: rgba(255, 255, 255, 0.2);
}


/* Transitions */
.view-fade-enter {
    animation: bookwp-fade-in 0.3s ease-out;
}

@keyframes bookwp-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Home Body */
.bookwp-chatbot-body-home,
.bookwp-chatbot-body-guest {
    flex: 1;
    width: 100%;
    box-sizing: border-box;
    padding: 20px !important;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    z-index: 10;
}

/* Cards */
.bookwp-card-button {
    background: #fff !important;
    border-radius: 16px !important;
    padding: 20px !important;
    margin-bottom: 16px !important;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid var(--bookwp-chatbot-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
}

.bookwp-card-button:hover {
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    transform: translateY(-2px);
    border-color: var(--bookwp-chatbot-primary) !important;
}

.bookwp-card-text strong {
    display: block !important;
    font-size: 16px !important;
    color: var(--bookwp-chatbot-text);
    margin-bottom: 4px !important;
    font-weight: 700 !important;
}

.bookwp-card-text span {
    font-size: 13px !important;
    color: var(--bookwp-chatbot-text-light);
}

/* Search card specific */
.bookwp-search-input-mock {
    margin-top: 10px;
    background: #f1f5f9 !important;
    border-radius: 8px !important;
    padding: 8px 12px !important;
    display: flex;
    align-items: center;
    gap: 8px !important;
    font-size: 16px !important;
    color: var(--bookwp-chatbot-text-light);
}

.bookwp-search-input-mock .dashicons {
    font-size: 16px !important;
}

/* Recent Conversations */
.bookwp-empty-state {
    text-align: center;
    color: var(--bookwp-chatbot-text-light);
    padding: 30px 0;
    font-size: 14px !important;
    background: #fff !important;
    border-radius: 12px !important;
    border: 1px dashed var(--bookwp-chatbot-border) !important;
}

.bookwp-recent-item {
    display: flex;
    align-items: center;
    padding: 14px 0 !important;
    background: transparent !important;
    border-bottom: 1px solid #f1f5f9 !important;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.bookwp-recent-item:hover {
    padding-left: 12px !important;
    background: #f8fafc !important;
}

.bookwp-recent-item:last-child {
    border-bottom: none !important;
}

.bookwp-recent-avatar {
    width: 44px !important;
    height: 44px !important;
    background-color: var(--bookwp-chatbot-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 14px !important;
    flex-shrink: 0;
}

.bookwp-recent-avatar .dashicons {
    color: #fff !important;
    font-size: 20px !important;
}

.bookwp-recent-info {
    flex: 1;
    min-width: 0;
}

.bookwp-recent-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2px !important;
}

.bookwp-recent-meta strong {
    font-size: 16px !important;
    color: var(--bookwp-chatbot-text);
    font-weight: 600 !important;
}

.bookwp-recent-meta span {
    font-size: 12px !important;
    color: var(--bookwp-chatbot-text-light);
}

.bookwp-recent-preview {
    font-size: 14px !important;
    color: var(--bookwp-chatbot-text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bookwp-recent-arrow {
    padding-left: 10px;
    color: var(--bookwp-chatbot-text-light);
    opacity: 0.5;
}

/* Guest Form */
.bookwp-guest-form-card {
    background: #fff !important;
    border-radius: 20px !important;
    padding: 24px !important;
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

.bookwp-guest-field {
    margin-bottom: 16px !important;
}

.bookwp-guest-field input {
    width: 100%;
    padding: 14px 16px !important;
    border: 1px solid var(--bookwp-chatbot-border) !important;
    border-radius: 12px !important;
    font-size: 16px !important;
    /* Forces 16px to prevent iOS auto-zoom on focus */
    outline: none;
    transition: all 0.2s;
    background-color: #f8fafc !important;
}

.bookwp-guest-field input:focus {
    border-color: var(--bookwp-chatbot-primary);
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.1);
}

.bookwp-phone-field {
    display: flex;
    gap: 12px !important;
}

.bookwp-phone-prefix {
    border: 1px solid var(--bookwp-chatbot-border);
    border-radius: 12px;
    padding: 0 12px !important;
    display: flex;
    align-items: center;
    gap: 8px !important;
    background: #fff;
    cursor: pointer;
    position: relative;
    min-width: 60px;
    justify-content: center;
}

#bookwp-selected-country {
    font-weight: 700;
    color: var(--bookwp-chatbot-text);
    font-size: 14px;
}

.bookwp-phone-code-dropdown {
    display: none;
    position: absolute;
    bottom: calc(100% + 10px);
    left: 0;
    width: 250px;
    max-height: 250px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--bookwp-chatbot-border);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 10000;
}

.bookwp-phone-code-dropdown.show {
    display: block;
}

.bookwp-phone-code-item {
    padding: 10px 14px !important;
    display: flex;
    align-items: center;
    gap: 10px !important;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 14px !important;
}

.bookwp-phone-code-item:hover {
    background: #f1f5f9;
}

.bookwp-phone-code-item .bookwp-flag {
    font-weight: 700 !important;
    color: var(--bookwp-chatbot-primary);
}

.bookwp-phone-code-item .bookwp-code {
    color: var(--bookwp-chatbot-text-light);
}

.bookwp-phone-input-wrapper {
    flex: 1;
    border: 1px solid var(--bookwp-chatbot-border);
    border-radius: 12px;
    padding: 8px 16px !important;
    background: #fff;
}

.bookwp-phone-input-wrapper label {
    display: block;
    font-size: 12px !important;
    color: var(--bookwp-chatbot-primary);
    font-weight: 600 !important;
    margin-bottom: 2px !important;
}

.bookwp-phone-inner {
    display: flex;
    align-items: center;
    gap: 4px !important;
}

.bookwp-phone-inner span {
    font-size: 16px !important;
    color: var(--bookwp-chatbot-text);
    white-space: nowrap;
}

.bookwp-phone-inner input {
    border: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
    flex: 1;
    min-width: 0;
    background: transparent !important;
    box-shadow: none !important;
}

.bookwp-start-chat-btn {
    width: 100%;
    background-color: var(--bookwp-chatbot-primary);
    color: #fff;
    border: none;
    padding: 14px !important;
    border-radius: 12px;
    font-size: 16px !important;
    font-weight: 600 !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px !important;
    transition: background 0.2s;
}

.bookwp-start-chat-btn:hover {
    background-color: var(--bookwp-chatbot-primary-dark);
}

/* Footer Nav */
.bookwp-chatbot-footer-nav {
    display: flex;
    justify-content: space-around;
    padding: 10px 0 !important;
    background: #fff;
    border-top: 1px solid var(--bookwp-chatbot-border);
}

.bookwp-nav-items {
    padding: 8px 8px !important;
    cursor: pointer;
    color: var(--bookwp-chatbot-text-light);
    border-radius: 12px;
    transition: all 0.2s;
}

.bookwp-nav-items.active {
    color: var(--bookwp-chatbot-primary);
    background: var(--color-blue-100);
}

/* Messages */
.bookwp-chatbot-messages {
    flex: 1;
    width: 100%;
    box-sizing: border-box;
    padding: 10px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    /* Only messages area scroll */
    display: flex;
    flex-direction: column;
    gap: 12px !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    /* Prevent scroll bubbling */
}

.bookwp-chatbot-messages::before {
    content: "";
    flex: 0 0 auto;
    margin-top: auto;
    /* WhatsApp push to bottom */
}

/* Message Row (Avatar + Content) */
.bookwp-message-row {
    display: flex;
    gap: 10px !important;
    max-width: 85%;
}

.bot-message-row {
    align-self: flex-start;
    flex-direction: row;
    /* Avatar (Start) then Content */
    align-items: flex-end;
}

.user-message-row {
    align-self: flex-end;
    flex-direction: row-reverse;
    /* Push content to right, though icon is hidden */
}

.bookwp-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: #fff;
    border: 1px solid var(--bookwp-chatbot-border);
    display: flex;
    align-items: center;
    justify-content: center;
}

.bookwp-message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bookwp-message-content {
    display: flex;
    flex-direction: column;
}

.bot-message-row .bookwp-message-content {
    align-items: flex-start;
}

.user-message-row .bookwp-message-content {
    align-items: flex-end;
}

.bookwp-sender-name {
    color: #545454;
    font-size: 16px;
    margin-bottom: 5px;

}

.user-message-row .bookwp-sender-name {
    text-align: right !important;
}

.bookwp-chatbot-message {
    padding: 12px 18px !important;
    border-radius: 18px;
    font-size: 16px !important;
    line-height: 1.6 !important;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

.bot-message {
    background: linear-gradient(135deg, var(--bookwp-chatbot-primary) 0%, var(--bookwp-chatbot-primary-dark) 100%);
    color: #fff;
}

.user-message {
    background: #ffffff;
    color: #1f2937;
    border: 1px solid var(--bookwp-chatbot-border);
    background-color: gainsboro;
}

/* User Summary Message (Specific styling) */
.user-summary-message {
    border: 1px solid var(--bookwp-chatbot-primary) !important;
    /* Very subtle green tint to contrast */
    border-radius: 18px !important;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05);
}

.user-summary-message div {
    margin-bottom: 4px !important;
}

.user-summary-message strong {
    color: var(--bookwp-chatbot-primary);
}

/* Modern Input Area */
.bookwp-chatbot-input-area-new {
    background: #ffffff;
    padding: 8px 16px !important;
    border-top: 1px solid var(--bookwp-chatbot-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px !important;
    border-radius: 0 !important;
    min-height: 56px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom)) !important;
    z-index: 10;
    max-width: 100vw;
    box-sizing: border-box;
    width: 100%;
}

.bookwp-input-wrapper {
    flex: 1;
    min-width: 0;
    /* Prevents flex flex grow overflow */
}

.bookwp-input-wrapper textarea {
    width: 100%;
    border: none !important;
    outline: none !important;
    font-size: 16px !important;
    /* 16px prevents iOS auto-zoom on focus */
    color: var(--bookwp-chatbot-text);
    padding: 8px 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    resize: none;
    max-height: 150px;
    height: auto;
    font-family: inherit;
    line-height: 1.4;
    overflow-y: hidden !important;
    /* WhatsApp feel: no internal scroll unless max-height reached */
    box-sizing: border-box;
}

.bookwp-input-actions {
    display: flex;
    justify-content: flex-end;
    gap: 16px !important;
    color: #4b5563;
}

.bookwp-input-actions .dashicons {
    cursor: pointer;
    font-size: 20px !important;
    width: 20px !important;
    height: 20px !important;
    color: #64748b;
    transition: all 0.2s;
    padding: 4px;
    border-radius: 6px;
}

.dashicons,
.dashicons-before:before {
    height: auto !important;
    width: auto !important;
}

.bookwp-input-actions .dashicons:hover {
    color: var(--bookwp-chatbot-primary);
    background: var(--color-blue-100);
    transform: translateY(-1px);
}

.bookwp-chatbot-send-btn {
    background: var(--bookwp-chatbot-primary) !important;
    color: #fff !important;
    border: none !important;
    width: 42px !important;
    height: 42px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    flex-shrink: 0 !important;
    padding: 0 !important;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3) !important;
}

.bookwp-chatbot-send-btn svg {
    width: 20px !important;
    height: 20px !important;
    color: #fff !important;
    transform: rotate(45deg);
    margin-right: 2px;
}

.bookwp-chatbot-icon-btn {
    background: transparent !important;
    border: none !important;
    color: #64748b !important;
    padding: 8px !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bookwp-chatbot-icon-btn:hover {
    color: var(--bookwp-chatbot-primary) !important;
}

/* Typing Indicator */
.typing-indicator {
    padding: 10px 14px !important;
    background: #fff;
    border-radius: 12px;
    display: flex;
    gap: 4px !important;
    width: fit-content;
    border: 1px solid var(--bookwp-chatbot-border);
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: var(--bookwp-chatbot-primary);
    border-radius: 50%;
    animation: bookwp-typing 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bookwp-typing {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

/* Option Buttons */
.bookwp-chatbot-option-btn {
    display: inline-block;
    padding: 10px 18px;
    background: #fff;
    border: 1px solid var(--bookwp-chatbot-primary);
    color: var(--bookwp-chatbot-primary);
    border-radius: 20px;
    margin: 5px;
    cursor: pointer;
    font-size: 16px;
    font-family: inherit;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    white-space: normal;
    word-break: break-word;
    max-width: 100%;
    box-sizing: border-box;
}

.bookwp-chatbot-option-btn:focus,
.bookwp-chatbot-option-btn:active {
    outline-color: var(--bookwp-chatbot-primary) !important;
    color: var(--bookwp-chatbot-primary) !important;
    text-decoration: none !important;
}

.bookwp-chatbot-option-btn:active,
.bookwp-chatbot-option-btn.is-pressed {
    transform: scale(0.96);
    opacity: 0.8;
}

@media (hover: hover) {
    .bookwp-chatbot-option-btn:hover:not(.disabled) {
        background: var(--bookwp-chatbot-primary-light);
        color: #ffffff;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px var(--bookwp-chatbot-primary);
    }
}

.bookwp-chatbot-option-btn:active:not(.disabled) {
    transform: translateY(0);
}

/* Ensure messages area respects safe area (Critical for iOS Google Search/Chrome) */
.bookwp-chatbot-messages {
    padding-bottom: calc(20px + env(safe-area-inset-bottom)) !important;
}

/* Chatbot Slot specific buttons */
.bookwp-chatbot-slot-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: calc(100% - 10px);
    /* Account for margin */
    padding: 12px 18px;
    margin: 5px;
    border-radius: 12px;
    text-align: left;
}

.bookwp-slot-time {
    font-weight: 600;
}

.bookwp-slot-price {
    font-weight: 500;
    opacity: 0.8;
}

/* Ensure hover state changes the price color properly */
@media (hover: hover) {
    .bookwp-chatbot-slot-btn:hover:not(.disabled) .bookwp-slot-price {
        opacity: 1;
        color: #fff;
    }
}

@media screen and (max-width: 767px) {
    .bookwp-chatbot-messages {
        padding-bottom: calc(85px + env(safe-area-inset-bottom)) !important;
    }
}

.bookwp-chatbot-option-btn.disabled {
    opacity: 0.5;
    cursor: default;
    border-color: #cbd5e1;
    color: #94a3b8;
}

@media screen and (max-width: 767px) {
    .bookwp-chatbot-window {
        /* Fallback for older browsers */
        height: 100vh;
        /* Modern browsers: adjusts when address bar shows/hides */
        height: 100dvh !important;
        width: 100vw !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        border-radius: 0 !important;
    }
}

body.bookwp-chatbot-open {
    width: 100% !important;
    height: 100% !important;
    /* Prevents the background page from scrolling via touch */
    touch-action: none;
}

/* Allow scrolling ONLY inside the message area */
.bookwp-chatbot-messages {
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
}

.bookwp-chatbot-input-area-new {
    /* Important for iPhone "Home Indicator" bar */
    padding-bottom: max(12px, env(safe-area-inset-bottom)) !important;
    background: #fff;
    /* Ensure it stays at the bottom of the flex container */
    margin-top: auto;
}

.bookwp-input-wrapper textarea {
    /* Font-size must be at least 16px to prevent auto-zoom on iOS */
    font-size: 16px !important;
}

.bookwp-chatbot-container {
    z-index: 999999;
}

/* Ensure the window doesn't get squashed by small height screens (landscape) */
@media screen and (max-height: 450px) and (orientation: landscape) {
    .bookwp-chatbot-header {
        padding: 8px 16px !important;
    }

    .bookwp-chatbot-window {
        height: 100dvh !important;
    }
}

@media screen and (max-width: 380px) {
    .bookwp-message-row {
        max-width: 90%;
    }

    .bookwp-chatbot-message {
        padding: 10px 14px !important;
        font-size: 15px !important;
    }
}