/* Funesbom Chatbot Final - Design Moderno e Responsivo */

.funesbom-chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

/* Posicionamento dinâmico */
.funesbom-chatbot-container[data-position="bottom-left"] {
    bottom: 20px;
    left: 20px;
    right: auto;
}

.funesbom-chatbot-container[data-position="top-right"] {
    top: 20px;
    right: 20px;
    bottom: auto;
}

.funesbom-chatbot-container[data-position="top-left"] {
    top: 20px;
    left: 20px;
    bottom: auto;
    right: auto;
}

/* Botão de toggle aprimorado */
.chatbot-toggle {
    background: linear-gradient(135deg, #25D366 0%, #028131 100%);
    color: white;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(30, 224, 30, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    font-weight: 600;
    font-size: 15px;
    border: none;
    outline: none;
    animation: pulseSoft 2s ease-in-out infinite;
    padding: 0;
}

.chatbot-toggle:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 32px rgba(30, 224, 30, 0.5);
    background: linear-gradient(135deg, #09A844 0%, #006626 100%);
    animation: pulseSoft 1.5s ease-in-out infinite;
}

.chatbot-toggle:active {
    transform: translateY(-1px) scale(0.98);
}

.chatbot-toggle:focus {
    outline: 2px solid #028131;
    outline-offset: 2px;
}

.chatbot-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chatbot-text {
    display: none;
    /* font-weight: 600;
    font-size: 15px;
    letter-spacing: 0.3px; */
}

/* Janela do chatbot redesenhada */
.chatbot-window {
    position: absolute;
    bottom: 90px;
    right: 0;
    width: 380px;
    height: 550px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.chatbot-window.active {
    display: flex;
    animation: slideUpFade 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Ajustes de posicionamento para diferentes posições */
.funesbom-chatbot-container[data-position="bottom-left"] .chatbot-window {
    right: auto;
    left: 0;
}

.funesbom-chatbot-container[data-position="top-right"] .chatbot-window {
    bottom: auto;
    top: 90px;
}

.funesbom-chatbot-container[data-position="top-left"] .chatbot-window {
    bottom: auto;
    top: 90px;
    right: auto;
    left: 0;
}

/* Cabeçalho melhorado */
.chatbot-header {
    background: linear-gradient(135deg, #e01e1e 0%, #b91414 100%);
    color: white;
    padding: 24px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.chatbot-title {
    display: flex;
    align-items: center;
    gap: 14px;
}

.chatbot-avatar {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.chatbot-info h3 {
    margin: 0 0 4px 0;
    font-size: 17px;
    font-weight: 700;
    color: white;
    letter-spacing: 0.3px;
}

.chatbot-status {
    font-size: 13px;
    opacity: 0.95;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.chatbot-status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    display: inline-block;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes pulseSoft {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 8px 24px rgba(30, 224, 30, 0.4);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 12px 32px rgba(30, 224, 30, 0.6);
    }
}

.chatbot-close {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
}

.chatbot-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: rotate(90deg);
}

.chatbot-close:focus {
    outline: 2px solid white;
    outline-offset: 2px;
}

/* Área de mensagens aprimorada */
.chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: linear-gradient(to bottom, #ffffff 0%, #f8fafc 100%);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Mensagens aprimoradas */
.message {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    animation: messageSlide 0.3s ease;
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #e01e1e 0%, #b91414 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.message-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.message-content p {
    margin: 0;
    padding: 14px 16px;
    background: white;
    border-radius: 16px 16px 16px 4px;
    color: #1e293b;
    font-size: 14px;
    line-height: 1.6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #f1f5f9;
    word-wrap: break-word;
}

.user-message {
    flex-direction: row-reverse;
}

.user-message .message-content p {
    background: linear-gradient(135deg, #e01e1e 0%, #b91414 100%);
    color: white;
    border-radius: 16px 16px 4px 16px;
    border: none;
}

.message-time {
    font-size: 11px;
    color: #94a3b8;
    padding: 0 8px;
    font-weight: 500;
}

/* Indicador de digitação aprimorado */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 14px 16px;
    background: white;
    border-radius: 16px 16px 16px 4px;
    width: fit-content;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #f1f5f9;
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: #cbd5e1;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        background: #cbd5e1;
    }
    30% {
        transform: translateY(-6px);
        background: #e01e1e;
    }
}

/* Ações rápidas redesenhadas */
.quick-actions {
    padding: 16px 20px 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    background: white;
    border-top: 1px solid #f1f5f9;
}

.quick-action-btn {
    background: white;
    border: 2px solid #e01e1e;
    color: #e01e1e;
    padding: 10px 16px;
    border-radius: 24px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    letter-spacing: 0.3px;
    outline: none;
}

.quick-action-btn:hover {
    background: #e01e1e;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(224, 30, 30, 0.3);
}

.quick-action-btn:active {
    transform: translateY(0);
}

.quick-action-btn:focus {
    outline: 2px solid #e01e1e;
    outline-offset: 2px;
}

/* Estilos para cards do menu - similar à segunda imagem */
.chatbot-menu-list {
    margin: 16px 0;
}

.chatbot-menu-item {
    display: flex;
    align-items: flex-start;
    padding: 16px;
    margin: 12px 0;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.chatbot-menu-item:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.chatbot-menu-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e2e8f0;
    border-radius: 8px;
    margin-right: 16px;
    flex-shrink: 0;
    font-size: 18px;
    color: #64748b;
}

.chatbot-menu-item:hover .chatbot-menu-icon {
    background: #cbd5e1;
    color: #475569;
}

.chatbot-menu-text {
    flex: 1;
    min-width: 0;
}

.chatbot-menu-title {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
    font-size: 15px;
    line-height: 1.4;
}

.chatbot-menu-description {
    font-size: 13px;
    color: #64748b;
    line-height: 1.4;
    margin: 0;
}

/* Breadcrumb navigation */
.breadcrumb {
    margin-bottom: 16px;
    padding: 12px 0;
    border-bottom: 1px solid #e2e8f0;
    font-size: 14px;
}

.breadcrumb-item {
    color: #e01e1e;
    cursor: pointer;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.breadcrumb-item:hover {
    color: #c71616;
    text-decoration: underline;
}

.breadcrumb-separator {
    margin: 0 8px;
    color: #94a3b8;
}

/* Form containers */
.form-container {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin: 16px 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.form-title {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-submit {
    background: linear-gradient(135deg, #e01e1e 0%, #b91414 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    margin-top: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(224, 30, 30, 0.2);
}

.form-submit:hover {
    background: linear-gradient(135deg, #c71616 0%, #a01212 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(224, 30, 30, 0.3);
}

.form-submit:active {
    transform: translateY(0);
}

.option-button {
    background: #28a745;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    margin: 4px 8px 4px 0;
    transition: all 0.2s ease;
}

.option-button:hover {
    background: #218838;
    transform: translateY(-1px);
}

/* Quick options container */
.quick-options {
    margin: 16px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Input redesenhado */
.input-wrapper {
    padding: 16px 20px;
    background: white;
    display: flex;
    gap: 12px;
    align-items: center;
    border-top: 1px solid #f1f5f9;
}

#chatbot-input {
    flex: 1;
    border: 2px solid #e2e8f0;
    border-radius: 24px;
    padding: 12px 18px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
    font-family: inherit;
    background: white;
}

#chatbot-input:focus {
    border-color: #e01e1e;
    box-shadow: 0 0 0 3px rgba(224, 30, 30, 0.1);
}

#chatbot-input::placeholder {
    color: #94a3b8;
}

.send-button {
    background: linear-gradient(135deg, #e01e1e 0%, #b91414 100%);
    border: none;
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    outline: none;
}

.send-button i {
    font-size: 18px;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.send-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(224, 30, 30, 0.4);
}

.send-button:hover i {
    transform: scale(1.1);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.send-button:active {
    transform: scale(0.95);
}

.send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.send-button:focus {
    outline: 2px solid #e01e1e;
    outline-offset: 2px;
}

/* Responsividade */
@media (max-width: 768px) {
    .funesbom-chatbot-container {
        bottom: 16px;
        right: 16px;
    }

    .funesbom-chatbot-container[data-position="bottom-left"] {
        left: 16px;
        right: auto;
    }

    .funesbom-chatbot-container[data-position="top-right"] {
        top: 16px;
        right: 16px;
        bottom: auto;
    }

    .funesbom-chatbot-container[data-position="top-left"] {
        top: 16px;
        left: 16px;
        bottom: auto;
        right: auto;
    }

    .chatbot-toggle {
        width: 56px;
        height: 56px;
    }

    .chatbot-icon {
        width: 24px;
        height: 24px;
    }

    .chatbot-window {
        width: 320px;
        height: 500px;
        right: 0;
        bottom: 68px;
    }

    .funesbom-chatbot-container[data-position="bottom-left"] .chatbot-window {
        right: auto;
        left: 0;
    }

    .funesbom-chatbot-container[data-position="top-right"] .chatbot-window {
        bottom: auto;
        top: 68px;
    }

    .funesbom-chatbot-container[data-position="top-left"] .chatbot-window {
        bottom: auto;
        top: 68px;
        right: auto;
        left: 0;
    }
}

@media (max-width: 480px) {
    .chatbot-window {
        width: 280px;
        height: 450px;
        bottom: 64px;
    }

    .funesbom-chatbot-container[data-position="bottom-left"] .chatbot-window {
        right: auto;
        left: 0;
    }

    .funesbom-chatbot-container[data-position="top-right"] .chatbot-window {
        bottom: auto;
        top: 64px;
    }

    .funesbom-chatbot-container[data-position="top-left"] .chatbot-window {
        bottom: auto;
        top: 64px;
        right: auto;
        left: 0;
    }

    .chatbot-header {
        padding: 18px 16px;
    }

    .chatbot-messages {
        padding: 16px;
    }

    .input-wrapper {
        padding: 12px 16px;
    }


}

/* Loading state */
.chatbot-loading .send-button {
    animation: rotate 1s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Empty state */
.chatbot-empty {
    text-align: center;
    padding: 40px 20px;
    color: #64748b;
}

.chatbot-empty svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.chatbot-empty p {
    margin: 0;
    font-size: 14px;
}

/* Animações de entrada */
.funesbom-chatbot-container {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animação de scroll */
.funesbom-chatbot-container.chatbot-hidden {
    transform: translateY(100px);
    opacity: 0.7;
    transition: all 0.3s ease;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .chatbot-window {
        background: #1e293b;
        border-color: #334155;
    }

    .chatbot-messages {
        background: linear-gradient(to bottom, #0f172a 0%, #1e293b 100%);
    }

    .message-content p {
        background: #334155;
        color: #f1f5f9;
        border-color: #475569;
    }

    #chatbot-input {
        background: #334155;
        color: #f1f5f9;
        border-color: #475569;
    }

    .quick-actions {
        background: #1e293b;
        border-color: #334155;
    }

    .input-wrapper {
        background: #1e293b;
        border-color: #334155;
    }

    .typing-indicator {
        background: #334155;
        border-color: #475569;
    }
}

/* Acessibilidade */
@media (prefers-reduced-motion: reduce) {
    .funesbom-chatbot-container,
    .chatbot-window,
    .message,
    .typing-dot,
    .chatbot-toggle,
    .send-button,
    .quick-action-btn {
        animation: none;
        transition: none;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .chatbot-toggle {
        border: 2px solid white;
    }
    
    .chatbot-window {
        border: 2px solid #000;
    }
    
    .message-content p {
        border: 2px solid #000;
    }
    
    #chatbot-input {
        border: 2px solid #000;
    }
}