/* Lutador AI Chatbot — burgundy / gold / cream brand shell */

.lutador-chatbot {
    --chat-burgundy: #4e1014;
    --chat-burgundy-deep: #2a0809;
    --chat-gold: #c9a227;
    --chat-gold-soft: #e8d48a;
    --chat-cream: #faf6f0;
    --chat-cream-dark: #f0e8dc;
    --chat-shadow: 0 24px 60px rgba(42, 8, 9, .28);
    --chat-z: 1040;
    position: fixed;
    right: max(1rem, env(safe-area-inset-right, 0px));
    bottom: calc(var(--mobile-tabs-height, 64px) + var(--safe-bottom, 0px) + 1rem);
    z-index: var(--chat-z);
    font-family: "Plus Jakarta Sans", system-ui, sans-serif;
}

@media (min-width: 992px) {
    .lutador-chatbot {
        bottom: max(1.25rem, env(safe-area-inset-bottom, 0px));
    }
}

.lutador-chatbot__launcher {
    position: relative;
    width: 64px;
    height: 64px;
    border: 0;
    border-radius: 50%;
    padding: 0;
    background: var(--chat-burgundy-deep);
    box-shadow: 0 12px 32px rgba(78, 16, 20, .45), 0 0 0 1px rgba(201, 162, 39, .25);
    cursor: pointer;
    transition: transform .28s cubic-bezier(.4, 0, .2, 1), box-shadow .28s ease;
    overflow: hidden;
    isolation: isolate;
}

.lutador-chatbot__launcher:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 18px 40px rgba(78, 16, 20, .5), 0 0 0 2px rgba(201, 162, 39, .4);
}

.lutador-chatbot__launcher:focus-visible {
    outline: 3px solid var(--chat-gold);
    outline-offset: 3px;
}

.lutador-chatbot.is-open .lutador-chatbot__launcher {
    transform: scale(.92);
    opacity: .85;
}

.lutador-chatbot__launcher-ring {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid rgba(201, 162, 39, .45);
    animation: chatbot-pulse 2.4s ease-out infinite;
    pointer-events: none;
    z-index: 0;
}

.lutador-chatbot.is-open .lutador-chatbot__launcher-ring {
    animation: none;
    opacity: 0;
}

@keyframes chatbot-pulse {
    0% { transform: scale(1); opacity: .7; }
    70% { transform: scale(1.18); opacity: 0; }
    100% { transform: scale(1.18); opacity: 0; }
}

.lutador-chatbot__launcher-icon {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    overflow: hidden;
    clip-path: circle(50% at 50% 50%);
    background: var(--chat-cream);
    pointer-events: none;
    z-index: 1;
}

.lutador-chatbot__launcher-img {
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: contain;
    object-position: center center;
    display: block;
    margin: 0;
    padding: 3px;
    border: 0;
}

.lutador-chatbot__launcher-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    z-index: 2;
    min-width: 1.5rem;
    height: 1.5rem;
    padding: 0 .35rem;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--chat-gold) 0%, #a67c00 100%);
    color: var(--chat-burgundy-deep);
    font-size: .62rem;
    font-weight: 800;
    letter-spacing: .04em;
    display: grid;
    place-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
}

.lutador-chatbot__panel {
    position: absolute;
    right: 0;
    bottom: calc(100% + .75rem);
    width: min(400px, calc(100vw - 2rem));
    max-height: min(640px, calc(100dvh - var(--mobile-tabs-height, 64px) - 6rem));
    display: flex;
    flex-direction: column;
    border-radius: 22px;
    overflow: hidden;
    background: var(--chat-cream);
    box-shadow: var(--chat-shadow);
    border: 1px solid rgba(201, 162, 39, .22);
    transform-origin: bottom right;
    animation: chatbot-panel-in .32s cubic-bezier(.4, 0, .2, 1);
}

.lutador-chatbot__panel[hidden] {
    display: none !important;
}

@keyframes chatbot-panel-in {
    from { opacity: 0; transform: translateY(12px) scale(.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.lutador-chatbot__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .9rem 1rem;
    background: linear-gradient(135deg, var(--chat-burgundy) 0%, var(--chat-burgundy-deep) 100%);
    color: #fff;
    border-bottom: 1px solid rgba(201, 162, 39, .35);
}

.lutador-chatbot__header-brand {
    display: flex;
    align-items: center;
    gap: .7rem;
    min-width: 0;
}

.lutador-chatbot__header-brand .lutador-chatbot__avatar-wrap {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    clip-path: circle(50% at 50% 50%);
    flex-shrink: 0;
    border: 2px solid rgba(201, 162, 39, .5);
    background: var(--chat-cream);
}

.lutador-chatbot__header-brand .lutador-chatbot__avatar {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center center;
    display: block;
    padding: 2px;
}

.lutador-chatbot__title {
    margin: 0;
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: .01em;
}

.lutador-chatbot__status {
    margin: .15rem 0 0;
    font-size: .72rem;
    opacity: .88;
    display: flex;
    align-items: center;
    gap: .35rem;
}

.lutador-chatbot__status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #5ee07a;
    box-shadow: 0 0 8px rgba(94, 224, 122, .8);
}

.lutador-chatbot__close {
    width: 2rem;
    height: 2rem;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .1);
    color: #fff;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: background .2s ease;
    flex-shrink: 0;
}

