﻿.ksg-wa-widget {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1200;
    font-family: 'Source Sans 3', sans-serif;
}

/* ===== Toggle button ===== */
.ksg-wa-toggle {
    position: relative;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: #25D366;
    color: #ECE7DD;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(37, 211, 102, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

    .ksg-wa-toggle:hover {
        transform: translateY(-2px);
        box-shadow: 0 14px 30px rgba(37, 211, 102, 0.5);
    }

.ksg-wa-ping {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: #25D366;
    opacity: 0.55;
    animation: ksg-wa-ping-anim 2.4s ease-out infinite;
}

@keyframes ksg-wa-ping-anim {
    0% {
        transform: scale(1);
        opacity: 0.55;
    }

    100% {
        transform: scale(1.7);
        opacity: 0;
    }
}

.ksg-wa-widget.is-open .ksg-wa-toggle {
    background: #0D1321;
}

.ksg-wa-widget.is-open .ksg-wa-ping {
    display: none;
}

/* ===== Panel ===== */
.ksg-wa-panel {
    position: absolute;
    right: 0;
    bottom: 74px;
    width: 320px;
    background: #FFFFFF;
    border-radius: 10px;
    box-shadow: 0 24px 48px rgba(13, 19, 33, 0.28);
    overflow: hidden;
    opacity: 0;
    transform: translateY(16px) scale(0.96);
    pointer-events: none;
    transform-origin: bottom right;
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.ksg-wa-widget.is-open .ksg-wa-panel {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.ksg-wa-panel-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 16px;
    background: #0D1321;
}

.ksg-wa-avatar {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #E8A33D;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: 14px;
    color: #0D1321;
}

.ksg-wa-head-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-right: auto;
    min-width: 0;
}

.ksg-wa-head-name {
    font-size: 14px;
    font-weight: 600;
    color: #ECE7DD;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ksg-wa-head-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    color: #A9AFC2;
}

.ksg-live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #25D366;
    flex-shrink: 0;
    animation: ksg-wa-dot-pulse 1.6s ease-in-out infinite;
}

@keyframes ksg-wa-dot-pulse {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

.ksg-wa-close {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: none;
    background: rgba(236,231,221,0.1);
    color: #ECE7DD;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

    .ksg-wa-close:hover {
        background: rgba(236,231,221,0.2);
    }

.ksg-wa-panel-body {
    padding: 18px 16px;
    background: #ECE0D1;
    background-image: radial-gradient(rgba(13,19,33,0.03) 1px, transparent 1px);
    background-size: 16px 16px;
}

.ksg-wa-bubble {
    background: #FFFFFF;
    border-radius: 2px 10px 10px 10px;
    padding: 12px 14px;
    font-size: 13.5px;
    line-height: 1.55;
    color: #0D1321;
    box-shadow: 0 2px 4px rgba(13,19,33,0.08);
    max-width: 90%;
}

.ksg-wa-panel-foot {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: #F1F3F7;
    border-top: 1px solid #E2E6ED;
}

.ksg-wa-input {
    flex: 1;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 13.5px;
    color: #0D1321;
    background: #FFFFFF;
    border: 1px solid #D7DCE5;
    border-radius: 20px;
    padding: 10px 16px;
    outline: none;
    transition: border-color 0.2s ease;
}

    .ksg-wa-input:focus {
        border-color: #25D366;
    }

    .ksg-wa-input::placeholder {
        color: #A9AFC2;
    }

.ksg-wa-send {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: #25D366;
    color: #ECE7DD;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

    .ksg-wa-send:hover {
        background: #1FBD5A;
    }

/* ===== Responsive ===== */
@media (max-width: 480px) {
    .ksg-wa-widget {
        right: 16px;
        bottom: 16px;
    }

    .ksg-wa-panel {
        display: none;
    }

    .ksg-wa-toggle {
        width: 52px;
        height: 52px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ksg-wa-ping,
    .ksg-live-dot {
        animation: none;
    }

    .ksg-wa-panel {
        transition: opacity 0.15s ease;
    }
}
