﻿.fb_dialog, .fb_reset {
    position: fixed !important;
    z-index: 10 !important;
}

#btnChat {
    display: none;
    background: none;
    border-radius: 50%;
    bottom: 18pt;
    display: inline;
    height: 45pt;
    padding: 0px;
    position: fixed;
    right: 54pt !important;
    bottom: 12px !important;
    width: 45pt;
    z-index: 10 !important;
}

.fb_dialog_content {
    display: none;
}

.fb-customerchat {
    background-position-x: 3px;
    background-position-y: -2px;
    background-repeat: no-repeat;
    width: 70px !important;
    height: 70px !important;
    z-index: 10 !important;
    border: none;
    visibility: visible;
    position: fixed;
    width: 70px;
    height: 70px;
}

.fb_dialog {
    display: flex !important;
    width: 100px !important;
}

.fb_iframe_widget iframe {
    height: 489px !important;
    display: none;
    bottom: 112pt !important;
}

.fb_dialog .fb_dialog_content iframe[data-testid~="bubble_iframe"] {
    bottom: 72pt !important;
    right: 1pt !important;
    border-radius: 50% !important;
    height: 57px !important;
    width: 57px !important;
    margin: 2px 15px !important;
}

#fbChat {
    display: none;
}

#iconFB {
    height: 38pt;
    width: 38pt;
    background: #0A7CFF;
    position: fixed;
    bottom: 97px !important;
    right: 16pt !important;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: rgba(0, 0, 0, 0.25) 0px 54px 55px, rgba(0, 0, 0, 0.12) 0px -12px 30px, rgba(0, 0, 0, 0.12) 0px 4px 6px, rgba(0, 0, 0, 0.17) 0px 12px 13px, rgba(0, 0, 0, 0.09) 0px -3px 5px;
    opacity: 0.8;
    animation: showOut var(--timeAnimation);
}

    #iconFB img {
        margin: -10px;
    }

#ChatMessenger {
    width: 100%;
    float: right;
}

#loaderChat {
    position: fixed;
    bottom: 74pt !important;
    right: 18pt !important;
    z-index: 1;
    margin: -3px 0 0 -30px;
    border: 2px solid #e5e5e5;
    border-radius: 50%;
    border-top: 2px solid #3498db;
    -webkit-animation: spin 2s linear infinite;
    animation: spin 2s linear infinite;
    width: 45px;
    height: 46px;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

#chatmenu {
    width: 50px;
    float: right;
    position: fixed;
    bottom: 8pt;
    right: 38px;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -moz-user-select: none;
    -ms-user-select: none;
    cursor: pointer;
}

#chatBotmenu {
    width: 50px;
    float: right;
    position: fixed;
    bottom: 8pt;
    right: 38px;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -moz-user-select: none;
    -ms-user-select: none;
    cursor: pointer;
}

#imgChatBot {
    /*display: none;*/
    /*background: #e7f1ff;*/
    width: 52px;
    height: 52px;
    position: fixed;
    bottom: 65pt !important;
    right: 15px !important;
    /*border-radius: 50%;*/
    text-align: center;
    cursor: pointer;
    opacity: 0.7;
    animation: showOut var(--timeAnimation);
    /*box-shadow: rgba(255, 255, 246, 0.15) 0px 15px 25px, rgba(255, 255, 246, 0.3) 0px 5px 10px;*/
    opacity: 1.1;
}

    #imgChatBot:hover {
        /*background: #ffffff;*/
        /*box-shadow: rgba(0,0,0,0.15) 0px 15px 25px, rgba(0,0,0,0.3) 0px 5px 10px;*/
        opacity: 1.0;
    }

#line-1 {
    display: none;
    position: fixed;
    bottom: 20pt !important;
    right: 22pt !important;
    width: 26pt;
    height: 26pt;
    margin-top: 6%;
    background-color: #ffffff;
    border-radius: 50%;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -moz-user-select: none;
    -ms-user-select: none;
    cursor: pointer;
    background-color: #fff0f0;
}

    #line-1:hover {
        background-color: #fbe4e4;
    }

#imgChat {
    display: none;
    background: #e7f1ff;
    width: 50px;
    height: 50px;
    position: fixed;
    bottom: 15pt !important;
    right: 16px !important;
    border-radius: 50%;
    text-align: center;
    cursor: pointer;
    opacity: 0.7;
    animation: showOut var(--timeAnimation);
}

    #imgChat:hover {
        background: #ffffff;
        box-shadow: rgba(255, 255, 246, 0.15) 0px 15px 25px, rgba(255, 255, 246, 0.3) 0px 5px 10px;
        opacity: 1.1;
    }

#line-2 {
    display: block;
    float: right;
    width: 50px;
    height: 50px;
    margin-top: 5%;
    background-color: #f3f0f0;
    border-radius: 100%;
}

