/* --- Elementos do Chatbot para o PWA --- */
.chatbot-trigger {
    position: fixed;
    bottom: 85px;
    /* Acima da bottom-nav do PWA */
    right: 20px;
    width: 60px;
    height: 60px;
    background: var(--brand-cyan, #00d9c0);
    color: var(--brand-dark, #0a0b10);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 217, 192, 0.4);
    z-index: 999;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
}

.chatbot-trigger:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 217, 192, 0.6);
}

.chatbot-trigger svg {
    transition: transform 0.3s ease;
}

/* Bolha animada de notificação no botão */
.chatbot-trigger::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 14px;
    height: 14px;
    background: #ef4444;
    border: 2px solid var(--brand-dark, #0a0b10);
    border-radius: 50%;
    animation: ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes ping {

    75%,
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.chatbot-window {
    position: fixed;
    bottom: 155px;
    /* Acima do botão trigger */
    right: 20px;
    width: 350px;
    height: 480px;
    max-height: calc(100vh - 180px);
    max-width: calc(100vw - 40px);
    background: rgba(15, 15, 26, 0.95);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.9) translateY(20px);
    transform-origin: bottom right;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(20px);
}

.chatbot-wrapper.active .chatbot-window {
    opacity: 1;
    visibility: visible;
    transform: scale(1) translateY(0);
}

.chatbot-header {
    background: rgba(255, 255, 255, 0.05);
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chatbot-title .bot-icon {
    font-size: 1.5rem;
    background: rgba(0, 217, 192, 0.1);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid rgba(0, 217, 192, 0.3);
}

.chatbot-title h4 {
    margin: 0;
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    color: var(--text-color, #ffffff);
}

.bot-status {
    font-size: 0.75rem;
    color: var(--brand-cyan, #00d9c0);
    display: flex;
    align-items: center;
    gap: 4px;
}

.bot-status::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background: var(--brand-cyan, #00d9c0);
    border-radius: 50%;
    box-shadow: 0 0 5px var(--brand-cyan, #00d9c0);
}

.chatbot-close {
    background: none;
    border: none;
    color: var(--text-muted, #9ca3af);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s ease;
    line-height: 1;
}

.chatbot-close:hover {
    color: #ef4444;
}

.chatbot-messages {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

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

.chatbot-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.chatbot-message {
    max-width: 85%;
    padding: 1rem;
    border-radius: 16px;
    font-size: 0.9rem;
    line-height: 1.5;
    animation: message-in 0.3s ease forwards;
}

.chatbot-message.bot {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-color, #ffffff);
    border-bottom-left-radius: 4px;
    align-self: flex-start;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
}

.chatbot-message.user {
    background: rgba(0, 217, 192, 0.15);
    color: var(--brand-cyan, #00d9c0);
    border-bottom-right-radius: 4px;
    align-self: flex-end;
    border: 1px solid rgba(0, 217, 192, 0.3);
}

@keyframes message-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chatbot-options {
    padding: 1rem 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.chatbot-options button {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    color: var(--text-color, #ffffff);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chatbot-options button:hover {
    background: var(--brand-cyan, #00d9c0);
    color: #000;
    border-color: var(--brand-cyan, #00d9c0);
}