/* Floating Chat Widget CSS */
:root {
    --wmt-bottom-offset: 20px;
    --wmt-side-offset: 20px;
    --wmt-btn-size: 54px;
}

/* Prevent Horizontal Page Overflow / Swiping on Mobile */
html, body {
    max-width: 100% !important;
    overflow-x: clip !important;
}

.wmt-floating-chat-container {
    position: fixed;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: center;
    pointer-events: none; /* Let container ignore clicks, buttons capture them */
    max-width: 100% !important;
    box-sizing: border-box !important;
    touch-action: pan-y !important;
}

.wmt-floating-chat-container * {
    box-sizing: border-box;
    pointer-events: auto;
}

/* Screen Positions (Desktop) */
.wmt-floating-chat-container.wmt-pos-bottom-right {
    bottom: var(--wmt-bottom-offset-desktop, 20px) !important;
    right: var(--wmt-side-offset-desktop, 20px) !important;
    align-items: flex-end;
}

.wmt-floating-chat-container.wmt-pos-bottom-left {
    bottom: var(--wmt-bottom-offset-desktop, 20px) !important;
    left: var(--wmt-side-offset-desktop, 20px) !important;
    align-items: flex-start;
}

.wmt-floating-chat-container.wmt-pos-top-right {
    top: var(--wmt-bottom-offset-desktop, 20px) !important;
    right: var(--wmt-side-offset-desktop, 20px) !important;
    align-items: flex-end;
}

.wmt-floating-chat-container.wmt-pos-top-left {
    top: var(--wmt-bottom-offset-desktop, 20px) !important;
    left: var(--wmt-side-offset-desktop, 20px) !important;
    align-items: flex-start;
}

/* Buttons List Container */
.wmt-buttons-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: inherit;
    transition: opacity 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), visibility 0.3s ease;
}

/* Toggle Mode States */
.wmt-mode-toggle.wmt-state-closed .wmt-buttons-list {
    opacity: 0;
    visibility: hidden;
    display: none !important;
    pointer-events: none;
    transform: translateY(16px) scale(0.85);
}

.wmt-mode-toggle.wmt-state-open .wmt-buttons-list {
    opacity: 1;
    visibility: visible;
    display: flex !important;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

/* Reverse stack direction when positioned at Top */
.wmt-pos-top-right,
.wmt-pos-top-left {
    flex-direction: column-reverse;
}

/* Main Trigger Button Styling */
.wmt-trigger-btn {
    border: none !important;
    background: linear-gradient(135deg, #0d9488 0%, #10b981 100%) !important;
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4) !important;
}
.wmt-trigger-btn:hover {
    background: linear-gradient(135deg, #0f766e 0%, #059669 100%) !important;
    box-shadow: 0 10px 28px rgba(16, 185, 129, 0.55) !important;
}

/* Trigger Icon Switching */
.wmt-trigger-btn .wmt-icon-chat,
.wmt-trigger-btn .wmt-icon-close {
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.25s ease !important;
}

.wmt-state-closed .wmt-trigger-btn .wmt-icon-chat {
    display: block !important;
    opacity: 1 !important;
    transform: rotate(0deg) scale(1) !important;
}
.wmt-state-closed .wmt-trigger-btn .wmt-icon-close {
    display: none !important;
    opacity: 0 !important;
    transform: rotate(-90deg) scale(0.5) !important;
}

.wmt-state-open .wmt-trigger-btn .wmt-icon-chat {
    display: none !important;
    opacity: 0 !important;
    transform: rotate(90deg) scale(0.5) !important;
}
.wmt-state-open .wmt-trigger-btn .wmt-icon-close {
    display: block !important;
    opacity: 1 !important;
    transform: rotate(0deg) scale(1) !important;
}

/* Buttons Base Styling - Perfect Circular Shape Guarantee */
.wmt-chat-btn {
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: var(--wmt-btn-size-desktop, 56px) !important;
    height: var(--wmt-btn-size-desktop, 56px) !important;
    min-width: var(--wmt-btn-size-desktop, 56px) !important;
    min-height: var(--wmt-btn-size-desktop, 56px) !important;
    max-width: var(--wmt-btn-size-desktop, 56px) !important;
    max-height: var(--wmt-btn-size-desktop, 56px) !important;
    aspect-ratio: 1 / 1 !important;
    border-radius: 50% !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    outline: none !important;
    flex-shrink: 0 !important;
    box-sizing: border-box !important;
    color: #ffffff !important;
    text-decoration: none !important;
    line-height: 1 !important;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22) !important;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease, background 0.3s ease, width 0.3s ease, height 0.3s ease !important;
    cursor: pointer !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

.wmt-chat-btn:hover,
.wmt-chat-btn:focus {
    transform: translateY(-4px) scale(1.08) !important;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.32) !important;
    color: #ffffff !important;
}

/* SVG Icon */
.wmt-icon {
    width: var(--wmt-icon-size, 30px) !important;
    height: var(--wmt-icon-size, 30px) !important;
    min-width: var(--wmt-icon-size, 30px) !important;
    min-height: var(--wmt-icon-size, 30px) !important;
    max-width: var(--wmt-icon-size, 30px) !important;
    max-height: var(--wmt-icon-size, 30px) !important;
    display: block !important;
    flex-shrink: 0 !important;
    margin: auto !important;
    fill: currentColor !important;
    color: inherit !important;
    pointer-events: none !important;
    transition: transform 0.3s ease !important;
}

.wmt-chat-btn:hover .wmt-icon {
    transform: scale(1.1) !important;
}

/* WhatsApp Styling */
.wmt-btn-whatsapp {
    background-color: #25D366 !important;
}
.wmt-btn-whatsapp:hover {
    background-color: #20ba5a !important;
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.45) !important;
}

