/* Sunlight Realtors – Chatbot Styles
   Theme: brand-green (#68a742) + brand-dark (#13231e) */

/* ── Floating button ── */
#chat-square {
    position: fixed !important;
    bottom: 24px !important;
    right: 24px !important;
    width: 56px !important;
    height: 56px !important;
    border-radius: 50% !important;
    background-color: #68a742 !important;
    cursor: pointer !important;
    z-index: 99999 !important;
    border: none !important;
    box-shadow: 0 4px 16px rgba(104,167,66,0.45) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    transition: transform 0.3s ease, background-color 0.3s ease;
    animation: chatbot-pulse 2s ease-in-out infinite;
}
#chat-square:hover {
    background-color: #13231e !important;
    transform: scale(1.08);
    animation: none;
}
@keyframes chatbot-pulse {
    0%, 100% {
        box-shadow: 0 4px 16px rgba(104,167,66,0.45), 0 0 0 0 rgba(104,167,66,0.6);
    }
    50% {
        box-shadow: 0 4px 16px rgba(104,167,66,0.45), 0 0 0 12px rgba(104,167,66,0);
    }
}

/* ── Close button ── */
#chat-close {
    position: fixed !important;
    bottom: 24px !important;
    right: 24px !important;
    width: 56px !important;
    height: 56px !important;
    cursor: pointer !important;
    z-index: 99999 !important;
    display: none;
    align-items: center;
    justify-content: center;
    background-color: #13231e !important;
    border-radius: 50% !important;
    border: none !important;
    pointer-events: auto !important;
    box-shadow: 0 4px 16px rgba(19,35,30,0.35);
}
#chat-close.active {
    display: flex !important;
}
#chat-close:hover {
    background-color: #68a742 !important;
}
.close-img { display: none; } /* hide the old SVG close image */

/* ── Chat window ── */
.chat-wrapper {
    display: none;
    position: fixed;
    bottom: 92px;
    right: 24px;
    width: 365px;
    max-width: 85vw;
    height: 79%;
    max-height: 580px;
    border-radius: 10px;
    border: 1.5px solid #68a742;
    box-shadow: 0 8px 32px rgba(19,35,30,0.18);
    z-index: 99998;
    background: #fff;
}

/* ── Header ── */
.chat-header {
    height: 52px;
    background: linear-gradient(135deg, #13231e 0%, #1e3329 100%);
    border-bottom: 2px solid #68a742;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    display: flex;
    align-items: center;
    padding: 10px 14px;
    color: #fff;
}
.chat-header-photo {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid #68a742;
    margin-right: 12px;
    margin-left: 4px;
    position: relative;
    background-color: #68a742;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.chat-header-photo::after {
    content: "\f075";
    font-family: "Font Awesome 5 Free", "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 16px;
    color: #fff;
}
.active-circle {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #22c55e;
    position: absolute;
    right: -1px;
    bottom: 0;
    border: 2px solid #13231e;
    z-index: 1;
}
.chat-header-name {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.4px;
    line-height: 20px;
}

/* ── Body & logs ── */
.chat-box-body {
    position: relative;
    height: calc(100% - 52px);
    background: #fcfcfc;
    border-radius: 0 0 10px 10px;
    overflow: hidden;
}
.chat-logs {
    height: calc(100% - 48px);
    overflow-y: auto;
    font-size: 14px;
    background: #fcfcfc;
}
.chat-container {
    background: #fcfcfc;
    padding: 0 18px 12px;
}

/* ── Messages ── */
.hb-message {
    margin: 5px 0;
    min-height: 20px;
    position: relative;
    padding: 0 0 0 40px;
}
.hb-message:after {
    display: block;
    content: "";
    clear: both;
    margin-bottom: -10px;
}
.hb-message-content {
    padding: 8px 12px;
    color: #3D454A;
    background-color: #F2F2F2;
    border-radius: 6px;
    letter-spacing: -0.07px;
    line-height: 17px;
    width: auto;
    max-width: 80%;
    display: inline-block;
    margin-top: 15px;
}
.hb-message-content.human {
    color: #fff;
    background-color: #13231e;
    border: 1px solid #13231e;
    border-radius: 6px;
}
.hb-message.human {
    text-align: right;
}
.hb-message-content.loading {
    background-color: transparent !important;
    line-height: 1.3;
    text-align: center;
    border: none;
}

/* ── Bot avatar pseudo-elements (scoped to inner content div only) ── */
.hb-message-content.start::before,
.hb-message-content.text_start_end::before {
    content: "Sunlight Support";
    display: block;
    font-size: 10px;
    line-height: 13px;
    margin: 18px 0 -5px;
    color: #68a742;
    letter-spacing: 0.5px;
    font-weight: 600;
}
.hb-message-content.end::after,
.hb-message-content.text_start_end::after {
    content: "\f075";
    font-family: "Font Awesome 5 Free", "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 14px;
    color: #fff;
    background-color: #68a742;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    left: 2px;
    bottom: -8px;
    line-height: 30px;
    text-align: center;
    margin-bottom: 12px;
}

/* ── Typing dots ── */
.dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    display: inline-block;
    background-color: #333;
}
.hb-message-content .dot:nth-last-child(5) { animation: 0.6s linear 0.1s infinite chatLoading; }
.hb-message-content .dot:nth-last-child(4) { margin-left: 0.2rem; animation: 0.6s linear 0.2s infinite chatLoading; }
.hb-message-content .dot:nth-last-child(3) { margin-left: 0.2rem; animation: 0.6s linear 0.3s infinite chatLoading; }
.hb-message-content .dot:nth-last-child(2) { margin-left: 0.2rem; animation: 0.6s linear 0.4s infinite chatLoading; }
.hb-message-content .dot:nth-last-child(1) { margin-left: 0.2rem; animation: 0.6s linear 0.5s infinite chatLoading; }
@keyframes chatLoading {
    0%, 50% { transform: translate(0,0); background-color: #ababab; }
    25%      { transform: translate(0,-3px); }
    75%      { transform: translate(0,3px); }
    100%     { transform: translate(0,0); }
}
.loading {
    float: right;
    white-space: nowrap;
    overflow: hidden;
    margin-right: 10px;
}

/* ── Action buttons ── */
.hb-actions-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    width: 225px;
    float: right;
    margin-top: 16px;
}
button.hb-actions-buttons-button {
    border: 1px solid #68a742;
    color: #13231e !important;
    line-height: 1;
    cursor: pointer;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 6px;
    background: #fff;
    box-shadow: 2px 3px 4px 0 rgba(174,174,174,0.25);
    overflow: hidden;
    font-size: 13px;
    margin-top: 8px;
    margin-bottom: 8px;
}
button.hb-actions-buttons-button:not(:first-child) { margin-left: 8px; }
button.hb-actions-buttons-button:hover {
    background: #68a742;
    color: #fff !important;
    border-color: #68a742;
}
button.hb-actions-buttons-button:active {
    box-shadow: none;
    transform: translateY(3px);
}

