:root {
    --primary: #1395ba;
    --font-family: "Segoe UI", Arial, sans-serif;
}

/* ============================================
   CHATBOT WIDGET SCOPED STYLES
   All styles are scoped to prevent conflicts with webflow.css
   ============================================ */

/* Reset webflow.css styles within chatbot containers */
#chat-container *,
#chatbot-chat-container *,
.chatbot-widget * {
    box-sizing: border-box;
}

/* Override webflow.css button styles for chatbot */
#chat-container button,
#chatbot-chat-container button,
.chatbot-widget button {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
}

/* Override webflow.css input styles for chatbot */
#chat-container .w-input,
#chatbot-chat-container .w-input,
.chatbot-widget .w-input {
    height: auto !important;
    padding: 8px 12px !important;
}

#chatbot-toggle img {
    width: 30px !important;
    height: 30px !important;
    display: block !important;
    pointer-events: none !important;
    transition: opacity 0.2s ease !important;
}

#chatbot-toggle:hover {
}

#chatbot-toggle:active {
    transform: scale(0.95) !important;
}

#chat-container {
    position: fixed;
    bottom: 75px;
    right: 40px;
    width: 370px;
    min-width: 320px;
    max-width: 420px;
    /* border: 1px solid transparent; */
    border-radius: 10px;
    display: none;
    flex-direction: column;
    gap: 0;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 10000;
    max-height: 90vh;
    overflow: hidden;
    background: white;
    box-shadow: 0px 0px 5px 1px rgb(0, 0, 0, 0.3);
    transition: opacity 0.3s ease, transform 0.3s ease !important;
    opacity: 0;
    transform: translateY(10px) scale(0.95);
}

/* Smooth open animation */
#chat-container[style*="display: flex"] {
    opacity: 1 !important;
    transform: translateY(0) scale(1) !important;
    animation: chatSlideIn 0.3s ease-out !important;
}

/* Smooth close animation */
#chat-container[style*="display: none"] {
    opacity: 0 !important;
    transform: translateY(10px) scale(0.95) !important;
}

@keyframes chatSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media screen and (max-width: 767px) {
#chat-container {
                position: fixed;
                bottom: 5px;
                right: 20px;
                width: 370px;
                min-width: 320px;
                max-width: 420px;
                border-radius: 10px;
                display: none;
                flex-direction: column;
                gap: 0;
                margin: 0 !important;
                padding: 0 !important;
                z-index: 998;
                max-height: 90vh;
                overflow: hidden;
                background: white;
                box-shadow: 0px 0px 5px 1px rgb(0, 0, 0, 0.3);
            }
}

/* Responsive for real small screens */
@media screen and (max-width: 600px) {
    #chat-container {
        width: 95vw;
        min-width: unset;
        max-width: 100vw;
        right: 2vw;
        left: 2vw;
        bottom: 70px;
    }

    /* Ensure input area is accessible on small screens */
    .input-wrapper {
        padding: 8px 4px !important;
    }

    .input-row {
        padding: 0 4px !important;
    }
}

/* Scoped h3 for chatbot only - prevents conflict with webflow.css */
#chat-container h3,
#chatbot-chat-container h3,
.chatbot-widget h3 {
    text-align: center;
    color: var(--primary);
    font-size: 20px;
    font-weight: bold;
}

#messages {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    /* border: 1px solid var(--border-color); */
    /* border-radius: 10px; */
    /* padding: 12px; */
    background-color: white;
    display: flex;
    flex-direction: column;
    /* gap: 10px; */
    /* box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4); */
}

.msg {
    margin-bottom: 20px;
    width: 100%;
}


.user {
    align-self: flex-end;
    color: #000000;
    border-bottom-right-radius: 4px;
    /* border: solid #3b82f6 3px; */
}

.bot {
    align-self: flex-start;
    color: white;
    border-bottom-left-radius: 1px;
}

.agent {
    align-self: flex-start;
    color: #000000;
    border-bottom-left-radius: 4px;
    /* border: solid black 1px; */
    margin-top: 5px;
}

#input {
    margin-top: 0px;
    margin-bottom: 0px;
    flex-grow: 1;
    padding: 8px 10px;
    font-size: 14px;
    outline: none;
    background: white;
    color: rgb(0, 0, 0);
    border: none;
}

#input::placeholder {
    color: #9ca3af;
}

/* Scoped button styles for chatbot only - prevents conflict with webflow.css */
#chat-container .text-bnt,
#chatbot-chat-container .text-bnt,
.chatbot-widget .text-bnt {
    color: #a0a0a0;
    border: solid white 0px !important;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.3s;
    margin-bottom: 0px;
    background: white !important;
    padding: 2px 4px !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
    line-height: 1 !important;
    vertical-align: middle;
}

/* Set default color for svg */
.chat-svg {
    color: #8c8c8c;
    transition: color 0.3s;
    fill: currentColor;
    display: block;
}

/* On button hover, change svg color */
.text-bnt:hover .chat-svg {
    color: #1395ba;
    /* Your hover color */
}


/* Scoped button styles for chatbot only - prevents conflict with webflow.css */
#chat-container .next-btn,
#chatbot-chat-container .next-btn,
.chatbot-widget .next-btn {
    color: rgb(255, 255, 255) !important;
    border: solid white 0px !important;
    padding: 5px 10px 5px 10px;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.3s;
    background: #1395ba !important;
    display: inline-block !important;
    text-decoration: none !important;
    line-height: inherit !important;
}

#chat-container .email-btn,
#chatbot-chat-container .email-btn,
.chatbot-widget .email-btn {
    color: rgb(255, 255, 255) !important;
    border: solid white 0px !important;
    padding: 10px 10px 5px 10px;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.3s;
    background: #1395ba !important;
    display: inline-block !important;
    text-decoration: none !important;
    line-height: inherit !important;
}

