/*
 * Grumpys.nz Chat v0.2 — Blue Bunny Courier
 */

.chat-panel {
    display: flex;
    flex-direction: column;
}

.conversation {
    flex: 1 1 auto;
    min-height: 180px;
    max-height: 340px;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 7px;
    margin-bottom: 14px;
    scroll-behavior: smooth;
    scrollbar-width: thin;
}

.compact-chat-label {
    font-size: 0 !important;
    gap: 0 !important;
}

.compact-chat-label input,
.compact-chat-label textarea {
    font-size: 1rem !important;
}

.message.visitor-message.pending {
    background: #fde6e9;
    border-left: 5px solid #cf7b88;
}

.message.visitor-message.answered {
    background: #e7f4e4;
    border-left: 5px solid #73a36c;
}

.message.grumpy-message {
    background: #dceaf4;
    border-left: 5px solid #5d8fae;
}

.message-meta {
    display: block;
    margin-top: 5px;
    opacity: .62;
    font-size: .72rem;
}

.reply-arriving {
    opacity: 0;
    transform: translateX(15px);
    transition: opacity 320ms ease, transform 320ms ease;
}

.reply-arriving.reply-visible {
    opacity: 1;
    transform: translateX(0);
}

.send-button {
    transition: opacity 180ms ease, transform 180ms ease;
}

.send-button.bunny-hidden {
    opacity: 0;
    transform: scale(.92);
    pointer-events: none;
}

.blue-bunny-courier {
    --courier-distance: 280px;
    position: absolute;
    z-index: 9999;
    width: 64px;
    height: 58px;
    pointer-events: none;
    filter: drop-shadow(0 5px 4px rgba(0, 0, 0, .25));
    opacity: 1;
    transition: transform 1000ms cubic-bezier(.36,.01,.42,1), opacity 250ms ease;
}

.blue-bunny-courier .courier-body {
    position: absolute;
    left: 18px;
    top: 20px;
    width: 35px;
    height: 29px;
    border-radius: 55% 47% 52% 46%;
    background: #4799d1;
    box-shadow: inset -5px -4px 0 rgba(0,0,0,.08);
}

.blue-bunny-courier .courier-head {
    position: absolute;
    left: 4px;
    top: 16px;
    width: 27px;
    height: 25px;
    border-radius: 52%;
    background: #58a9df;
}

.blue-bunny-courier .courier-ear {
    position: absolute;
    top: 0;
    width: 9px;
    height: 26px;
    border-radius: 70% 70% 22% 22%;
    background: #58a9df;
    transform-origin: bottom;
}

.blue-bunny-courier .ear-a {
    left: 8px;
    transform: rotate(-12deg);
}

.blue-bunny-courier .ear-b {
    left: 18px;
    transform: rotate(10deg);
}

.blue-bunny-courier .courier-eye {
    position: absolute;
    left: 10px;
    top: 24px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #091820;
}

.blue-bunny-courier .courier-tail {
    position: absolute;
    right: 2px;
    top: 24px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #e3f3fb;
}

.blue-bunny-courier .courier-envelope {
    position: absolute;
    left: 0;
    top: 34px;
    min-width: 23px;
    height: 17px;
    line-height: 16px;
    text-align: center;
    color: #72562e;
    background: #fff2ca;
    border: 1px solid #93754a;
    border-radius: 2px;
    font-size: 15px;
}

.blue-bunny-courier.courier-outgoing.travelling {
    transform: translateX(var(--courier-distance)) translateY(-4px) rotate(2deg);
}

.blue-bunny-courier.courier-incoming {
    transform: scaleX(-1);
}

.blue-bunny-courier.courier-incoming.travelling {
    transform: translateX(calc(var(--courier-distance) * -1)) translateY(-4px) scaleX(-1) rotate(2deg);
}

.blue-bunny-courier.vanishing {
    opacity: 0;
}

.blue-bunny-courier.dissolve {
    opacity: 0;
    filter: blur(5px);
}

.blue-bunny-courier.travelling .courier-ear {
    animation: bunny-ear-wobble 240ms ease-in-out infinite alternate;
}

@keyframes bunny-ear-wobble {
    from { margin-top: 0; }
    to   { margin-top: -3px; }
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

@media (prefers-reduced-motion: reduce) {
    .blue-bunny-courier,
    .reply-arriving,
    .send-button {
        transition-duration: 1ms !important;
        animation-duration: 1ms !important;
    }

    .conversation {
        scroll-behavior: auto;
    }
}