/* Messenger Styling */
.wmt-btn-messenger {
    background: linear-gradient(135deg, #00C6FF 0%, #0072FF 100%) !important;
}
.wmt-btn-messenger:hover {
    background: linear-gradient(135deg, #00B2E6 0%, #0062E6 100%) !important;
    box-shadow: 0 8px 24px rgba(0, 132, 255, 0.45) !important;
}

/* Telegram Styling */
.wmt-btn-telegram {
    background-color: #26A5E4 !important;
}
.wmt-btn-telegram:hover {
    background-color: #1e94d0 !important;
    box-shadow: 0 8px 24px rgba(38, 165, 228, 0.45) !important;
}

/* Tooltip Styles */
.wmt-tooltip {
    position: absolute;
    white-space: nowrap;
    padding: 6px 14px;
    background: rgba(18, 24, 38, 0.88);
    backdrop-filter: blur(6px);
    color: #ffffff;
    font-size: 13px;
    font-weight: 500;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
    pointer-events: none;
}

/* Position right -> tooltip left */
.wmt-pos-bottom-right .wmt-tooltip,
.wmt-pos-top-right .wmt-tooltip {
    right: calc(100% + 12px);
    transform: translateX(10px);
}
.wmt-pos-bottom-right .wmt-chat-btn:hover .wmt-tooltip,
.wmt-pos-top-right .wmt-chat-btn:hover .wmt-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* Position left -> tooltip right */
.wmt-pos-bottom-left .wmt-tooltip,
.wmt-pos-top-left .wmt-tooltip {
    left: calc(100% + 12px);
    transform: translateX(-10px);
}
.wmt-pos-bottom-left .wmt-chat-btn:hover .wmt-tooltip,
.wmt-pos-top-left .wmt-chat-btn:hover .wmt-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* Idle Animations */
.wmt-anim-pulse .wmt-chat-btn {
    animation: wmt-pulse 2.5s infinite ease-in-out;
}
.wmt-anim-bounce .wmt-chat-btn {
    animation: wmt-bounce 3s infinite;
}
.wmt-anim-shake .wmt-chat-btn {
    animation: wmt-shake 4s infinite ease-in-out;
}

/* Keyframes */
@keyframes wmt-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.06);
        box-shadow: 0 8px 22px rgba(0, 0, 0, 0.3);
    }
}

@keyframes wmt-bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-8px);
    }
    60% {
        transform: translateY(-4px);
    }
}

