.chat-popup {

    position: fixed;

    right: 20px;
    bottom: 20px;

    width: 370px;
    height: 520px;

    background:
        var(--chat-bg);

    border:
        1px solid var(--chat-border);

    border-radius: 22px;

    backdrop-filter: blur(14px);

    overflow: hidden;

    display: flex;
    flex-direction: column;

    z-index: 99999;

    animation:
        chatFade .25s ease;

    box-shadow:
        0 0 30px rgba(0,0,0,0.45);

    transition:
        height .25s ease,
        transform .2s ease;
}

/*
|--------------------------------------------------------------------------
| Minimized
|--------------------------------------------------------------------------
*/

.chat-popup.minimized {

    width: 78px;
    height: 78px;

    min-width: 78px;
    min-height: 78px;

    border-radius: 50%;

    overflow: hidden;

    background: transparent;

    border: none;

    backdrop-filter: none;

    box-shadow: none;

    padding: 0;
}

/*
|--------------------------------------------------------------------------
| Header
|--------------------------------------------------------------------------
*/

.chat-header {

    height: 64px;

    padding: 0 18px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    border-bottom:
        1px solid var(--chat-soft-border);

    background:
        linear-gradient(
            180deg,
            rgba(255,70,70,0.12),
            rgba(255,70,70,0.03)
        );
}

.chat-title {

    color:
        var(--chat-text);

    font-size: 15px;
    font-weight: 700;

    display: flex;
    align-items: center;
}

.chat-online {

    margin-top: 2px;

    color:
        var(--chat-text-soft);

    font-size: 12px;
}

/*
|--------------------------------------------------------------------------
| Minimize
|--------------------------------------------------------------------------
*/

.chat-minimize {

    width: 34px;
    height: 34px;

    border-radius: 10px;

    background:
        rgba(255,255,255,0.05);

    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;

    color: white;

    transition: .2s;
}

.chat-minimize:hover {

    background:
        rgba(255,255,255,0.10);
}

/*
|--------------------------------------------------------------------------
| Unread
|--------------------------------------------------------------------------
*/

.chat-unread {

    margin-left: 8px;

    min-width: 18px;
    height: 18px;

    padding: 0 6px;

    border-radius: 30px;

    display: flex;
    align-items: center;
    justify-content: center;

    background:
        linear-gradient(
            135deg,
            #ff4747,
            #ff2525
        );

    color: white;

    font-size: 10px;
    font-weight: 700;
}

/*
|--------------------------------------------------------------------------
| Bottom
|--------------------------------------------------------------------------
*/

.chat-bottom {

    height: 76px;

    display: flex;
    align-items: center;

    gap: 10px;

    padding: 12px;

    border-top:
        1px solid var(--chat-soft-border);
}

/*
|--------------------------------------------------------------------------
| Input
|--------------------------------------------------------------------------
*/

.chat-input {

    flex: 1;

    height: 50px;

    border: none;
    outline: none;

    border-radius: 14px;

    padding: 0 14px;

    background:
        rgba(255,255,255,0.04);

    color: white;

    font-size: 14px;
}

.chat-input:focus {

    border:
        1px solid rgba(255,70,70,0.25);
}

/*
|--------------------------------------------------------------------------
| Send
|--------------------------------------------------------------------------
*/

.chat-send {

    width: 54px;
    height: 50px;

    border: none;

    border-radius: 14px;

    cursor: pointer;

    color: white;

    background:
        linear-gradient(
            135deg,
            #ff4747,
            #ff2525
        );

    transition: .2s;
}

.chat-send:hover {

    transform:
        scale(1.04);
}

.chat-pulse {

    animation:
        chatPulse 1s ease;
}

@keyframes chatPulse {

    0% {

        box-shadow:
            0 0 0 rgba(255,70,70,0);
    }

    50% {

        box-shadow:
            0 0 40px rgba(255,70,70,0.28);
    }

    100% {

        box-shadow:
            0 0 0 rgba(255,70,70,0);
    }
}

.chat-open-window {

    margin-top: 4px;

    font-size: 11px;
    font-weight: 700;

    color:
        rgba(255,255,255,0.45);

    cursor: pointer;

    transition: .2s;
}

.chat-open-window:hover {

    color:
        #ff8e8e;
}

.chat-popup.minimized .chat-header {

    width: 100%;
    height: 100%;

    min-height: 100%;

    padding: 0;

    margin: 0;

    border: none;

    border-radius: 50%;

    overflow: hidden;

    display: flex;
    align-items: center;
    justify-content: center;

    background: transparent;
}

.chat-popup.minimized .chat-title,
.chat-popup.minimized .chat-online,
.chat-popup.minimized .chat-open-window {

    display: none;
}

.chat-popup.minimized .chat-minimize {

    width: 100%;
    height: 100%;

    border: none;

    border-radius: 50%;

    padding: 0;

    margin: 0;

    background:
        linear-gradient(
            135deg,
            #ff4747,
            #ff2525
        );

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 30px;

    color: white;

    box-shadow:
        0 0 35px rgba(255,70,70,0.42),
        inset 0 1px 0 rgba(255,255,255,0.18);

    transition:
        transform .18s ease,
        box-shadow .18s ease;
}

.chat-popup.minimized .chat-minimize:hover {

    transform:
        scale(1.06);

    box-shadow:
        0 0 45px rgba(255,70,70,0.48);
}

.chat-popup.minimized .chat-unread {

    position: absolute;

    top: -2px;
    right: -2px;

    min-width: 26px;
    height: 26px;

    font-size: 11px;

    box-shadow:
        0 0 20px rgba(255,70,70,0.45);

    z-index: 5;
}

.chat-popup.minimized * {

    overflow: hidden;
}

.chat-popup.minimized::before {

    content: '';

    position: absolute;

    inset: 0;

    border-radius: 50%;

    background:
        radial-gradient(
            circle at top left,
            rgba(255,255,255,0.18),
            transparent 45%
        );

    pointer-events: none;
}

.chat-popup.minimized .chat-minimize:hover {

    transform:
        scale(1.05);

    box-shadow:
        0 0 55px rgba(255,70,70,0.55);
}