/* HollaCash Premium Floating Chat — v1 */

#open-btn.open_cst {
    position: fixed !important;
    right: 0 !important;
    bottom: 22% !important;
    z-index: 1000 !important;

    width: 49px;
    height: 53px;
    padding: 0 !important;

    border: 1px solid rgba(39,238,144,.55) !important;
    border-right: 0 !important;
    border-radius: 16px 0 0 16px !important;

    background: linear-gradient(145deg,#123c31,#071c24) !important;
    color: #4bf3a0 !important;

    box-shadow:
        0 8px 28px rgba(0,0,0,.35),
        0 0 20px rgba(16,223,122,.16),
        inset 0 1px rgba(255,255,255,.09) !important;

    animation: hcChatFloat 7s ease-in-out infinite;
    cursor: pointer;
}

#open-btn.open_cst i {
    font-size: 22px;
    filter: drop-shadow(0 0 7px rgba(16,223,122,.35));
}

#open-btn.open_cst::after {
    display: none !important;
}

#open-btn.open_cst:hover {
    border-color: #4bf3a0 !important;
    box-shadow: 0 0 26px rgba(16,223,122,.28) !important;
}

@keyframes hcChatFloat {
    0%, 72%, 100% {
        transform: translateY(0);
    }
    77% {
        transform: translateY(-7px);
    }
    82% {
        transform: translateY(0);
    }
    87% {
        transform: translateY(-4px);
    }
    92% {
        transform: translateY(0);
    }
}

@media (max-width: 700px) {
    #open-btn.open_cst {
        bottom: calc(105px + env(safe-area-inset-bottom)) !important;
        width: 45px;
        height: 49px;
    }
}

@media (prefers-reduced-motion: reduce) {
    #open-btn.open_cst {
        animation: none !important;
    }
}

/* Show floating chat launcher on mobile when chat is closed */
@media (max-width: 700px) {
    #open-btn.open_cst.dp_0[style*="display: block"],
    #open-btn.open_cst.dp_0[style*="display:block"] {
        display: flex !important;
        align-items: center;
        justify-content: center;
    }
}

/* HollaCash Floating Chat — bottom-right position */
#open-btn.open_cst {
    position: fixed !important;
    top: auto !important;
    left: auto !important;
    right: 16px !important;
    bottom: 95px !important;
    z-index: 1000 !important;
    border-radius: 16px !important;
    border-right: 1px solid rgba(39,238,144,.55) !important;
}

@media (max-width: 700px) {
    #open-btn.open_cst {
        right: 14px !important;
        bottom: calc(95px + env(safe-area-inset-bottom)) !important;
    }
}

/* Visibility fix: show launcher only while chat is closed */
body:has(#csm_app_chat.chat-bar.closed) #open-btn.open_cst {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

body:has(#csm_app_chat.chat-bar:not(.closed)) #open-btn.open_cst {
    display: none !important;
}

/* HollaCash Global Chat Overlay Fix */
#csm_app_chat.chat-bar {
    position: fixed !important;
    z-index: 2147483000 !important;
    isolation: isolate;
    background: #071522 !important;
    opacity: 1 !important;
    border-left: 1px solid rgba(16,223,122,.18) !important;
}

#csm_app_chat.chat-bar:not(.closed) {
    visibility: visible !important;
}

#csm_app_chat.chat-bar.closed {
    pointer-events: none !important;
}

@media (max-width: 768px) {
    #csm_app_chat.chat-bar {
        width: 100% !important;
        max-width: 100% !important;
        left: auto !important;
        right: 0;
    }
}

/* HollaCash Chat Fullscreen Display Fix */
#csm_app_chat.chat-bar {
    position: fixed !important;
    top: 61px !important;
    bottom: 0 !important;
    height: calc(100dvh - 61px) !important;
    min-height: 0 !important;
    z-index: 2147483000 !important;
    isolation: isolate !important;
    background: #071522 !important;
    background-image: none !important;
    opacity: 1 !important;
    overflow: hidden !important;
}

@media (max-width: 768px) {
    #csm_app_chat.chat-bar {
        left: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        height: calc(100dvh - 61px) !important;
    }

    #csm_app_chat.chat-bar.closed {
        left: auto !important;
        right: -110vw !important;
    }
}
