@font-face {
    font-family: 'My Font';
    src: url('../lib/font/1FTV-HF-Gesco.ttf') format('truetype');
}

.right-corner-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9998;
    gap: 10px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-family: 'My Font', sans-serif;
}

.button-to-top {
    position: relative;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #C70E1C;
    border: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 10px #ffffff, 0 0 20px #ffffff, 0 0 30px #ffffff;
    cursor: pointer;
    transition-duration: 0.3s;
    overflow: hidden;
    transform-origin: right;
    /*z-index: 9998;*/
}

.button-to-top .svgIcon {
    width: 20px;
    transition-duration: 0.3s;
}

.button-to-top .svgIcon path {
    fill: white;
}

.button-to-top:hover {
    width: 140px;
    border-radius: 50px;
    transition-duration: 0.3s;
    background: #C70E1C;
    align-items: center;
}

.button-to-top:hover .svgIcon {
    transition-duration: 0.3s;
    transform: translateY(-200%);
}

.button-label {
    position: absolute;
    bottom: 15px;
    left: 50%;
    width: 100%;
    transform: translateX(-50%) translateY(10px);
    font-size: 14px;
    color: white;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.button-to-top:hover .button-label {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.button-to-top:hover::before {
    font-size: 13px;
    opacity: 1;
    bottom: unset;
    transition-duration: 0.3s;
}

.chatbox-hider {
    display: none;
    width: 400px;
    height: 600px;
    justify-content: center;
    align-items: flex-start;
    flex-direction: column;
    background: #FFEFD6;
    border-radius: 10px;
    border: 5px solid #FCB92C;
    box-shadow: 10px 10px 20px rgba(255, 239, 214, 0.47);
}

.chatbox-hider.active {
    display: flex;
}

.chatboxbtn.hidden {
    display: none;
}

.chat-box-top {
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    gap: 10px;
    flex-shrink: 0;
    border-bottom: 2px #FCB92C solid;
}

.chat-box-top .chat-more {
    text-decoration: none;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #0A4D3C;
    flex-shrink: 0;
    position: relative;
    transition: all 0.3s ease;
}

.chat-box-top .chat-more:hover {
    background: #0A4D3C;
    color: #FFEFD6;
}

.chat-box-top img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #C70E1C;
    border: 3px solid #FCB92C;
    cursor: pointer;
}

.chat-box-top .chat-with {
    width: 90%;
    color: black;
}

.chat-box-top .chat-with span {
    color: #0A4D3C;
}

.chat-box-top .btn-close {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    color: #C70E1C;
    cursor: pointer;
    flex-shrink: 0;
    border: none;
    background: #FFEFD6;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    text-decoration: none;
    transition: all 0.3s ease;
}

.chat-box-top .btn-close:hover {
    background: #C70E1C;
    color: #FFEFD6;
}

.chat-more-popup {
    position: absolute;
    top: -50px;
    /* Đặt popup ở trên đầu chat-more */
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    /* Dịch xuống 10px ban đầu */
    background: #808080;
    color: #FCB92C;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 16px;
    white-space: nowrap;
    opacity: 0;
    /* Ẩn mặc định */
    visibility: hidden;
    /* Ẩn hoàn toàn */
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
    /* Không cho phép tương tác với popup */
    z-index: 10000;
    /* Đảm bảo popup ở trên cùng */
}

.btn-close .chat-more-popup {
    color: #C70E1C;
}

.chat-box-top .chat-more:hover .chat-more-popup {
    opacity: 1;
    /* Hiển thị khi hover */
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    /* Dịch lên vị trí đúng */
}

.chat-box-top .btn-close:hover .chat-more-popup {
    opacity: 1;
    /* Hiển thị khi hover */
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.chat-box-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
    height: 100%;
    padding: 10px;
    gap: 10px;
    max-height: 500px;
    overflow-y: auto;
    overflow-x: hidden;
}

.message-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    min-height: 40px;
    width: 100%;
    gap: 10px;
}

.message-container:hover .message-function {
    display: flex;
}

.message-text {
    background: #0A4D3C;
    color: #FFEFD6;
    padding: 10px;
    border-radius: 10px;
    width: fit-content;
    height: fit-content;
    max-width: 170px;
    word-wrap: break-word;
    /* ✅ hoặc dùng word-break: break-word; */
    overflow-wrap: break-word;
}


.message-function {
    display: none;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    width: fit-content;
    gap: 10px;
}

.message-function a {
    text-decoration: none;
    color: #000000;
    background: #d9d9d9;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
}

.message-function a:hover {
    background: #adadad;
}

.you {
    /*display: flex;*/
    flex-direction: row-reverse;
}

.chat-input-form {
    width: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    border-top: 1px solid #FCB92C;
    padding-top: 10px;
}


.button-more {
    display: flex;
    flex-direction: row;
    width: fit-content;
}

.button-more a {
    text-decoration: none;
    color: #0A4D3C;
    background: rgba(217, 217, 217, 0);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-radius: 10px;
    font-size: 24px;
}

.button-more a:hover {
    background: #0A4D3C;
    color: #FFEFD6;
}

.message-input {
    width: 100%;
}

.message-input input {
    width: 100%;
    height: 40px;
    border-radius: 10px;
    background: white;
    color: #0A4D3C;
    font-size: 16px;
    font-family: 'My Font', sans-serif;
    padding: 0 10px;
}

.chat-input-form .send {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0);
    color: #0A4D3C;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 20px;
    transition: all 0.4s ease;
    cursor: pointer;
}

.chat-input-form .send:hover {
    background: #0A4D3C;
    color: #FFEFD6;
}

.chat-box-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid #FCB92C;
    flex-shrink: 0;
    overflow: hidden;
    object-fit: cover;
}

@media screen and (max-width: 800px) {
    .chatbox-hider {
        width: 350px;
    }

    .chat-box-top .chat-with {
        font-size: 20px;
    }
}