#CloseMenu {
    padding: 10.2px;
}

    #CloseMenu:hover {
        -webkit-animation: spin2 0.5s linear 0.5;
        -moz-animation: spin2 0.5s linear 0.5;
        animation: spin2 0.5s linear 0.5;
    }

@-moz-keyframes spin2 {
    100% {
        -moz-transform: rotate(0deg);
    }
}

@-webkit-keyframes spin2 {
    100% {
        -webkit-transform: rotate(360deg);
    }
}

@keyframes spin2 {
    100% {
        -webkit-transform: rotate(0deg);
        transform: rotate(360deg);
    }
}

@-webkit-keyframes spin {
    0% {
        -webkit-transform: rotate(0deg);
    }

    100% {
        -webkit-transform: rotate(360deg);
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Add animation to "page content" */
.animate-bottom {
    position: relative;
    -webkit-animation-name: animatebottom;
    -webkit-animation-duration: 1s;
    animation-name: animatebottom;
    animation-duration: 1s
}

@-webkit-keyframes animatebottom {
    from {
        bottom: -100px;
        opacity: 0
    }

    to {
        bottom: 0px;
        opacity: 1
    }
}

@keyframes animatebottom {
    from {
        bottom: -100px;
        opacity: 0
    }

    to {
        bottom: 0;
        opacity: 1
    }
}

@media (hover: none) {
    /*a:hover {
        color: inherit;
    }*/
}

@media only screen and (max-width: 600px) {
    .popover-content {
        display: none !important;
    }
}
/*phan cho zalo*/
#iconZalo {
    height: 38pt;
    width: 38pt;
    background: #0A7CFF;
    position: fixed;
    bottom: 13pt !important;
    right: 71pt !important;
    /* padding-left: 7pt; */
    /* padding-top: 7pt; */
    border-radius: 50%;
    opacity: 0.7;
}

    #iconZalo img {
        width: 23pt;
        height: 25pt;
        margin: 7pt 7pt;
    }

#loaderChatZalo {
    position: fixed;
    bottom: 15pt !important;
    right: 72pt !important;
    z-index: 1;
    margin: -3px 0 0 -30px;
    border: 2px solid #e5e5e5;
    border-radius: 50%;
    border-top: 2px solid #3498db;
    -webkit-animation: spin 2s linear infinite;
    animation: spin 2s linear infinite;
    width: 45px;
    height: 46px;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.zalo-chat-widget {
    /*background-image: url('/img/icon-zalo.png');*/
    background-position-x: 3px;
    background-position-y: -2px;
    background-repeat: no-repeat;
    width: 70px !important;
    height: 70px !important;
    z-index: 10 !important;
    border: none;
    visibility: visible;
    position: fixed;
    bottom: 13pt !important;
    right: 71pt !important;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -moz-user-select: none;
    -ms-user-select: none;
    animation: showOut var(--timeAnimation);
}

    .zalo-chat-widget iframe {
        left: auto !important;
        /*right: -838% !important;*/
    }


.logo {
    border-radius: 30px;
    box-shadow: rgba(0, 0, 0, 0.25) 0px 54px 55px, rgba(0, 0, 0, 0.12) 0px -12px 30px, rgba(0, 0, 0, 0.12) 0px 4px 6px, rgba(0, 0, 0, 0.17) 0px 12px 13px, rgba(0, 0, 0, 0.09) 0px -3px 5px !important;
}


#iconChatBot {
    height: 38pt;
    width: 38pt;
    background: #0A7CFF;
    position: fixed;
    bottom: 87px !important;
    right: 75pt !important;
    border-radius: 50%;
    cursor: pointer;
    /*box-shadow: rgba(0, 0, 0, 0.25) 0px 54px 55px, rgba(0, 0, 0, 0.12) 0px -12px 30px, rgba(0, 0, 0, 0.12) 0px 4px 6px, rgba(0, 0, 0, 0.17) 0px 12px 13px, rgba(0, 0, 0, 0.09) 0px -3px 5px;*/
    opacity: 1;
    animation: showOut var(--timeAnimation);
}

    #iconChatBot img {
        margin: -15px;
        width: 73px;
    }

    /*cho chat bot*/
/*.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #1967b2;
    padding: 10px 12px;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    font-weight: bold;
    border-bottom: 1px solid #ddd;
}*/

.chat-title {
    font-size: 14px;
    color: white;
}

.chat-header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.chat-icon {
    cursor: pointer;
    font-size: 14px;
}

.chat-close-btn {
    font-size: 18px;
    cursor: pointer;
    color: white;
    transition: color 0.2s;
}

    .chat-close-btn:hover {
        color: red;
        font-weight: bold;
    }
/*        #chat-box {
            width: 400px;
            height: 300px;
            border: 1px solid #ccc;
            overflow-y: scroll;
            padding: 10px;
        }
        .msg { margin: 5px 0; }
        .user { color: blue; }
        .bot { color: green; }*/