.lutador-chatbot__close:hover {
    background: rgba(255, 255, 255, .2);
}

.lutador-chatbot__messages {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: .75rem;
    scroll-behavior: smooth;
    background:
        radial-gradient(ellipse at top right, rgba(201, 162, 39, .08), transparent 55%),
        var(--chat-cream);
}

.lutador-chatbot__msg {
    display: flex;
    gap: .55rem;
    max-width: 92%;
    animation: chatbot-msg-in .28s ease;
}

@keyframes chatbot-msg-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.lutador-chatbot__msg--user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.lutador-chatbot__msg-avatar-wrap {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    overflow: hidden;
    clip-path: circle(50% at 50% 50%);
    flex-shrink: 0;
    margin-top: .15rem;
    background: var(--chat-cream);
    box-shadow: 0 0 0 1px rgba(78, 16, 20, .08);
}

.lutador-chatbot__msg-avatar {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center center;
    display: block;
    padding: 1px;
}

.lutador-chatbot__msg--user .lutador-chatbot__msg-avatar-wrap {
    display: none;
}

.lutador-chatbot__bubble {
    padding: .65rem .85rem;
    border-radius: 16px;
    font-size: .88rem;
    line-height: 1.5;
    word-break: break-word;
}

.lutador-chatbot__msg--bot .lutador-chatbot__bubble {
    background: #fff;
    color: #2a1214;
    border: 1px solid var(--chat-cream-dark);
    border-bottom-left-radius: 6px;
    box-shadow: 0 4px 14px rgba(78, 16, 20, .06);
}

.lutador-chatbot__msg--user .lutador-chatbot__bubble {
    background: linear-gradient(135deg, var(--chat-burgundy) 0%, #6b1820 100%);
    color: #fff;
    border-bottom-right-radius: 6px;
}

.lutador-chatbot__bubble a {
    color: var(--chat-burgundy);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.lutador-chatbot__msg--user .lutador-chatbot__bubble a {
    color: var(--chat-gold-soft);
}

.lutador-chatbot__typing {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .5rem .2rem;
}

.lutador-chatbot__typing span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--chat-burgundy);
    opacity: .45;
    animation: chatbot-typing 1.1s infinite ease-in-out;
}

.lutador-chatbot__typing span:nth-child(2) { animation-delay: .15s; }
.lutador-chatbot__typing span:nth-child(3) { animation-delay: .3s; }

@keyframes chatbot-typing {
    0%, 80%, 100% { transform: translateY(0); opacity: .35; }
    40% { transform: translateY(-4px); opacity: 1; }
}

.lutador-chatbot__chips {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    padding: 0 .85rem .65rem;
    background: var(--chat-cream);
}

.lutador-chatbot__chip {
    border: 1px solid rgba(78, 16, 20, .15);
    background: #fff;
    color: var(--chat-burgundy);
    border-radius: 999px;
    padding: .3rem .65rem;
    font-size: .72rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s ease, border-color .2s ease;
}

.lutador-chatbot__chip:hover {
    background: var(--chat-cream-dark);
    border-color: rgba(201, 162, 39, .5);
}

.lutador-chatbot__composer {
    display: flex;
    align-items: flex-end;
    gap: .5rem;
    padding: .65rem .85rem;
    background: #fff;
    border-top: 1px solid var(--chat-cream-dark);
}

.lutador-chatbot__input {
    flex: 1;
    resize: none;
    border: 1px solid var(--chat-cream-dark);
    border-radius: 14px;
    padding: .6rem .75rem;
    font-size: .88rem;
    line-height: 1.4;
    max-height: 120px;
    background: var(--chat-cream);
    color: #2a1214;
}

.lutador-chatbot__input:focus {
    outline: none;
    border-color: rgba(201, 162, 39, .65);
    box-shadow: 0 0 0 3px rgba(201, 162, 39, .18);
}

.lutador-chatbot__input:disabled {
    opacity: .6;
    cursor: not-allowed;
}

.lutador-chatbot__send {
    width: 2.5rem;
    height: 2.5rem;
    border: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--chat-gold) 0%, #a67c00 100%);
    color: var(--chat-burgundy-deep);
    display: grid;
    place-items: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform .2s ease, opacity .2s ease;
}

.lutador-chatbot__send:hover:not(:disabled) {
    transform: scale(1.05);
}

.lutador-chatbot__send:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.lutador-chatbot__footnote {
    margin: 0;
    padding: .35rem .85rem .65rem;
    font-size: .65rem;
    color: rgba(42, 18, 20, .55);
    text-align: center;
    background: #fff;
}

.lutador-chatbot__footnote a {
    color: var(--chat-burgundy);
    font-weight: 600;
    text-decoration: none;
}

.lutador-chatbot__footnote a:hover {
    text-decoration: underline;
}

@media (max-width: 480px) {
    .lutador-chatbot {
        right: .75rem;
    }

    .lutador-chatbot__panel {
        width: calc(100vw - 1.5rem);
        max-height: min(72dvh, 520px);
    }
}
