/* ?? Floating Bot Icon ?? */
:root {
    --bot-primary: #109d77;
}
#dsBotToggle {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 99990;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background: var(--bot-primary);
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(79,70,229,.45);
    transition: transform .25s ease, box-shadow .25s ease;
}

    #dsBotToggle:hover {
        transform: scale(1.08);
        box-shadow: 0 6px 20px rgba(79,70,229,.55);
    }

    #dsBotToggle .ds-bot-icon {
        animation: dsBotBounce 2s ease-in-out infinite;
    }

    #dsBotToggle .ds-bot-close {
        display: none;
        font-size: 24px;
    }

    #dsBotToggle.ds-open .ds-bot-icon {
        display: none;
    }

    #dsBotToggle.ds-open .ds-bot-close {
        display: inline;
    }

/* ?? Unread Badge ?? */
#dsBotBadge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 18px;
    font-size: 10px;
    height: 18px;
    border-radius: 50%;
    background: #ef4444;
    border: 2px solid #CDDC39;
    display:none;
    animation: dsBadgePulse 1.5s ease-in-out infinite;
}

/* ?? Active Chat Indicator ?? */
#dsBotActive {
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #22c55e;
    border: 2.5px solid #fff;
    display: none;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5);
}

#dsBotToggle.ds-chat-active #dsBotActive {
    display: block;
    animation: dsActivePulse 2s ease-in-out infinite;
}

#dsBotToggle.ds-chat-active.ds-open #dsBotActive {
    display: none;
}

/* ?? Chat Popup ?? */
#dsBotPopup {
    --heightAdjustment: 200px;
    position: fixed;
    bottom: 100px;
    right: 28px;
    z-index: 99991;
    width: 380px;
    height: calc(100vh - var(--heightAdjustment));
    height: calc(100svh - var(--heightAdjustment));
    height: calc(100dvh - var(--heightAdjustment));
    max-height: 500px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0,0,0,.18);
    display: none;
    opacity: 0;
    transform: translateY(20px) scale(.95);
    transition: opacity .3s ease, transform .3s ease;
}

    #dsBotPopup.ds-visible {
        display: block;
    }

    #dsBotPopup.ds-show {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    #dsBotPopup iframe {
        width: 100%;
        height: 100%;
        border: none;
    }

/* ?? Animations ?? */
@keyframes dsBotBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-4px);
    }
}

@keyframes dsBadgePulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.25);
    }
}

@keyframes dsActivePulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(34, 197, 94, 0);
    }
}

/* ?? Choice Popup ?? */
#dsBotChoice {
    position: fixed;
    bottom: 100px;
    right: 28px;
    z-index: 99992;
    width: 240px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 8px 30px rgba(0,0,0,.18);
    padding: 16px;
    display: none;
    opacity: 0;
    transform: translateY(20px) scale(.95);
    transition: opacity .3s ease, transform .3s ease;
}

    #dsBotChoice.ds-visible {
        display: block;
    }

    #dsBotChoice.ds-show {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

.ds-choice-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
    text-align: center;
}

.ds-choice-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: .2s ease;
    box-sizing: border-box;
}

    .ds-choice-option + .ds-choice-option {
        margin-top: 8px;
    }

.ds-choice-wa {
    background: #e7f9ef;
    color: #1a7f37;
}

    .ds-choice-wa:hover {
        background: #d0f4de;
        text-decoration: none;
        color: #1a7f37;
    }

    .ds-choice-wa i {
        font-size: 20px;
        color: #25D366;
    }

.ds-choice-live {
    background: var(--bot-primary);
    color: #eef2ff;
}
.ds-choice-live span {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}
    .ds-choice-live:hover {
        box-shadow: 2px 2px 6px 0px #00000087;
    }
    .ds-choice-live i {
        font-size: 18px;
    }

/* ?? Responsive ?? */
@media (max-width: 480px) {
    #dsBotChoice {
        right: 8px;
        bottom: 96px;
        width: calc(100vw - 16px);
    }

    #dsBotPopup {
        width: calc(100vw - 16px);
        height: calc(100vh - 120px);
        right: 8px;
        bottom: 96px;
        border-radius: 12px;
    }

    #dsBotToggle {
        bottom: 18px;
        right: 18px;
        width: 54px;
        height: 54px;
        font-size: 24px;
    }
}