/* === ROOT === */
:root {

    --sha-blue: #2563eb;
    --sha-blue-dark: #1d4ed8;
    --sha-radius: 22px;
    --sha-shadow: 0 12px 35px rgba(0,0,0,.16);
    --sha-shadow-button: 0 8px 24px rgba(37,99,235,.35), 0 2px 8px rgba(0,0,0,.15);
    --sha-transition: .35s ease;
}

/* === RESET === */

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-family: Arial, sans-serif;
}

/* === WRAPPER === */

#sha-wrapper {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 999999;
    overflow: hidden;
    background: #fff;
    transition:
        width var(--sha-transition),
        height var(--sha-transition),
        border-radius var(--sha-transition),
        box-shadow var(--sha-transition),
        transform .25s ease;
    box-shadow: var(--sha-shadow);
}

/* ==== COLLAPSED === */

#sha-wrapper.collapsed {
    width: 78px;
    height: 78px;
    border-radius: 50%;
    overflow: visible;
    background:
        linear-gradient(
            135deg,
            var(--sha-blue),
            var(--sha-blue-dark)
        );
    box-shadow: var(--sha-shadow-button);
}

/* === LOGIN === */

#sha-wrapper.login {
    width: 39vw;
    height: 69vh;
    min-width: 420px;
    min-height: 640px;
    border-radius: 18px;
}

/* === PROMPT === */

#sha-wrapper.prompt {
    width: 420px;
    height: 64px;
    border-radius: 24px;
    box-shadow: 0 10px 35px rgba(0,0,0,.14);
}

/* === EXPANDED === */

#sha-wrapper.expanded {
    width: 420px;
    height: 700px;
    border-radius: 18px;
}

/* === FULLSCREEN === */

#sha-wrapper.fullscreen {
    width: 100vw;
    height: 100vh;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 0;
}

/* === HIDE TOGGLE IN FULLSCREEN === */

#sha-wrapper.fullscreen #bot-toggle {
    opacity: 0;
    pointer-events: none;
}

/* === IFRAME === */

#sha-frame {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    background: white;
    transition: opacity .2s ease;
}

/* === HIDE IFRAME === */

#sha-wrapper.collapsed #sha-frame {
    opacity: 0;
    pointer-events: none;
}

/* === BUTTON === */

#bot-toggle {
    position: absolute;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    transition:
        transform .2s ease,
        box-shadow .2s ease,
        background .2s ease;
}

/* === BUTTON HOVER === */

#bot-toggle:hover {
    transform: scale(1.05);
}

/* === ICON === */

#bot-toggle img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    animation: pulse 2s infinite ease-in-out;
}

/* === SMALL BUTTON OPEN STATES === */

#sha-wrapper.login #bot-toggle,
#sha-wrapper.prompt #bot-toggle,
#sha-wrapper.expanded #bot-toggle {
    width: 42px;
    height: 42px;
    top: 16px;
    right: 14px;
    left: auto;
    bottom: auto;
    background: rgba(255,255,255,.94);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0,0,0,.12);
}

/* === SMALL ICON === */

#sha-wrapper.login #bot-toggle img,
#sha-wrapper.prompt #bot-toggle img,
#sha-wrapper.expanded #bot-toggle img {
    width: 26px;
    height: 26px;
    animation: none;
}

/* === ANIMATION === */

@keyframes pulse {
    0% {transform: scale(1);}
    50% {transform: scale(1.08);}
    100% {transform: scale(1);}
}


#sha-wrapper.expanded #bot-toggle.searching img,
#sha-wrapper.prompt #bot-toggle.searching img {
    animation: botBlink 0.7s ease-in-out infinite !important;
}

@keyframes botBlink {
    0% {opacity: 1;}
    50% {opacity: 0.2;}
    100% {opacity: 1;}
}


/* === RESPONSIVE === */

@media screen and (max-width: 768px){

    #sha-wrapper.login,
    #sha-wrapper.expanded {
        width: calc(100vw - 20px);
        height: calc(100vh - 20px);
        right: 10px;
        bottom: 10px;
        border-radius: 18px;
    }

    #sha-wrapper.prompt {
        width: calc(100vw - 20px);
        right: 10px;
        bottom: 10px;
    }
}