/* ── Widget de chat de suporte ── */
.support-float {
    position: fixed;
    bottom: 28px;
    left: 28px;
    z-index: 9999;
    pointer-events: none;
}

.support-chat-panel {
    position: absolute;
    bottom: calc(100% + 14px);
    left: 0;
    width: 360px;
    max-width: calc(100vw - 32px);
    height: 520px;
    max-height: calc(100vh - 120px);
    background: #0f0f0f;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 0, 0, 0.08);
    display: none;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px) scale(0.96);
    transform-origin: bottom left;
    transition: opacity 0.28s ease, transform 0.28s ease, visibility 0.28s;
    pointer-events: none;
}

.support-chat-panel.is-open {
    display: flex;
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.support-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    background: linear-gradient(135deg, #1a0000 0%, #120000 100%);
    border-bottom: 1px solid rgba(255, 0, 0, 0.15);
}

.support-chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.support-chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255, 0, 0, 0.12);
    border: 1px solid rgba(255, 0, 0, 0.25);
    display: grid;
    place-items: center;
    font-size: 18px;
    flex-shrink: 0;
}

.support-chat-title-wrap h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.02em;
}

.support-chat-title-wrap p {
    margin: 2px 0 0;
    font-size: 12px;
    color: #8a8a8a;
    display: flex;
    align-items: center;
    gap: 6px;
}

.support-chat-status {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.8);
    flex-shrink: 0;
}

.support-chat-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.support-chat-icon-btn {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    color: #bbb;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: background 0.2s, color 0.2s;
}

.support-chat-icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.support-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 18px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background:
        radial-gradient(circle at top, rgba(255, 0, 0, 0.04), transparent 45%),
        #0a0a0a;
    scroll-behavior: smooth;
}

.support-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.support-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 999px;
}

.support-chat-bubble {
    max-width: 85%;
    padding: 11px 14px;
    border-radius: 16px;
    font-size: 13.5px;
    line-height: 1.55;
    word-break: break-word;
    animation: chatBubbleIn 0.25s ease;
}

@keyframes chatBubbleIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.support-chat-bubble--support {
    align-self: flex-start;
    background: #171717;
    border: 1px solid rgba(255, 255, 255, 0.07);
    color: #e8e8e8;
    border-bottom-left-radius: 6px;
}

.support-chat-bubble--user {
    align-self: flex-end;
    background: linear-gradient(135deg, #cc0000, #ff0000);
    color: #fff;
    border-bottom-right-radius: 6px;
    box-shadow: 0 8px 20px rgba(255, 0, 0, 0.2);
}

.support-chat-meta {
    display: block;
    margin-top: 6px;
    font-size: 10px;
    opacity: 0.65;
}

.support-chat-system {
    align-self: center;
    max-width: 92%;
    text-align: center;
    font-size: 12px;
    color: #777;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.support-chat-typing {
    align-self: flex-start;
    display: none;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 16px;
    border-bottom-left-radius: 6px;
    background: #171717;
    border: 1px solid rgba(255, 255, 255, 0.07);
    color: #aaa;
    font-size: 12.5px;
}

.support-chat-typing.is-visible {
    display: inline-flex;
    animation: chatBubbleIn 0.25s ease;
}

.support-chat-typing-dots {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}

.support-chat-typing-dots span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #ff0000;
    animation: chatTypingDot 1.2s infinite ease-in-out;
}

.support-chat-typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.support-chat-typing-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes chatTypingDot {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.35; }
    40% { transform: translateY(-4px); opacity: 1; }
}

.support-chat-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #888;
    font-size: 13px;
    padding: 24px 0;
}

.support-chat-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.12);
    border-top-color: #ff0000;
    border-radius: 50%;
    animation: chatSpin 0.7s linear infinite;
}

@keyframes chatSpin {
    to { transform: rotate(360deg); }
}

.support-chat-footer {
    padding: 14px 14px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: #0f0f0f;
}

.support-chat-input-wrap {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 8px 8px 8px 14px;
    background: #151515;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.support-chat-input-wrap:focus-within {
    border-color: rgba(255, 0, 0, 0.35);
    box-shadow: 0 0 0 3px rgba(255, 0, 0, 0.08);
}

.support-chat-input {
    flex: 1;
    border: none;
    background: transparent;
    color: #fff;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    max-height: 96px;
    min-height: 22px;
    line-height: 1.45;
    outline: none;
}

.support-chat-input::placeholder {
    color: #666;
}

.support-chat-send {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #cc0000, #ff0000);
    color: #fff;
    cursor: pointer;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 6px 16px rgba(255, 0, 0, 0.25);
}

.support-chat-send:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(255, 0, 0, 0.35);
}

.support-chat-send:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.support-chat-send svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.support-float-btn {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: linear-gradient(135deg, #cc0000, #ff0000);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(255, 0, 0, 0.45);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    position: relative;
    flex-shrink: 0;
    pointer-events: auto;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.support-float-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 10px 30px rgba(255, 0, 0, 0.55);
}

.support-float-btn.is-active {
    transform: scale(1.02);
}

.support-float-btn svg {
    width: 28px;
    height: 28px;
    fill: white;
}

.support-float-btn::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid rgba(255, 0, 0, 0.35);
    animation: supportPulse 2.2s ease-out infinite;
}

.support-float-btn.is-active::before {
    animation: none;
    opacity: 0;
}

@keyframes supportPulse {
    0% { transform: scale(1); opacity: 0.7; }
    70% { transform: scale(1.5); opacity: 0; }
    100% { transform: scale(1.5); opacity: 0; }
}

@media (max-width: 480px) {
    .support-float {
        left: 16px;
        bottom: 16px;
    }

    .support-chat-panel {
        width: calc(100vw - 32px);
        height: min(72vh, 520px);
    }
}