#chat-container .location-btn,
#chatbot-chat-container .location-btn,
.chatbot-widget .location-btn {
    color: rgb(255, 255, 255) !important;
    border: solid white 0px !important;
    padding: 10px;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.3s;
    background: #1395ba !important;
    display: inline-block !important;
    text-decoration: none !important;
    line-height: inherit !important;
}

#chat-container .skip-location-btn,
#chatbot-chat-container .skip-location-btn,
.chatbot-widget .skip-location-btn {
    color: rgb(255, 255, 255) !important;
    border: solid white 0px !important;
    padding: 10px;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.3s;
    display: inline-block !important;
    text-decoration: none !important;
    line-height: inherit !important;
}



/* .send-button{
  color: #a7a7a7;
  background: white;
}

.send-button:hover {
  background:#1395ba ;
      color: rgb(255, 255, 255);
}
    button:hover {
      background:#1395ba ;
      color: rgb(255, 255, 255);
    } */

/* button:disabled {
      background: #6b7280;
      cursor: not-allowed;
    } */

/* Scoped preset button for chatbot only - prevents conflict with webflow.css */
#chat-container .preset-btn,
#chatbot-chat-container .preset-btn,
.chatbot-widget .preset-btn {
    flex: 1;
    padding: 8px;
    font-size: 13px;
    background: var(--preset-bg);
    border: none !important;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
    color: white;
    min-width: 0;
    display: inline-block !important;
    text-decoration: none !important;
    line-height: inherit !important;
}

/* .preset-btn:hover {
      background: var(--preset-hover);
    } */

.presets {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 10px;
}

.input-row {
    display: flex;
    gap: 10px;
    align-items: center;
    background-color: white;
}

/* Scoped input styles for chatbot only - prevents conflict with webflow.css */
#chat-container input[type="text"],
#chat-container input[type="email"],
#chatbot-chat-container input[type="text"],
#chatbot-chat-container input[type="email"],
.chatbot-widget input[type="text"],
.chatbot-widget input[type="email"],
#input {
    /* border-radius: 8px; */
    border: 1px solid #ffffff !important;
    background: white !important;
    color: black !important;
    width: 100%;
    font-size: 14px;
    outline: none;
    box-shadow: none;
    height: auto !important;
    margin-bottom: 0 !important;
    line-height: 1.42857143 !important;
    vertical-align: middle !important;
    /* outline: none; */
}

#chat-container input[type="text"]::placeholder,
#chat-container input[type="email"]::placeholder,
#chatbot-chat-container input[type="text"]::placeholder,
#chatbot-chat-container input[type="email"]::placeholder,
.chatbot-widget input[type="text"]::placeholder,
.chatbot-widget input[type="email"]::placeholder,
#input::placeholder {
    color: #9ca3af;
}

.prompt-box {
    background-color: white;
    border-radius: 10px;
    padding: 15px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    animation: fadeInUp 0.4s ease both;
    flex-shrink: 0;
}

.prompt-box[style*="display: none"] {
    display: none !important;
}

.prompt-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.bot-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid var(--primary);
    object-fit: cover;
    background: #ffffff;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    text-align: center;
    display: flex;
}

/* Location icon wrapper - centers SVG icon */
.location-icon-wrapper {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.location-icon-wrapper svg {
    width: 20px;
    height: 20px;
    display: block;
    margin: auto;
}

.prompt-title {
    font-size: 15px;
    color: var(--primary);
    margin: 0;
}

.prompt-subtitle {
    text-align: start !important;
    font-size: 10px;
    color: var(--border-color);
    margin-top: 1px;
}

.prompt-content {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.prompt-label {
    font-size: 11px;
    color: #1395ba;
}


.bot-title {
    margin-left: 10px;
    font-size: 18px;
    color: white;
}

.bot-subtitle {
    /* margin-left: 10px; */
    font-size: 10px;
    color: #ffffff;
}



#location-status {
    margin-top: 10px;
    font-size: 14px;
    color: var(--primary);
}

.image-in-message {
    max-width: 150px;
    max-height: 200px;
    border-radius: 8px;
    object-fit: cover;
}


@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    #chat-container {
        bottom: 90px;
        right: 10px;
        left: 10px;
        max-width: none;
        width: auto;
        max-height: 100vh;
    }

    .chatbot-chat-message {
        flex: 1;
        overflow-y: auto;
        padding: 10px;
        background-color: white;
        min-height: 0;
    }


    .presets {
        grid-template-columns: 1fr;
    }

    .prompt-box {
        padding: 20px;
    }

    .bot-avatar {
        width: 40px;
        height: 40px;
        font-size: 30px;
        display: flex;
    }
}



@media screen and (max-width: 480px) {
    #chatbot-toggle {
        width: 60px;
        height: 60px;
        font-size: 24px;
        bottom: 15px;
        right: 15px;
    }

    #chat-container {
        bottom: 85px;
        right: 5px;
        left: 5px;
    }

    .prompt-title {
        font-size: 18px;
    }

    .prompt-subtitle {
        font-size: 10px;
    }

    .chatbot-chat-message {
        flex: 1;
        overflow-y: auto;
        padding: 10px;
        background-color: white;
        min-height: 0;
    }

}

.chat-icon {
    width: 25px;
    height: 25px;
    display: block;
}

#chat-container {
    max-height: 90vh;
    max-width: 50vh;
    scroll-behavior: smooth;
}

#chat-container::-webkit-scrollbar {
    width: 8px;
}

#chat-container::-webkit-scrollbar-thumb {
    background-color: #888;
    border-radius: 4px;
}

