/* Chatbot Lidera SST — estilos autossuficientes (não dependem de main.css) */

.chatbot-toggle {
    position: fixed;
    bottom: 26px;
    right: 26px;
    width: 58px;
    height: 58px;
    background: linear-gradient(135deg, #004e8a 0%, #0066b2 100%);
    border: none;
    border-radius: 50%;
    color: #ffffff;
    font-size: 1.4rem;
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(0, 78, 138, 0.42);
    z-index: 1400;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    font-family: 'Inter', system-ui, sans-serif;
}

.chatbot-toggle:hover {
    transform: scale(1.06);
    box-shadow: 0 12px 28px rgba(0, 78, 138, 0.55);
}

.chatbot-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ff5a4d;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-container {
    position: fixed;
    bottom: 96px;
    right: 26px;
    width: 380px;
    height: 560px;
    max-height: calc(100vh - 120px);
    background: #ffffff;
    border: 1px solid #e2eaf7;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(16, 26, 41, 0.22);
    z-index: 1401;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.96);
    transition: opacity 0.28s ease, transform 0.28s ease, visibility 0.28s ease;
    font-family: 'Inter', system-ui, sans-serif;
}

.chatbot-container.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.chatbot-header {
    background: linear-gradient(135deg, #004e8a 0%, #0066b2 100%);
    padding: 1.1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.chatbot-header-content {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.chatbot-avatar {
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #ffffff;
    flex-shrink: 0;
}

.chatbot-info h3 {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.98rem;
    font-weight: 800;
    color: #ffffff;
    margin: 0;
    line-height: 1.2;
}

.chatbot-info p {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.chatbot-info p::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #4ade80;
    display: inline-block;
}

.chatbot-close {
    background: rgba(255, 255, 255, 0.18);
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.25s ease, transform 0.25s ease;
    flex-shrink: 0;
}

.chatbot-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    background: #f4f7fd;
}

.chatbot-messages::-webkit-scrollbar { width: 6px; }
.chatbot-messages::-webkit-scrollbar-track { background: transparent; }
.chatbot-messages::-webkit-scrollbar-thumb { background: #ccd4e0; border-radius: 3px; }

.message {
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
    animation: messageSlide 0.3s ease;
}

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

.bot-message { justify-content: flex-start; }
.user-message { justify-content: flex-end; }

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.85rem;
}

.bot-message .message-avatar {
    background: linear-gradient(135deg, #004e8a 0%, #0066b2 100%);
    color: #ffffff;
}

.user-message .message-avatar {
    background: #e0e9fa;
    color: #004e8a;
}

.message-content {
    max-width: 76%;
    padding: 0.7rem 0.95rem;
    border-radius: 14px;
}

.bot-message .message-content {
    background: #ffffff;
    border: 1px solid #e2eaf7;
    color: #101a29;
    border-radius: 14px 14px 14px 4px;
}

.user-message .message-content {
    background: linear-gradient(135deg, #004e8a 0%, #0066b2 100%);
    color: #ffffff;
    border-radius: 14px 14px 4px 14px;
}

.message-content p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.55;
}

.message-content p:not(:last-child) { margin-bottom: 0.5rem; }

.bot-message .message-content strong { color: #004e8a; font-weight: 700; }
.user-message .message-content strong { color: #ffffff; font-weight: 700; }
.message-content a { color: inherit; }

.chatbot-input-container {
    padding: 0.85rem 1rem;
    background: #ffffff;
    border-top: 1px solid #e2eaf7;
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-shrink: 0;
}

.chatbot-input {
    flex: 1;
    padding: 0.75rem 1rem;
    background: #f4f7fd;
    border: 1.5px solid #d8e3fb;
    border-radius: 25px;
    color: #101a29;
    font-size: 0.92rem;
    font-weight: 500;
    font-family: 'Inter', system-ui, sans-serif;
    outline: none;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.chatbot-input:focus {
    border-color: #0066b2;
    box-shadow: 0 0 0 4px rgba(0, 102, 178, 0.14);
    background: #ffffff;
}

.chatbot-input::placeholder { color: #8a94a6; }

.chatbot-send {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #004e8a 0%, #0066b2 100%);
    border: none;
    border-radius: 50%;
    color: #ffffff;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    flex-shrink: 0;
}

.chatbot-send:hover { transform: scale(1.08); box-shadow: 0 4px 15px rgba(0, 78, 138, 0.4); }
.chatbot-send:active { transform: scale(0.95); }

/* Responsivo */
@media (max-width: 768px) {
    .chatbot-container {
        width: calc(100vw - 32px);
        height: calc(100vh - 130px);
        right: 16px;
        bottom: 84px;
        max-height: none;
    }
    .chatbot-toggle { bottom: 18px; right: 18px; width: 54px; height: 54px; }
}

@media (max-width: 480px) {
    .chatbot-container { width: calc(100vw - 20px); right: 10px; }
}
