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

#chatbot-toggle img {
    width: 30px;
    /* or whatever looks best */
    height: 30px;
    display: block;
}

#chatbot-toggle:hover {
    transform: scale(1.05);
}

#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: 5px;
    z-index: 998;
    max-height: 90vh;
    overflow: hidden;
    background: white;
    box-shadow: 0px 0px 5px 1px rgb(0, 0, 0, 0.3);
}

@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: 5px;
                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;
    }
}

h3 {
    text-align: center;
    color: var(--primary);
    font-size: 20px;
    margin-bottom: 10px;
}

#messages {
    height: 250px;
    overflow-y: auto;
    /* 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;
    flex-grow: 1;
    padding: 0px 10px 0 10px;
    font-size: 14px;
    outline: none;
    background: white;
    color: rgb(0, 0, 0);
}

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

.text-bnt {
    color: #a0a0a0;
    border: solid white 0px;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.3s;
    margin-bottom: 0px;
    background: white;
}

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

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


.next-btn {
    color: rgb(255, 255, 255);
    border: solid white 0px;
    padding: 5px 10px 5px 10px;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.3s;
    background: #2563eb;
}

.email-btn {
    color: rgb(255, 255, 255);
    border: solid white 0px;
    padding: 10px 10px 5px 10px;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.3s;
    background: #2563eb;
}

.location-btn {
    color: rgb(255, 255, 255);
    border: solid white 0px;
    padding: 10px;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.3s;
    background: #2563eb;
}

.skip-location-btn {
    color: rgb(255, 255, 255);
    border: solid white 0px;
    padding: 10px;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.3s;
}



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

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

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

.preset-btn {
    flex: 1;
    padding: 8px;
    font-size: 13px;
    background: var(--preset-bg);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
    color: white;
    min-width: 0;
}

/* .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;
}

input[type="text"],
input[type="email"] {
    /* border-radius: 8px; */
    border: 1px solid #ffffff;
    background: white;
    color: black;
    width: 100%;
    font-size: 14px;
    outline: none;
    box-shadow: none;
    /* outline: none; */
}

input[type="text"]::placeholder,
input[type="email"]::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;
}

.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;
}

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

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

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

.prompt-label {
    margin-top: 15px;
    font-size: 11px;
    color: #008dff;
}


.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: 80vh;
    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;
}


.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: 80%;
    height: 80%;
    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-top: 5px;
    margin-bottom: -5px;
}

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

.msg.bot .bubble {
    background: #1877f2;
    color: #fff;
    font-weight: 500;
    margin-left: 50px;
    max-width: 200px;
}

.msg.agent .bubble {
    background: #1877f2;
    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: #1877f2;
  color: #fff;
}

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

.timestamp-line {
    width: 100%;
    text-align: center;
    color: #696969;
    font-size: 0.61rem;
    margin: 16px 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%, #2563eb 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, #2563eb 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;
}

.msg-menu {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #ffffff;
    padding: 0;
}

.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;
}

.chat-btn-main {
    align-items: center;
    background: #1877f2;
    border: none;
    border-radius: 10px;
    color: #fff;
    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; */
}

.chat-btn-main:hover,
.chat-btn-main:focus {
    background: #0e63c7;
    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: #1877f2;
    /* your base color */
    overflow: hidden;
    padding: 0 0 10px 0;
    /* box-shadow: 0 1px 8px rgba(44, 84, 255, 0.04); */
    /* min-width: 330px; */
    position: relative;
}

.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;
}




.crisp-chat-btn {
    display: flex;
    align-items: center;
    background: #005cdb;
    border: none;
    border-radius: 10px;
    padding: 0px 6px 0px 6px;
    font-size: 19px;
    color: #fff;
    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;
}


.chat-icon-circle {
    width: 32px;
    height: 32px;
    background: #005cdb;
    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;
}

.header-menu-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 25px;
    cursor: pointer;
    padding: 0 7px;
    border-radius: 5px;
    transition: background 0.16s;
    margin-left: auto;
}

.header-menu-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.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: #1877f2;
    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 {
    transform: scale(1.07);
}

#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-row {
    display: flex;
    /* flex: 1; */
    gap: 10px;
    height: 50px;
}