#chat-container::-webkit-scrollbar-thumb:hover {
    background-color: #555;
}

.chat-bot-bg {
    display: none;
    flex-direction: column;
    flex: 1 1 0;
    min-height: 0;
    height: auto;
    overflow: hidden;
}

.chat-bot-bg[style*="display: flex"] {
    min-height: 550px;
}

#chat-container[style*="display: flex"] .chat-bot-bg[style*="display: flex"] {
    min-height: 550px;
}

#chat-container[style*="display: flex"]:has(.chat-bot-bg[style*="display: flex"]) {
    min-height: 550px;
    height: auto;
}


.msg.user {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.msg.bot,
.msg.agent {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}


.msg-header {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px !important;
    padding: 0px 0 !important;
    height: 30px !important;
    min-height: 30px !important;
    line-height: 1.2 !important;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid #c0c0c0;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin: 0px 0 0 10px;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.sender-name {
    font-size: 0.7rem;
    color: #828282;
    font-weight: 600;
    /* margin-left: 4px; */
}

.bubble {
    border-radius: 10px;
    padding: 10px 15px;
    font-size: .75rem;
    font-family: "Segoe UI", Arial, sans-serif;
    box-shadow: 0 2px 8px rgba(60, 70, 80, 0.05);
    display: inline-block;
    max-width: 80%;
    min-width: 44px;
    background: #fff;
    color: #232323;
    margin-left: 44px;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.msg-time {
    display: block;
    font-size: 0.7em;
    color: #b9b9b9;
    text-align: right;
    margin-bottom: -5px;
}

.msg.bot .msg-time {
    color: #e3f0ff;
}

.msg.bot .bubble {
    background: #1395ba;
    color: #fff;
    font-weight: 500;
    margin-left: 50px;
    max-width: 400px;
}

.msg.agent .bubble {
    background: #1395ba;
    color: #fff;
    /* font-weight: 500; */
    margin-left: 50px;
}

.msg.user .bubble {
    background: #efefef;
    color: #232323;
    margin-left: auto;
    margin-right: 15px;
    background-color: #efefef;
    font-weight: 500;
}

/*
#chat-btn {
    background: #ffffff;
    border: solid white 0px;
    padding: 10px 10px 5px 10px;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.3s;
    color: #a1a1a1;

} */

/* #emoji-btn {
  background-color: white;
  color: #bababa;
} */

/* #emoji-btn:hover {
  background: #1;
  color: #fff;
}

#chat-btn:hover {
  background: #1;
  color: #fff;
} */

.timestamp-line {
    width: 100%;
    text-align: center;
    color: #696969;
    font-size: 0.61rem;
    margin: 10px 0 2px 0;
    font-weight: 500;
    /* letter-spacing: 0.02em; */
    display: block;
    /* background: #f3f3f3; */
    /* border-radius: 8px; */
}

/* Modern chat scrollbar styles */
#messages::-webkit-scrollbar {
    width: 8px;
    background: transparent;
}

#messages::-webkit-scrollbar-thumb {
    background: linear-gradient(120deg, #3b82f6 20%, #1395ba 90%);
    border-radius: 8px;
    min-height: 30px;
    transition: background 0.25s, box-shadow 0.25s;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.10);
}

#messages::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(120deg, #1395ba 30%, #1e40af 100%);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.18);
}

#messages::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 12px;
    margin: 8px 0;
}

/* For Firefox */
#messages {
    scrollbar-width: thin;
    scrollbar-color: #b0b0b0 #f4f6fb;
    transition: scrollbar-color 0.25s;
}

.msg-actions {
    position: absolute;
    top: 6px;
    right: 10px;
    z-index: 10;
}

/* Scoped msg menu button - prevents conflict with webflow.css */
#chat-container .msg-menu,
#chatbot-chat-container .msg-menu,
.chatbot-widget .msg-menu {
    background: none !important;
    border: none !important;
    font-size: 18px;
    cursor: pointer;
    color: #ffffff;
    padding: 0;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    display: inline-block !important;
    text-decoration: none !important;
    line-height: inherit !important;
}

.msg-dropdown {
    display: none;
    position: absolute;
    right: 0;
    background: #fff;
    border: 1px solid #e3e3e3;
    border-radius: 6px;
    min-width: 120px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.13);
}

.msg-dropdown-item {
    padding: 10px 12px;
    cursor: pointer;
    color: #e53935;
    font-weight: 500;
}

.msg-dropdown-item:hover {
    background: #f4f4f4;
}

/* Scoped chat button main - prevents conflict with webflow.css */
#chat-container .chat-btn-main,
#chatbot-chat-container .chat-btn-main,
.chatbot-widget .chat-btn-main {
    align-items: center;
    background: #1395ba !important;
    border: none !important;
    border-radius: 10px;
    color: #fff !important;
    font-size: .7rem;
    font-weight: 700;
    padding: 0.3rem 1rem 0.3rem 1.1rem;
    /* box-shadow: 0 4px 12px rgba(24, 119, 242, 0.22); */
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
    /* gap: 8px; */
    /* outline: none; */
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    display: inline-block !important;
    text-decoration: none !important;
    line-height: inherit !important;
}

#chat-container .chat-btn-main:hover,
#chat-container .chat-btn-main:focus,
#chatbot-chat-container .chat-btn-main:hover,
#chatbot-chat-container .chat-btn-main:focus,
.chatbot-widget .chat-btn-main:hover,
.chatbot-widget .chat-btn-main:focus {
    background: #0e63c7 !important;
    box-shadow: 0 6px 16px rgba(24, 119, 242, 0.33);
}

.chat-icon-svg {
    display: flex;
    align-items: center;
    justify-content: center;
}


