/* ===================================
   CodeBrewers WhatsApp Mascot
   Floating animated bot + chat prompt
   =================================== */

/* --- Floating container --- */
.cbp-root {
    position: fixed;
    right: 24px;
    bottom: 44px;
    z-index: 900;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 14px;
}

/* --- Mascot button (from premium pack) --- */
.cbp-button {
    appearance: none;
    position: relative;
    display: grid;
    place-items: center;
    width: 77px;
    height: 77px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    cursor: pointer;
    overflow: visible;
    -webkit-tap-highlight-color: transparent;
}

.cbp-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
    display: block;
}

.cbp-float {
    transform-origin: 50px 51px;
    animation: cbpFloat 4.8s ease-in-out infinite;
    transition: transform .25s ease;
}

.cbp-eyes {
    transform-origin: 50px 42px;
    animation: cbpBlink 6.2s infinite;
    transition: opacity .18s ease;
}

/* Happy face (curved eyes + smile) — revealed on hover. */
.cbp-happy {
    opacity: 0;
    transition: opacity .18s ease;
}

/* Ground aura ring at the base — always glows and gently pulses. */
.cbp-aura,
.cbp-aura-glow {
    transform-box: fill-box;
    transform-origin: center;
}

.cbp-aura {
    opacity: .9;
    animation: cbpAura 1.8s ease-in-out infinite;
}

.cbp-aura-glow {
    opacity: .6;
    animation: cbpAuraGlow 1.8s ease-in-out infinite;
}

.cbp-cup {
    transform-origin: 77px 62px;
    animation: cbpCup 7.2s ease-in-out infinite;
}

.cbp-steam path {
    animation: cbpSteam 2.8s ease-out infinite;
}

.cbp-steam .cbp-steam-delay {
    animation-delay: 1.35s;
}

.cbp-status {
    animation: cbpStatus 2.8s ease-in-out infinite;
}

.cbp-button:hover .cbp-float {
    animation-play-state: paused;
    transform: translateY(-4px) scale(1.05);
}

/* Swap the neutral dot eyes for the happy face. */
.cbp-button:hover .cbp-eyes {
    opacity: 0;
}

.cbp-button:hover .cbp-happy {
    opacity: 1;
}

.cbp-button:hover .cbp-status {
    animation-play-state: paused;
    opacity: 1;
}

.cbp-button:active .cbp-float {
    transform: translateY(-1px) scale(1.01);
}

@keyframes cbpAura {
    0%, 100% { transform: scale(1); opacity: .9; }
    50% { transform: scale(1.1); opacity: .5; }
}

@keyframes cbpAuraGlow {
    0%, 100% { transform: scale(1); opacity: .6; }
    50% { transform: scale(1.12); opacity: .85; }
}

.cbp-button:focus-visible {
    outline: 2px solid #DFA144;
    outline-offset: 5px;
    border-radius: 20px;
}

@keyframes cbpFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-9px); }
}

@keyframes cbpBlink {
    0%, 47%, 51%, 100% { transform: scaleY(1); }
    49% { transform: scaleY(.12); }
}

@keyframes cbpCup {
    0%, 74%, 100% { transform: rotate(0deg); }
    81% { transform: rotate(-3deg) translateY(-1px); }
    88% { transform: rotate(0deg); }
}

@keyframes cbpSteam {
    0% { opacity: 0; transform: translateY(2px); }
    30% { opacity: .55; }
    100% { opacity: 0; transform: translateY(-6px); }
}

@keyframes cbpStatus {
    0%, 100% { opacity: .55; }
    50% { opacity: 1; }
}

/* --- Speech-bubble chat prompt --- */
.cbp-bubble {
    width: 264px;
    padding: 18px 18px 16px;
    border-radius: 18px 18px 4px 18px;
    background: rgba(17, 30, 38, 0.92);
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.08));
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    color: var(--color-text, #fff);
    font-family: var(--font-family, 'Inter', sans-serif);
    transform-origin: bottom right;
    transition: opacity .2s ease, transform .2s ease;
}

.cbp-bubble[hidden] {
    display: none;
}

.cbp-bubble.cbp-bubble-enter {
    opacity: 0;
    transform: translateY(8px) scale(.96);
}

.cbp-bubble-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}

.cbp-bubble-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.45;
}

.cbp-close {
    flex: none;
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    margin: -4px -4px 0 0;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--color-text-dim, #9ca3af);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    transition: background .18s ease, color .18s ease;
}

.cbp-close:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.cbp-close:focus-visible {
    outline: 2px solid #DFA144;
    outline-offset: 2px;
}

.cbp-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    padding: 11px 16px;
    border-radius: 12px;
    background: #25D366;
    color: #06331b;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 700;
    text-decoration: none;
    transition: background .18s ease, transform .12s ease;
}

.cbp-cta:hover {
    background: #1fbe5b;
}

.cbp-cta:active {
    transform: scale(.98);
}

.cbp-cta:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.cbp-cta svg {
    width: 20px;
    height: 20px;
    flex: none;
}

@media (max-width: 640px) {
    .cbp-root {
        right: 16px;
        bottom: 32px;
    }

    .cbp-button {
        width: 69px;
        height: 69px;
    }

    .cbp-bubble {
        width: min(264px, calc(100vw - 32px));
    }
}

@media (prefers-reduced-motion: reduce) {
    .cbp-float,
    .cbp-eyes,
    .cbp-cup,
    .cbp-steam path,
    .cbp-status,
    .cbp-aura,
    .cbp-aura-glow {
        animation: none !important;
    }

    .cbp-bubble {
        transition: none;
    }
}
