/*float chat btn*/
.float-gma-chat-btn {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='30px' viewBox='0 -960 960 960' width='30px' fill='%23e3e3e3'%3E%3Cpath d='M240-399.33h315.33V-466H240v66.67ZM240-526h480v-66.67H240V-526Zm0-126.67h480v-66.66H240v66.66ZM480-80 375-238H146.67q-27.5 0-47.09-19.58Q80-277.17 80-304.67v-508.66q0-27.5 19.58-47.09Q119.17-880 146.67-880h666.66q27.5 0 47.09 19.58Q880-840.83 880-813.33v508.66q0 27.5-19.58 47.09Q840.83-238 813.33-238H585L480-80Zm0-120 69.33-104.67h264v-508.66H146.67v508.66h264L480-200Zm0-359.33Z'/%3E%3C/svg%3E");
    background-color: var(--chat-primary-color);
    background-repeat: no-repeat;
    background-position: center;
    outline: 1px solid var(--chat-primary-color);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    position: fixed;
    z-index: 99999;
    right: 5px;
    bottom: 5px;
    box-shadow: 1px 0px 5px 0px #0000006b;
    cursor: pointer;
    transition: .3s;
    animation: jump-once 1s ease;
}

.float-gma-chat-btn:hover {
    background-color: var(--chat-primary-color);
    transform: translateY(-5px);
    outline: 1px solid #fff;
}

.float-gma-chat-btn.actived {
    outline: 1px solid #fff;
}

/* 彩色旋轉邊框 - 暗沈風格 */
.float-gma-chat-btn.actived::before {
    content: "";
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background: conic-gradient(
        #dc3545, 
        #ffc107, 
        #198754,
        #0b854d,
        var(--chat-primary-color),
        #720eec,
        #dc3545
    );
    border-radius: 50%;
    animation: rotateColors 3s linear infinite;
    z-index: -1;
}

/* 確保按鈕內容不被覆蓋 */
.float-gma-chat-btn.actived::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: inherit; /* 繼承按鈕原有背景 */
    border-radius: 50%;
    z-index: -1;
}



/*float chat container*/
.float-gma-chat-container {
    display: none;
    position: fixed;
    z-index: 99999;
    right: 5px;
    padding: 45px 15px 15px 15px;
    bottom: 70px;
    max-height: 600px;
    max-width: 340px;
    width: 100%;
    height: 100%;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0px 2px 6px -2px #0000006b;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="120" height="120" viewBox="0 0 120 120"><rect fill="%23e6f0ff" opacity="0.2" x="15" y="25" width="35" height="35" rx="6"/><rect fill="%23d4e6ff" opacity="0.15" x="70" y="50" width="30" height="30" rx="6"/><circle fill="%23c2dcff" opacity="0.18" cx="40" cy="80" r="18"/></svg>'), linear-gradient(#ffffff, #f8fbff);
    background-size: cover;
}

.float-gma-chat-head {
    position: absolute;
    top: 0;
    left: 0;
    color: #fff;
    background: var(--chat-primary-color);
    width: 100%;
}

.float-gma-chat-messages {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE和Edge */
}
.float-gma-chat-messages::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.float-gma-chat-head h3 {
    color: #fff;
    font-size: 15px;
    line-height: 35px;
    margin: 0;
    text-align: center;
}

span#close-float-gma-chat {
  display: inline-block;
  width: 35px;
  height: 35px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath d='M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 18px;
  cursor: pointer;
  position: absolute;
  right: 0;
  top: 0;
}

span#close-float-gma-chat:hover {
    background-color: var(--chat-primary-color);
    filter: brightness(80%);
}
.float-gma-chat-messages {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow-y: scroll;
    padding-bottom: 50px;
    position: relative;
}

.gma-message-content ol, .gma-message-content ul {
    padding-left: 16px;
}

.float-gma-chat-input-container {
    width: 100%;
    position: absolute;
    bottom: 0;
    left: 0;
    display: flex;
    justify-content: space-between;
}

.float-gma-chat-input {
    flex: 1;
    border: 0;
    border-top: 1px solid #ccc;
    background: linear-gradient(180deg, #f0f6ff, #ffffff);
    font-size: 14px;
    padding: 10px;
    height: 50px;
    min-height: 50px;
    max-height: 50px;
    resize: none;
}

.float-gma-chat-input:focus-visible {
    border-top: 1px solid var(--chat-primary-color);
    outline: none;
}

.float-gma-send-button {
    background: var(--chat-primary-color);
    color: #fff;
    width: 50px;
    min-height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-bottom-right-radius: 15px;
}

.float-gma-voice-button, .float-gma-send-button {
    border: navajowhite;
    color: #fff;
}

.float-gma-chat-messages .gma-message {
    max-width: 80%;
    margin-bottom: 15px;
}


@keyframes jump-once {
    0% { transform: translateY(0) scale(1); }
    20% { transform: translateY(-20px) scale(1.1); }
    40% { transform: translateY(0) scale(0.95); }
    60% { transform: translateY(-15px) scale(1.05); }
    80% { transform: translateY(0) scale(0.98); }
    100% { transform: translateY(0) scale(1); }
}


@keyframes rotateColors {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}