.chat-header {
    position: relative;
    background: #1395ba;
    /* your base color */
    overflow: hidden;
    padding: 0 0 10px 0;
    /* box-shadow: 0 1px 8px rgba(44, 84, 255, 0.04); */
    /* min-width: 330px; */
    flex-shrink: 0;
}

.chat-header::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url('https://client.crisp.chat/static/images/tiles/overlapping-hexagons.svg?43022c0');
    opacity: 0.075;
    /* Faint overlay */
    pointer-events: none;
    /* Let clicks pass through */
    z-index: 0;
    background-size: auto;
    background-repeat: repeat;

}

/* Make sure your content is above the pattern */
.chat-header>* {
    position: relative;
    z-index: 1;
}

.chat-header-top {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 10px;
    margin-bottom: 7px;
}




/* Scoped crisp chat button - prevents conflict with webflow.css */
#chat-container .crisp-chat-btn,
#chatbot-chat-container .crisp-chat-btn,
.chatbot-widget .crisp-chat-btn {
    display: flex;
    align-items: center;
    background: #36aecf !important;
    border: none !important;
    border-radius: 10px;
    padding: 0px 6px 0px 6px;
    font-size: 19px;
    color: #fff !important;
    font-weight: 700;
    /* box-shadow: 0 3px 12px 0 rgba(44, 84, 255, .18); */
    cursor: pointer;
    transition: background 0.18s, box-shadow 0.2s;
    outline: none;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    text-decoration: none !important;
    line-height: inherit !important;
}


.chat-icon-circle {
    width: 32px;
    height: 32px;
    background: #36aecf;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}


.chat-btn-label {
    margin-right: 4px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    /* letter-spacing: .5px; */
}


/* Crisp avatar and name row */
.chat-header-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    /* gap: 0px;
  padding: 0 18px 0 18px; */
}

.header-avatar-row {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}


.header-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #fff;
    box-shadow: 0 1px 5px rgba(24, 119, 242, 0.10);
    background: #fff;
}

.header-info {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.header-title {
    color: #fff;
    font-weight: bold;
    font-size: 1.08rem;
    text-align: center;
    margin-bottom: 1px;
}

/* Scoped header menu button - prevents conflict with webflow.css */
#chat-container .header-menu-btn,
#chatbot-chat-container .header-menu-btn,
.chatbot-widget .header-menu-btn {
    background: none !important;
    border: none !important;
    color: #fff;
    font-size: 25px;
    cursor: pointer;
    padding: 0 7px;
    border-radius: 5px;
    transition: background 0.16s;
    margin-left: auto;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    display: inline-block !important;
    text-decoration: none !important;
    line-height: inherit !important;
}

#chat-container .header-menu-btn:hover,
#chatbot-chat-container .header-menu-btn:hover,
.chatbot-widget .header-menu-btn:hover {
    background: rgba(255, 255, 255, 0.15) !important;
}

.bubble {
    position: relative;
}

.msg-actions {
    position: absolute;
    top: 8px;
    right: 12px;
    z-index: 2;
    /* Ensures menu is always in the top-right of bubble */
}

.msg-menu {
    background: none;
    border: none;
    font-size: 13px;
    color: #000000;
    cursor: pointer;
    outline: none;
    display: none;
}

.msg.user .bubble:hover .msg-menu {
    display: inline-block;
    /* Only show on hover for user messages */
}

.msg-dropdown {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(40, 60, 90, 0.12);
    position: absolute;
    right: 0;
    top: 26px;
    min-width: 110px;
    display: none;
    z-index: 10;
}

.msg-dropdown-item {
    padding: 5px 5px;
    cursor: pointer;
    font-size: 10px;
    color: #222;
    transition: background 0.14s;
}

.msg-dropdown-item:hover {
    background: #f0f3fa;
}


.typing-dots {
    display: inline-block;
    font-size: 1.5em;
    letter-spacing: 2px;
    vertical-align: middle;
}

.typing-dots span {
    animation: blink 1s infinite;
    opacity: 0.2;
    transition: opacity 0.18s;
}

.typing-dots span:nth-child(1) {
    animation-delay: 0s;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes blink {
    0% {
        opacity: 0.2;
    }

    40% {
        opacity: 1;
    }

    100% {
        opacity: 0.2;
    }
}


#chatbot-chatbot-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2147483647;
    background: #1395ba;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    border: none;
    box-shadow: 0 4px 16px rgba(59, 130, 246, .18);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.16s;
    padding: 0;
}

#chatbot-chatbot-toggle:hover {
}

#chatbot-chatbot-toggle img {
    width: 25px;
    height: 25px;
    pointer-events: none;
}

#chatbot-chat-container {
    position: fixed;
    bottom: 90px;
    /* Above the button */
    right: 24px;
    width: 370px;
    max-width: 320px;
    min-width: 320px;
    border: 1px solid #ccc;
    border-radius: 14px;
    background: #fff;
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 42px rgba(25, 36, 81, 0.23);
    overflow: hidden;
    /* height: 400px;
    max-height: 80vh; */
}

@media (max-width: 500px) {
    #chatbot-chat-container {
        left: 8px;
        right: 8px;
        bottom: 80px;
        width: auto;
        min-width: 0;
        max-width: none;
    }

    #chatbot-chatbot-toggle {
        right: 10px;
        bottom: 14px;
        width: 52px;
        height: 52px;
    }
}


/* #chatbot-chat-container,
#chatbot-chat-container > div,
#chatbot-chat-container .chat-bot-bg {
  display: flex;
  flex-direction: column;
} */

.input-wrapper-chatbot {
    display: flex;
    flex-direction: column;
    background: white;
    padding: 0px 8px;
    border-top: 1px solid #ddd;
}

