/* ==========================================================================
   Modern Floating Messenger & Chat Widget (Kudmuangharm SAO Theme)
   ========================================================================== */
.kh-floating-chat-widget {
    position: fixed;
    right: 25px;
    bottom: 25px;
    z-index: 1040;
    font-family: "Anuphan", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
}

.kh-chat-action-link {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none !important;
    position: relative;
}

/* Floating Speech Bubble Tooltip */
.kh-chat-speech-bubble {
    position: relative;
    background: linear-gradient(135deg, #FFFFFF 0%, #f0f5fa 100%);
    border: 1.5px solid rgba(255, 166, 235, 0.6);
    border-radius: 16px;
    padding: 8px 16px;
    box-shadow: 0 8px 24px rgba(26, 55, 96, 0.15), 0 2px 6px rgba(255, 166, 235, 0.2);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
    pointer-events: auto;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: khChatBubbleFloat 3.5s ease-in-out infinite;
    backdrop-filter: blur(8px);
}

.kh-chat-bubble-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: #1a3760;
    line-height: 1.3;
    display: flex;
    align-items: center;
    gap: 5px;
}

.kh-chat-bubble-title i {
    color: #ffa6eb;
    font-size: 0.88rem;
}

.kh-chat-bubble-sub {
    font-size: 0.72rem;
    font-weight: 600;
    color: #64748b;
    line-height: 1.2;
    margin-top: 2px;
}

/* Speech Bubble Arrow */
.kh-chat-bubble-arrow {
    position: absolute;
    right: -7px;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
    width: 12px;
    height: 12px;
    background: #f0f5fa;
    border-top: 1.5px solid rgba(255, 166, 235, 0.6);
    border-right: 1.5px solid rgba(255, 166, 235, 0.6);
}

/* Floating Circular Action Button */
.kh-chat-circle-btn {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #244a7e 0%, #1a3760 100%);
    box-shadow: 0 8px 24px rgba(26, 55, 96, 0.35), 0 0 0 3px rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
}

/* Radar Ripple Wave Animation */
.kh-chat-radar-ripple {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid #ffa6eb;
    animation: khChatRadarPulse 2.4s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
    pointer-events: none;
}

.kh-chat-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    transition: transform 0.3s ease;
}

.kh-chat-icon {
    font-size: 1.95rem;
    color: #FFFFFF;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    animation: khChatIconPulse 3s ease-in-out infinite;
}

/* Online Indicator Badge */
.kh-chat-online-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    background: #10B981;
    border: 2.5px solid #FFFFFF;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.4);
    animation: khChatOnlineDot 1.8s ease-in-out infinite;
}

/* Hover & Interactive States */
.kh-chat-action-link:hover .kh-chat-circle-btn {
    transform: translateY(-4px) scale(1.08);
    box-shadow: 0 14px 32px rgba(26, 55, 96, 0.45), 0 0 20px rgba(255, 166, 235, 0.55), 0 0 0 4px rgba(255, 255, 255, 1);
}

.kh-chat-action-link:hover .kh-chat-icon-wrap {
    transform: scale(1.12) rotate(6deg);
}

.kh-chat-action-link:hover .kh-chat-speech-bubble {
    transform: translateY(-3px) scale(1.03);
    border-color: #ffa6eb;
    box-shadow: 0 12px 28px rgba(26, 55, 96, 0.2);
}

.kh-chat-action-link:hover .kh-chat-bubble-title {
    color: #244a7e;
}

/* Keyframes Animations */
@keyframes khChatBubbleFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

@keyframes khChatRadarPulse {
    0% {
        transform: scale(1);
        opacity: 0.85;
    }
    60% {
        transform: scale(1.45);
        opacity: 0.25;
    }
    100% {
        transform: scale(1.7);
        opacity: 0;
    }
}

@keyframes khChatIconPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.06);
    }
}

@keyframes khChatOnlineDot {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 0 4px rgba(16, 185, 129, 0);
    }
}

/* Responsive */
@media (max-width: 575.98px) {
    .kh-floating-chat-widget {
        right: 16px;
        bottom: 20px;
    }

    .kh-chat-circle-btn {
        width: 52px;
        height: 52px;
    }

    .kh-chat-icon {
        font-size: 1.65rem;
    }

    .kh-chat-speech-bubble {
        padding: 6px 12px;
    }

    .kh-chat-bubble-title {
        font-size: 0.82rem;
    }

    .kh-chat-bubble-sub {
        display: none;
    }
}