@keyframes wmt-shake {
    0%, 80%, 100% {
        transform: rotate(0deg);
    }
    85% {
        transform: rotate(-10deg);
    }
    90% {
        transform: rotate(10deg);
    }
    95% {
        transform: rotate(-5deg);
    }
}

/* Mobile Sticky Bottom Action Bar */
.wmt-mobile-sticky-bar {
    display: none;
}

/* Responsive Visibility & Mobile Controls */
@media screen and (max-width: 767px) {
    .wmt-desktop-only {
        display: none !important;
    }
    .wmt-tooltip {
        display: none !important; /* Hide hover tooltips on mobile touch screens */
    }
    .wmt-floating-chat-container {
        gap: 10px !important;
    }
    .wmt-chat-btn {
        width: var(--wmt-btn-size-mobile, 46px) !important;
        height: var(--wmt-btn-size-mobile, 46px) !important;
        min-width: var(--wmt-btn-size-mobile, 46px) !important;
        min-height: var(--wmt-btn-size-mobile, 46px) !important;
        max-width: var(--wmt-btn-size-mobile, 46px) !important;
        max-height: var(--wmt-btn-size-mobile, 46px) !important;
    }

    /* Mobile Sticky Bottom Bar Styling */
    .wmt-mobile-sticky-bar {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: auto !important;
        max-width: 100% !important;
        height: 54px !important;
        z-index: 9999998 !important;
        display: flex !important;
        align-items: center !important;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.25) !important;
        overflow: hidden !important;
        margin: 0 !important;
        padding: 0 !important;
        box-sizing: border-box !important;
        touch-action: pan-y !important;
    }

    .wmt-sticky-btn {
        flex: 1 1 50% !important;
        min-width: 0 !important;
        max-width: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 8px !important;
        height: 100% !important;
        text-decoration: none !important;
        font-weight: 700 !important;
        font-size: 13px !important;
        letter-spacing: 1px !important;
        text-transform: uppercase !important;
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, sans-serif !important;
        transition: opacity 0.2s ease, filter 0.2s ease !important;
        box-sizing: border-box !important;
        padding: 0 10px !important;
        margin: 0 !important;
        border: none !important;
        outline: none !important;
        border-radius: 0 !important;
        line-height: 1 !important;
        overflow: hidden !important;
    }

    .wmt-sticky-btn:active,
    .wmt-sticky-btn:hover {
        opacity: 0.9 !important;
        filter: brightness(1.08) !important;
    }

    .wmt-sticky-icon {
        width: 20px !important;
        height: 20px !important;
        min-width: 20px !important;
        min-height: 20px !important;
        display: block !important;
        fill: currentColor !important;
        color: inherit !important;
        flex-shrink: 0 !important;
    }

    .wmt-sticky-label {
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        color: inherit !important;
    }

    /* Mobile Screen Positions & Margins */
    .wmt-floating-chat-container.wmt-pos-bottom-right {
        bottom: var(--wmt-bottom-offset-mobile, 20px) !important;
        right: var(--wmt-side-offset-mobile, 20px) !important;
    }
    .wmt-floating-chat-container.wmt-pos-bottom-left {
        bottom: var(--wmt-bottom-offset-mobile, 20px) !important;
        left: var(--wmt-side-offset-mobile, 20px) !important;
    }
    .wmt-floating-chat-container.wmt-pos-top-right {
        top: var(--wmt-bottom-offset-mobile, 20px) !important;
        right: var(--wmt-side-offset-mobile, 20px) !important;
    }
    .wmt-floating-chat-container.wmt-pos-top-left {
        top: var(--wmt-bottom-offset-mobile, 20px) !important;
        left: var(--wmt-side-offset-mobile, 20px) !important;
    }

    /* Shift floating chat container up when sticky bar is active */
    .wmt-has-mobile-sticky-bar.wmt-pos-bottom-right,
    .wmt-has-mobile-sticky-bar.wmt-pos-bottom-left {
        bottom: calc(var(--wmt-bottom-offset-mobile, 20px) + 54px) !important;
    }
}

@media screen and (min-width: 768px) {
    .wmt-mobile-only {
        display: none !important;
    }
}