/* Input wrapper - reduce bottom spacing */
.input-wrapper {
    display: flex;
    flex-direction: column;
    background: white;
    padding: 10px !important;
    border-top: 1px solid #ddd;
    margin: 0 !important;
    min-height: 0;
    height: auto;
}

.input-row {
    display: flex;
    /* flex: 1; */
    gap: 10px;
    height: auto;
    min-height: 0;
    margin: 0 !important;
    padding: 0 !important;
    align-items: center;
}

.input-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 4px;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    /* margin-top: 6px; */
}



.agent-input-wrapper {
    border: 1px solid #cfcfcf;
    border-radius: 12px;
    margin: 15px;
    padding: 10px 12px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
}

/* Scoped textarea for chatbot - prevents conflict with webflow.css */
#chat-container .agent-input-wrapper textarea,
#chatbot-chat-container .agent-input-wrapper textarea,
.chatbot-widget .agent-input-wrapper textarea {
    border: none !important;
    outline: none;
    font-size: 15px;
    resize: none;
    overflow: hidden;
    width: 100%;
    color: #333;
    line-height: 1.6;
    padding: 8px 12px !important;
    margin-bottom: 0 !important;
    background-color: #ffffff !important;
    font-family: inherit !important;
}

.agent-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
}

/* Scoped agent toolbar buttons - prevents conflict with webflow.css */
#chat-container .agent-toolbar button,
#chatbot-chat-container .agent-toolbar button,
.chatbot-widget .agent-toolbar button {
    background: transparent !important;
    border: none !important;
    cursor: pointer;
    padding: 4px 6px;
    font-size: 16px;
    color: #333;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    display: inline-block !important;
    text-decoration: none !important;
    line-height: inherit !important;
}

#chat-container .agent-toolbar button:hover,
#chatbot-chat-container .agent-toolbar button:hover,
.chatbot-widget .agent-toolbar button:hover {
    background: #f0f0f0 !important;
    border-radius: 6px;
}

#chat-container .agent-toolbar .right-actions button.sendBtn,
#chatbot-chat-container .agent-toolbar .right-actions button.sendBtn,
.chatbot-widget .agent-toolbar .right-actions button.sendBtn {
    background: #1395ba !important;
    color: white !important;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 18px;
}

.emoji-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding-top: 10px;
    font-size: 22px;
}

.bubble.image-bubble {
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin-left: 0 !important;
    display: flex !important;
    align-items: flex-start !important;
    max-width: 90%;
}

.bubble.image-bubble img {
    border-radius: 10px;
    background: #fff;
    margin: 0;
    max-width: 260px;
    max-height: 200px;
    display: block;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.04);
}

.bubble.image-bubble .msg-time {
    margin: .0px 50px;
    margin-bottom: 0;
    text-align: left;
    color: #808080;
    font-size: 0.8em;
}

#image-preview-area {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    margin: 0 0 8px 0;
    max-width: 280px;
    position: absolute;
    bottom: 80px;
    right: 10px;
    z-index: 10;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.09);
    padding: 10px;
    border: 1px solid #d1d1d1;
}

#image-preview-area img {
    max-width: 160px;
    max-height: 120px;
    border-radius: 8px;
    margin-bottom: 8px;
    object-fit: cover;
}

.header-title {
    color: #fff;
    font-weight: 600;
    font-size: .8rem;
    margin-top: 5px;
    font-family: "Segoe UI", Arial, sans-serif !important;
}

.header-status-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-top: 2px;
    margin-bottom: 4px;
}

.online-dot {
    width: 7px;
    height: 7.1px;
    border-radius: 50%;
    background: #12d86e;
    display: inline-block;
    box-shadow: 0 1px 4px rgba(18, 216, 110, 0.19);
    margin-top: 2.2px;
}

.header-status-msg {
    color: #ffffffe3;
    font-size: 0.8rem;
    font-weight: 400;
    font-family: "Segoe UI", Arial, sans-serif !important;
    margin-top: 2px;
}

.chat-icon-logo {
    width: 37px;
    height: 37px;
    background: #1395ba;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #bcbcbc;
}

.overlap-logos {
    position: relative;
    width: 52px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.overlap-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: 1px solid #fff;
    background: #fff;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.08);
    position: relative;
    z-index: 1;
    right: 18px;
}

.overlap-chat-icon {
    position: absolute;
    left: 24px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #36aecf;
    border: 1px solid #fff;
    outline: 3px solid #1395ba;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(24, 119, 242, 0.09);
}

.overlap-chat-icon img {
    width: 30px;
    height: 30px;
    display: block;
}

/* If screen is very small (either by zoom or on mobile), show chatbot in fullscreen */
@media screen and (max-width: 600px) {
    #chat-container {
        position: fixed !important;
        inset: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        min-width: unset !important;
        max-width: none !important;
        max-height: none !important;
        border-radius: 0 !important;
        right: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        top: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        z-index: 99999 !important;
        display: flex !important;
        flex-direction: column !important;
    }

    .prompt-box:not([style*="display: none"]),
    .chat-bot-bg:not([style*="display: none"]) {
        max-height: none !important;
        height: auto !important;
        flex: 1 1 0 !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
        min-height: 0 !important;
    }

    .prompt-box[style*="display: none"] {
        display: none !important;
    }

    .input-wrapper {
        max-height: none !important;
        height: auto !important;
        flex-shrink: 0 !important;
        overflow: visible !important;
    }

    #messages {
        flex: 1 1 0 !important;
        min-height: 0 !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
    }
}

/* Ensure toggle button is always accessible on zoomed screens */
@media screen and (max-width: 600px) {
    #chatbot-toggle {
        position: fixed !important;
        right: 10px !important;
        bottom: 5px !important;
        z-index: 100000 !important;
    }

    #chatbot-toggle img {
        width: 40px;
        height: 40px;
        display: block;
    }
}