.input-actions {
    display: flex;
    justify-content: flex-end;
    gap: 4px;
    margin-top: 5px;
    /* 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;
}

.agent-input-wrapper textarea {
    border: none;
    outline: none;
    font-size: 15px;
    resize: none;
    overflow: hidden;
    width: 100%;
    color: #333;
    line-height: 1.6;
}

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

.agent-toolbar button {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px 6px;
    font-size: 16px;
    color: #333;
}

.agent-toolbar button:hover {
    background: #f0f0f0;
    border-radius: 6px;
}

.agent-toolbar .right-actions button.sendBtn {
    background: #2563eb;
    color: white;
    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: #1877f2;
    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: #468ee5;
    border: 1px solid #fff;
    outline: 3px solid #1877f2;
    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;
        z-index: 99999 !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(105vh - 300px) !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;
    z-index: 2147483647 !important;
    box-shadow: none !important;
}

#chat-container.fullscreen-at-zoom .prompt-box,
#chat-container.fullscreen-at-zoom .chat-bot-bg,
#chat-container.fullscreen-at-zoom #messages,
#chat-container.fullscreen-at-zoom .input-wrapper {
    max-height: none !important;
    height: auto !important;
    /* flex: 1 1 0; */
    overflow: auto !important;
}

#chat-container.fullscreen-at-zoom #messages {
    height: calc(100vh - 300px) !important;
    /* Adjust this value */
    min-height: 80px !important;
    /* reduce min-height if needed */
}

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

#chatbot-close-floating {
    display: none;
    /* Hide by default */
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 1.5rem;
    line-height: 1;
    z-index: 1001;
    cursor: pointer;
    padding: 0;
    box-shadow: none;
    outline: none;
    opacity: 0.95;
    transition: color 0.15s, background 0.15s;
}

#chatbot-close-floating:hover,
#chatbot-close-floating:focus {
    color: #000000;
    background: transparent;
    outline: none;
}

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

#chatbot-toggle {
    position: fixed;
    bottom: 15px;
    right: 19px;
    background: #1877f2;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    border: none;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    z-index: 100000;
    /* always on top */
}

@media screen and (max-width: 600px) {
    #chatbot-toggle {
        right: 19px !important;
        bottom: 15px !important;
        width: 50px;
        height: 50px;
    }
}

@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: 0 8px 0 8px !important;
        border-top: 1px solid #ddd !important;
        background: #fff !important;
    }

    .input-row {
        margin: 0 !important;
        padding-right: 15px !important;
        height: 50px !important;
        align-items: center !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: 0 8px 8px 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;
    }

    /* Give the messages area bottom padding to prevent overlap */
    #messages {
        flex: 1 1 auto !important;
        overflow-y: auto !important;
        padding-bottom: 65px !important;
        /* must be >= .input-wrapper height */
        margin-bottom: 0 !important;
        min-height: 0 !important;
        max-height: none !important;
    }
}

#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;
    /* directly above input row */
    right: 0;
    /* aligns to the rightmost action btn */
    z-index: 2222;
    min-width: 280px;
    max-width: 360px;
    flex-wrap: wrap;
    padding: 8px 14px 8px 14px;
}


.input-actions {
    display: flex;
    justify-content: flex-end;
    gap: 4px;
    margin-top: 5px;
    position: relative;
    /* <-- THIS IS KEY */
}

@media (max-width: 600px) {
    #emoji-picker {
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 60px !important;
        /* Above input row */
        min-width: unset !important;
        max-width: unset !important;
        border-radius: 14px 14px 0 0 !important;
        z-index: 2147483647 !important;
        display: none;
    }
}

@media (max-width: 1200px) {
    #emoji-picker {
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 60px !important;
        border-radius: 14px 14px 0 0 !important;
        z-index: 2147483647 !important;
        display: none;
    }
}

/* 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);
    }
}

@media screen and (max-width: 767px) {
    .close-icon-img{
                display: block;
                position: absolute;
                left: 5px !important;
                top: 5px !important;
    } 
}
  .close-icon-img {
      display: none;
      position: absolute;
      left: 10px ;
      top: 10px ;
  }