/* ── Input fields ── */
.chat-elements {
    display: inline-block;
    height: 40px;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    border: 1px solid #818181;
    border-radius: 6px;
    padding: 0 10px 0 16px;
    margin: 10px 9px 10px 0;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    width: 84%;
}
.chat-elements:focus-visible {
    outline: none;
    border-color: #68a742 !important;
    box-shadow: 0 0 0 2px rgba(104,167,66,0.2);
}
.chat-elements.country-dropdown { width: 25%; }
.chat-elements.mobile-text { width: 57%; padding: 0 8px; border-radius: 6px; overflow: hidden; height: 40px; }

.hb-actions-text-submit {
    color: #fff;
    width: 40px;
    height: 40px;
    padding: 5px;
    line-height: 1;
    border-radius: 50%;
    border: none;
    background: #68a742;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}
.hb-actions-text-submit:hover {
    background: #13231e;
}
.hb-actions-email {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    align-items: center;
}

/* ── Footer / time ── */
.chat-footer {
    position: absolute;
    bottom: 0;
    left: 5%;
    width: 90%;
    background: #fcfcfc;
    color: #000;
}
.chat-messages-time {
    font-size: 10px;
    color: #3D454A;
    padding: 15px 0 0;
    text-align: center;
    text-transform: uppercase;
    line-height: 13px;
}
.hb_message_time {
    opacity: 0;
    font-size: 10px;
    color: #353f45;
    transition: all 0.3s ease;
    transition-delay: 0.35s;
    top: 56%;
    position: absolute;
    padding: 0 6px;
    white-space: nowrap;
}
.human .hb_message_time { left: 0; }
.hb-message:hover .hb_message_time { opacity: 1; }
.hb_message_time_flash {
    display: block;
    font-size: 10px;
    color: #353f45;
    padding: 0 6px;
}

/* ── Required msg ── */
#required_msg, #text_required_msg {
    display: none;
    margin-top: -12px;
    color: red;
    padding-left: 10px;
    font-size: 13px;
}

/* ── Small popup ── */
.chat-pop-sm {
    display: none;
    position: fixed;
    bottom: 92px;
    right: 24px;
    z-index: 99997;
    background: #fff;
    height: 135px;
    width: 235px;
    text-align: center;
    padding: 15px 20px 10px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(19,35,30,0.15);
    font-size: 15px;
    border: 1px solid rgba(104,167,66,0.3);
}
button.chat-pop-sm-btn {
    font-size: 15px;
    font-weight: bold;
    padding: 9px 13px;
    background-color: #68a742;
    border: none;
    border-radius: 26px;
    width: 160px;
    margin-top: 9px;
    color: #fff;
    cursor: pointer;
}
button.chat-pop-sm-btn:hover {
    background-color: #13231e;
    color: #fff;
}

.display_none { display: none; }

/* ── Responsive ── */
@media (max-width: 767px) {
    #chat-square { bottom: 72px !important; right: 16px !important; }
    #chat-close {
        bottom: 72px !important;
        right: 16px !important;
    }
    .chat-wrapper {
        position: fixed;
        top: 0; bottom: 0; right: 0;
        width: 100%;
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
        box-shadow: none;
        height: auto;
        padding: 0;
        margin: 0;
    }
    .chat-box-body {
        height: calc(100% - 52px - 80px);
    }
    .chat-footer {
        bottom: 10px !important;
        position: fixed !important;
    }
}