/* Responsive Fullscreen Chatbot: For mobile and for desktop with high zoom */
/* @media screen and (max-width: 500px), (max-height: 650px) {
  #chat-container {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    min-width: 0 !important;
    max-width: none !important;
    max-height: none !important;
    border-radius: 0 !important;
    left: 0 !important;
    right: 0 !important;
    top: 0 !important;
    bottom: 0 !important;
    z-index: 2147483647 !important;
    box-shadow: none !important;
  }
  .prompt-box, .chat-bot-bg, #messages, .input-wrapper {
    max-height: none !important;
    height: auto !important;
    flex: 1 1 0;
    overflow: auto !important;
  }
  #messages {
    height: calc(100vh - 300px) !important;
    min-height: 150px !important;
  }
  #chatbot-toggle {
    right: 16px !important;
    bottom: 18px !important;
    z-index: 2147483648 !important;
  }
} */

/* (Optional) Hide rounded corners for fullscreen mode */



#chat-container.fullscreen-at-zoom {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    min-width: 0 !important;
    max-width: none !important;
    max-height: none !important;
    border-radius: 0 !important;
    left: 0 !important;
    right: 0 !important;
    top: 0 !important;
    bottom: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 2147483647 !important;
    box-shadow: none !important;
    /* DO NOT force display: flex - let JS control it */
    flex-direction: column !important;
    transition: opacity 0.3s ease, transform 0.3s ease !important;
}

/* Fullscreen open animation */
#chat-container.fullscreen-at-zoom[style*="display: flex"] {
    opacity: 1 !important;
    transform: scale(1) !important;
    animation: chatFullscreenIn 0.3s ease-out !important;
}

/* Fullscreen close animation */
#chat-container.fullscreen-at-zoom[style*="display: none"] {
    opacity: 0 !important;
    transform: scale(0.95) !important;
}

@keyframes chatFullscreenIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* When fullscreen and closed, ensure it's hidden */
#chat-container.fullscreen-at-zoom[style*="display: none"] {
    display: none !important;
}

/* When fullscreen and open, show it */
#chat-container.fullscreen-at-zoom[style*="display: flex"] {
    display: flex !important;
}

#chat-container.fullscreen-at-zoom .prompt-box:not([style*="display: none"]) {
    max-height: none !important;
    height: auto !important;
    flex: 0 1 auto !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: visible !important;
    min-height: 0 !important;
    justify-content: flex-start !important;
    align-items: stretch !important;
    padding: 20px !important;
    margin: auto 0 !important;
}

#chat-container.fullscreen-at-zoom .prompt-box[style*="display: none"] {
    display: none !important;
}

#chat-container.fullscreen-at-zoom .chat-bot-bg:not([style*="display: none"]) {
    max-height: none !important;
    height: auto !important;
    flex: 1 1 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    min-height: 0 !important;
}

#chat-container.fullscreen-at-zoom .chat-bot-bg[style*="display: none"] {
    display: none !important;
}

#chat-container.fullscreen-at-zoom .chat-header {
    flex-shrink: 0 !important;
}

#chat-container.fullscreen-at-zoom .chat-bot-bg:not([style*="display: none"]) .input-wrapper {
    max-height: none !important;
    height: auto !important;
    flex-shrink: 0 !important;
    overflow: visible !important;
}

#chat-container.fullscreen-at-zoom .chat-bot-bg[style*="display: none"] ~ .input-wrapper,
#chat-container.fullscreen-at-zoom .chat-bot-bg[style*="display: none"] .input-wrapper {
    display: none !important;
}

#chat-container.fullscreen-at-zoom #messages {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

#chat-container.fullscreen-at-zoom #chatbot-toggle {
    right: 19px !important;
    bottom: 18px !important;
    z-index: 2147483648 !important;
}

/* Hide toggle when fullscreen chat is open */
#chat-container.fullscreen-at-zoom[style*="display: flex"] ~ #chatbot-toggle,
#chat-container.fullscreen-at-zoom[style*="display: block"] ~ #chatbot-toggle {
    display: none !important;
    visibility: hidden !important;
}

/* Show toggle when fullscreen chat is closed */
#chat-container.fullscreen-at-zoom[style*="display: none"] ~ #chatbot-toggle,
#chat-container.fullscreen-at-zoom:not([style*="display: flex"]):not([style*="display: block"]) ~ #chatbot-toggle {
    display: flex !important;
    visibility: visible !important;
}

/* On mobile, hide toggle when chat is open */
@media screen and (max-width: 600px) {
    #chat-container[style*="display: flex"] ~ #chatbot-toggle,
    #chat-container[style*="display: block"] ~ #chatbot-toggle {
        display: none !important;
        visibility: hidden !important;
    }

    #chat-container[style*="display: none"] ~ #chatbot-toggle,
    #chat-container:not([style*="display: flex"]):not([style*="display: block"]) ~ #chatbot-toggle {
        display: flex !important;
        visibility: visible !important;
    }
}

#chatbot-close-floating {
    display: none !important;
    /* Hide by default */
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
    background: transparent !important;
    border: none !important;
    color: #ffffff !important;
    font-size: 2.5rem !important;
    line-height: 1 !important;
    z-index: 1001 !important;
    cursor: pointer !important;
    padding: 0 !important;
    box-shadow: none !important;
    outline: none !important;
    transition: color 0.15s, background 0.15s, transform 0.15s !important;
    width: 40px !important;
    height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
}

#chatbot-close-floating:hover,
#chatbot-close-floating:focus {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.2) !important;
    transform: scale(1.1) !important;
    outline: none !important;
}

#chatbot-close-floating:active {
}