:root {
    --chat-icon-size: 56px; /* kích thước icon chatbot */
    --chat-gap: 5px; /* khoảng cách giữa popup và icon */
    --chat-offset-x: 20px; /* dịch popup sang trái, giảm từ 100px xuống còn 80px để gần icon hơn */
    --chat-offset-y: 30px; /* dịch popup lên cao hơn một chút */
}

#ChatMessengerBot {
    position: fixed;
    right: calc(var(--chat-offset-x) + var(--chat-icon-size));
    bottom: calc(var(--chat-icon-size) + var(--chat-gap) + var(--chat-offset-y)); /* chừa icon + gap + offset */
    left: auto;
    width: auto;
    z-index: 9999;
}



#user-input {
    flex-grow: 1;
    border: 1px solid #ccc;
    padding: 8px;
    border-radius: 6px;
}

#send-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 8px 12px;
    margin-left: 5px;
    border-radius: 6px;
    cursor: pointer;
}

.bot-msg, .user-msg {
    display: flex;
    margin-bottom: 10px;
    align-items: flex-start;
}

    .bot-msg .avatar, .user-msg .avatar {
        width: 30px;
        height: 30px;
        border-radius: 50%;
        margin-right: 8px;
    }

    .bot-msg .msg-content {
        background: #eee;
        padding: 10px;
        border-radius: 10px;
        max-width: 220px;
    }

.user-msg {
    justify-content: flex-end;
}

    .user-msg .msg-content {
        background: #007bff;
        color: white;
        padding: 10px;
        border-radius: 10px;
        max-width: 220px;
    }

.quick-replies {
    display: block;
    margin-top: 10px;
    padding-left: 40px; /* Căn ngang với nội dung bot */
}

.quick-btn {
    display: block; /* Mỗi nút 1 dòng */
    width: fit-content; /* Tự điều chỉnh theo nội dung */
    margin-bottom: 8px; /* Cách nhau 1 chút */
    background-color: #f1f1f1;
    border: none;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

    .quick-btn:hover {
        background-color: #e0e0e0;
    }

.typing span {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin: 0 2px;
    background-color: #999;
    border-radius: 50%;
    animation: blink 1.4s infinite both;
}

    .typing span:nth-child(2) {
        animation-delay: 0.2s;
    }

    .typing span:nth-child(3) {
        animation-delay: 0.4s;
    }

@keyframes blink {
    0% {
        opacity: 0.2;
        transform: translateY(0);
    }

    20% {
        opacity: 1;
        transform: translateY(-4px);
    }

    100% {
        opacity: 0.2;
        transform: translateY(0);
    }
}
    /*cho chat bot*/

#chat-container {
    width: clamp(320px, 28vw, 420px);
    height: calc(100vh - (var(--chat-icon-size) + var(--chat-gap) + var(--chat-offset-y)));
    min-height: 360px;
    max-height: calc(100vh - var(--chat-gap));
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    resize: both; /* kéo được ở góc phải; góc trái cần JS nếu muốn */
}

.chat-header {
    height: 40px;
    flex: 0 0 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    background: #3b81f6;
    color: #fff;
    font-weight: 600;
    border-bottom: 1px solid #ddd;
}

#chat-body {
    position: relative;
    flex: 1 1 auto;
    min-height: 0; /* tránh overflow khi dùng flex */
}

#chat-iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.corner {
    position: absolute;
    width: 12px;
    height: 12px;
    z-index: 5;
    background: transparent;
}

    .corner.nw {
        left: -2px;
        top: -2px;
        cursor: nw-resize;
    }

    .corner.ne {
        right: -2px;
        top: -2px;
        cursor: ne-resize;
    }

    .corner.sw {
        left: -2px;
        bottom: -2px;
        cursor: sw-resize;
    }

    .corner.se {
        right: -2px;
        bottom: -2px;
        cursor: se-resize;
    }

    .corner:hover {
        background: rgba(0,0,0,0.08);
        border-radius: 2px;
    }
/* Nút góc resize (nếu cần) luôn hiển thị đúng */
.corner {
    position: absolute;
    width: 12px;
    height: 12px;
    z-index: 5;
    background: transparent;
}

    .corner.nw {
        left: -2px;
        top: -2px;
        cursor: nw-resize;
    }

    .corner.ne {
        right: -2px;
        top: -2px;
        cursor: ne-resize;
    }

    .corner.sw {
        left: -2px;
        bottom: -2px;
        cursor: sw-resize;
    }

    .corner.se {
        right: -2px;
        bottom: -2px;
        cursor: se-resize;
    }

@media (max-width: 768px) {
    #ChatMessengerBot {
        right: 8px;
        bottom: calc(8px + var(--chat-icon-size) + 8px);
    }

    #chat-container {
        width: auto;
        height: calc(100vh - var(--chat-icon-size) - var(--chat-gap) - var(--chat-offset-y));
        max-width: 100%;
        border-radius: 12px;
    }
}

.popover {
    z-index: 10050 !important; /* cao hơn popup (9999) */
}