/*chat bot*/
/* Floating Action Button */
.fab-container {
    position: fixed;
    bottom: 20px;
    right: 60px;
    z-index: 9999;
}

.fab-main {
    width: 75px;
    height: 75px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;

    /* glass effect */
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);

    display: flex;
    align-items: center;
    justify-content: center;

    position: relative;
    overflow: visible;

    /* shadow แบบลอย */
    box-shadow:
            0 8px 24px rgba(0, 0, 0, 0.15),
            inset 0 1px 0 rgba(255, 255, 255, 0.4);

    transition: all 0.25s ease;
}


.fab-img {
    width: 170px;
    height: 150px;
    object-fit: contain;
    pointer-events: none;
    position: absolute;
    top: -55px;     
    left: 50%;
    transform: translateX(-50%);
}


/* เมนู */
.fab-menu {
    position: absolute;
    bottom: 100px;
    right: 60px;
    display: none;
    flex-direction: column;
    gap: 10px;
}

/* แต่ละรายการ */
.fab-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    padding: 10px 15px;
    border-radius: 30px;
    color: #333;
    text-decoration: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    white-space: nowrap;
    transition: all 0.2s ease;
}

.fab-item:hover {
    background: #f1f1f1;
}

/* แสดงเมนู */
.fab-menu.show {
    display: flex;
}

/* ===== FAB Chatbot Unread — ring around mascot + bouncing bubble ===== */
.fab-unread-ring {
    position: absolute;
    width: 120px;
    height: 120px;
    top: -34px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 50%;
    border: 3px solid #ef4444;
    box-shadow: 0 0 0 3px rgba(239,68,68,.15);
    display: none;
    pointer-events: none;
    z-index: 1;
}
.fab-unread-ring.show {
    display: block;
    animation: fab-img-ring 1.8s ease-out infinite;
}
@keyframes fab-img-ring {
    0%   { opacity: 1; transform: translateX(-50%) scale(1);    }
    100% { opacity: 0; transform: translateX(-50%) scale(1.28); }
}

.fab-unread-bubble {
    position: absolute;
    top: -80px;
    left: 50%;
    transform: translateX(-50%);
    background: #ef4444;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 5px 13px;
    border-radius: 20px;
    white-space: nowrap;
    display: none;
    box-shadow: 0 4px 14px rgba(239,68,68,.45);
    z-index: 2;
    pointer-events: none;
}
.fab-unread-bubble::after {
    content: '';
    position: absolute;
    bottom: -7px;
    left: 50%;
    transform: translateX(-50%);
    border: 7px solid transparent;
    border-top-color: #ef4444;
    border-bottom: none;
}
.fab-unread-bubble.show {
    display: block;
    animation: fab-bubble-bounce 1.8s ease-in-out infinite;
}
@keyframes fab-bubble-bounce {
    0%, 100% { transform: translateX(-50%) translateY(0);    }
    50%       { transform: translateX(-50%) translateY(-7px); }
}

.biz-portal .fab-container {
    bottom: 120px;
    right: 16px;
}

.fab-container {
    opacity: 0.4;
    transform: scale(0.62);
    transform-origin: bottom right;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.fab-container:hover,
.fab-container:focus-within,
.fab-container.fab-awake {
    opacity: 1;
    transform: none;
}

.fab-container:not(:hover):not(:focus-within):not(.fab-awake) .fab-unread-ring.show,
.fab-container:not(:hover):not(:focus-within):not(.fab-awake) .fab-unread-bubble.show {
    animation: none;
}

@media (prefers-reduced-motion: reduce) {
    .fab-container { transform: none; transition: opacity 0.3s ease; }
}