/* Only show on mobile/fullscreen-at-zoom and only when chat is open */
@media (max-width: 650px),
(max-height: 650px) {
    #chatbot-close-floating {
        display: flex !important;
    }

    /* Hide close button when chat is closed */
    #chat-container[style*="display: none"] #chatbot-close-floating,
    #chat-container:not([style*="display: flex"]) #chatbot-close-floating {
        display: none !important;
    }
}

/* Show close button when fullscreen class is active and chat is open */
#chat-container.fullscreen-at-zoom[style*="display: flex"] #chatbot-close-floating,
#chat-container.fullscreen-at-zoom[style*="display: block"] #chatbot-close-floating {
    display: flex !important;
}

#chatbot-toggle {
    position: fixed !important;
    bottom: 16px !important; /* Proper spacing from bottom */
    right: 19px !important; /* Proper spacing from right edge */
    background: #1395ba !important;
    border-radius: 50% !important;
    width: 50px !important;
    height: 50px !important;
    border: none !important;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.15) !important;
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 99999 !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    z-index: 100000 !important;
    cursor: pointer !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
    /* always on top */
}

#chatbot-toggle:hover {
    box-shadow: 0 6px 24px rgba(59, 130, 246, 0.25) !important;
}

#chatbot-toggle:active {
    transform: scale(0.95) !important;
}

/* Ensure toggle button is always visible when chat is closed */
#chat-container[style*="display: none"] ~ #chatbot-toggle,
#chat-container:not([style*="display: flex"]) ~ #chatbot-toggle {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* On mobile/fullscreen: hide toggle when chat is open */
@media screen and (max-width: 600px) {
    #chatbot-toggle {
        position: fixed !important;
        right: 16px !important; /* Ensure proper spacing from edge */
        bottom: 16px !important; /* Ensure proper spacing from bottom */
        width: 50px !important;
        height: 50px !important;
        z-index: 100000 !important;
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        margin: 0 !important;
        padding: 0 !important;
        box-sizing: border-box !important;
    }

    /* Hide toggle when chat is open on mobile */
    #chat-container.fullscreen-at-zoom[style*="display: flex"] ~ #chatbot-toggle,
    #chat-container[style*="display: flex"] ~ #chatbot-toggle {
        display: none !important;
    }
}

/* Desktop: Always show toggle button when NOT in fullscreen mode */
@media screen and (min-width: 601px) {
    #chatbot-toggle {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    /* Ensure toggle is visible on desktop even when chat is open (unless fullscreen) */
    #chat-container:not(.fullscreen-at-zoom) ~ #chatbot-toggle {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    /* Hide toggle only when fullscreen and open */
    #chat-container.fullscreen-at-zoom[style*="display: flex"] ~ #chatbot-toggle {
        display: none !important;
    }
}

@media screen and (max-width: 600px) {
    #chat-container {
        position: fixed !important;
        inset: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        flex-direction: column !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        z-index: 99999 !important;
    }

    .input-wrapper {
        margin: 0 !important;
        padding: 8px 8px !important;
        border-top: 1px solid #ddd !important;
        background: #fff !important;
        min-height: 0 !important;
        height: auto !important;
        flex-shrink: 0 !important;
    }

    .input-row {
        margin: 0 !important;
        padding: 0 4px !important;
        height: auto !important;
        min-height: 0 !important;
        align-items: center !important;
        gap: 6px !important;
    }

    /* Ensure buttons are touch-friendly on mobile */
    .text-bnt {
        min-width: 36px !important;
        min-height: 36px !important;
        padding: 6px !important;
    }

    /* Ensure input is readable on mobile */
    #input {
        font-size: 16px !important; /* Prevents zoom on iOS */
        padding: 10px 8px !important;
    }
}

@media screen and (max-width: 600px) {
    #chat-container {
        position: fixed !important;
        inset: 0 !important;
        flex-direction: column !important;
        width: 100vw !important;
        height: 100vh !important;
        z-index: 99999 !important;
        background: #fff !important;
    }

    /* Key part: FIX the input at the bottom */
    .input-wrapper {
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        padding: 8px !important;
        background: #fff !important;
        box-shadow: 0 -2px 12px rgba(60, 70, 80, 0.08) !important;
        z-index: 999999 !important;
        border-radius: 0 !important;
        border-top: 1px solid #eee !important;
        min-height: 0 !important;
        height: auto !important;
        /* Safe area for notched devices */
        padding-bottom: max(8px, env(safe-area-inset-bottom)) !important;
    }

    /* Give the messages area bottom padding to prevent overlap */
    #messages {
        flex: 1 1 auto !important;
        overflow-y: auto !important;
        padding-bottom: 80px !important;
        /* must be >= .input-wrapper height + safe area */
        margin-bottom: 0 !important;
        min-height: 0 !important;
        max-height: none !important;
        /* Smooth scrolling on iOS */
        -webkit-overflow-scrolling: touch !important;
    }

    /* Ensure chat header is visible on mobile */
    .chat-header {
        padding-top: env(safe-area-inset-top) !important;
    }
}

/* Professional Emoji Picker - Simple and Clean */
#emoji-picker {
    border: 1.5px solid #e4e4e4;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 4px 22px 0 rgba(50, 60, 90, 0.12);
    display: none;
    position: absolute;
    bottom: 65px;
    right: 0;
    z-index: 2222;
    min-width: 280px;
    max-width: 360px;
    max-height: 400px;
    flex-wrap: wrap;
    padding: 12px 14px;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

#emoji-picker span {
    cursor: pointer;
    font-size: 20px;
    padding: 4px;
    display: inline-block;
    transition: transform 0.1s ease, background-color 0.15s ease;
    border-radius: 6px;
    user-select: none;
    line-height: 1.2;
}

#emoji-picker span:hover {
    background-color: #f0f0f0;
}

#emoji-picker span:active {
    background-color: #e0e0e0;
}



.input-actions {
    display: flex;
    justify-content: flex-end;
    gap: 4px;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    position: relative;
    flex-shrink: 0;
    align-items: center;
}

/* Responsive input actions */
@media screen and (max-width: 600px) {
    .input-actions {
        gap: 6px !important;
    }

    .text-bnt {
        min-width: 40px !important;
        min-height: 40px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
}

/* Responsive Emoji Picker - Mobile */
@media (max-width: 600px) {
    #emoji-picker {
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 60px !important;
        top: auto !important;
        width: 100% !important;
        min-width: unset !important;
        max-width: 100% !important;
        max-height: 50vh !important;
        border-radius: 14px 14px 0 0 !important;
        z-index: 2147483647 !important;
        margin: 0 !important;
        padding: 10px 12px !important;
    }

    #emoji-picker span {
        font-size: 22px !important;
        padding: 6px !important;
    }

    /* Ensure emoji picker doesn't overlap with input on mobile */
    #chat-container[style*="display: flex"] .input-wrapper {
        padding-bottom: 0 !important;
    }
}

/* Tablet and smaller desktop */
@media (min-width: 601px) and (max-width: 1200px) {
    #emoji-picker {
        width: 320px !important;
        max-width: 85vw !important;
    }
}


/* Fullscreen mode emoji picker */
#chat-container.fullscreen-at-zoom #emoji-picker {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 60px !important;
    top: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    max-height: 50vh !important;
    border-radius: 14px 14px 0 0 !important;
    z-index: 2147483647 !important;
    margin: 0 !important;
}

/* Additional responsive fixes for all screen sizes */
@media screen and (max-width: 480px) {
    /* Extra small devices */
    #chat-container {
        width: 100vw !important;
        left: 0 !important;
        right: 0 !important;
    }

    .prompt-box {
        padding: 12px !important;
    }

    .prompt-title {
        font-size: 16px !important;
    }

    .bubble {
        font-size: 14px !important;
        padding: 8px 12px !important;
    }
}

@media screen and (min-width: 481px) and (max-width: 768px) {
    /* Small tablets */
    #chat-container {
        width: 90vw !important;
        max-width: 400px !important;
    }
}

@media screen and (min-width: 769px) and (max-width: 1024px) {
    /* Tablets */
    #chat-container {
        width: 380px !important;
    }
}

/* Landscape orientation fixes */
@media screen and (max-height: 500px) and (orientation: landscape) {
    #chat-container {
        max-height: 100vh !important;
    }

    #messages {
        max-height: calc(100vh - 200px) !important;
    }

    .chat-header {
        padding: 8px 0 !important;
    }

    .input-wrapper {
        padding: 6px 8px !important;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    #chatbot-toggle {
        box-shadow: 0 4px 20px rgba(59, 130, 246, 0.2) !important;
    }

    .bubble {
        box-shadow: 0 2px 8px rgba(60, 70, 80, 0.08) !important;
    }
}

/* Print styles - hide chatbot */
@media print {
    #chatbot-toggle,
    #chat-container,
    #emoji-picker {
        display: none !important;
    }
}

/* In your chatbot-widget.css file */

/* Ensure loaded messages maintain proper styling */
.chat-message {
    margin-bottom: 10px;
    animation: fadeIn 0.3s ease-in-out;
}

.user-message {
    justify-content: flex-end;
    /* Your existing user message styles... */
}

.bot-message {
    justify-content: flex-start;
    /* Your existing bot message styles... */
}

/* Add a fade-in animation for messages */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Close icon inside toggle button - Desktop only */
.close-icon-img {
    display: none !important;
    position: absolute !important;
    left: 10px !important;
    top: 10px !important;
    width: 20px !important;
    height: 20px !important;
    pointer-events: none !important;
    visibility: hidden !important;
}

/* Desktop: Show close icon when chat is open, chat icon when closed */
@media screen and (min-width: 601px) {
    /* When chat is open (not fullscreen) */
    #chat-container:not(.fullscreen-at-zoom)[style*="display: flex"] ~ #chatbot-toggle #close-icon-img,
    #chat-container:not(.fullscreen-at-zoom)[style*="display: block"] ~ #chatbot-toggle #close-icon-img {
        display: block !important;
        visibility: visible !important;
    }

    #chat-container:not(.fullscreen-at-zoom)[style*="display: flex"] ~ #chatbot-toggle #chat-icon-img,
    #chat-container:not(.fullscreen-at-zoom)[style*="display: block"] ~ #chatbot-toggle #chat-icon-img {
        display: none !important;
        visibility: hidden !important;
    }

    /* When chat is closed (not fullscreen) */
    #chat-container:not(.fullscreen-at-zoom)[style*="display: none"] ~ #chatbot-toggle #close-icon-img,
    #chat-container:not(.fullscreen-at-zoom):not([style*="display: flex"]):not([style*="display: block"]) ~ #chatbot-toggle #close-icon-img {
        display: none !important;
        visibility: hidden !important;
    }

    #chat-container:not(.fullscreen-at-zoom)[style*="display: none"] ~ #chatbot-toggle #chat-icon-img,
    #chat-container:not(.fullscreen-at-zoom):not([style*="display: flex"]):not([style*="display: block"]) ~ #chatbot-toggle #chat-icon-img {
        display: block !important;
        visibility: visible !important;
    }
}

/* Mobile: Always show chat icon, never show close icon in toggle */
@media screen and (max-width: 600px) {
    .close-icon-img {
        display: none !important;
        visibility: hidden !important;
    }

    #chat-icon-img {
        display: block !important;
        visibility: visible !important;
    }
}
