/* ==============================================================================
   LUGAREIROS IA - Widget de Chat Flutuante (Estilos Autônomos & Animações)
   ============================================================================== */

@keyframes aiPulseGlow {
    0%, 100% {
        box-shadow: 0 0 15px rgba(16, 185, 129, 0.4), 0 0 30px rgba(5, 150, 105, 0.2);
    }
    50% {
        box-shadow: 0 0 25px rgba(16, 185, 129, 0.7), 0 0 45px rgba(5, 150, 105, 0.4);
    }
}

@keyframes aiFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-4px);
    }
}

@keyframes aiSlideUp {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes aiDotBounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

@keyframes aiPing {
    75%, 100% {
        transform: scale(2.2);
        opacity: 0;
    }
}

/* Container do Botão Flutuante */
#ai-widget-container {
    position: fixed !important;
    bottom: 5.25rem !important; /* acima do bottom nav no mobile */
    right: 1.25rem !important;
    z-index: 9999 !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    pointer-events: auto !important;
}

@media (min-width: 768px) {
    #ai-widget-container {
        bottom: 2rem !important;
        right: 2rem !important;
    }
}

/* Botão Circular Flutuante do Lugareiros IA */
#ai-widget-toggle-btn {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 58px !important;
    height: 58px !important;
    min-width: 58px !important;
    min-height: 58px !important;
    border-radius: 18px !important;
    background: linear-gradient(135deg, #059669 0%, #10b981 50%, #2dd4bf 100%) !important;
    color: #020617 !important;
    border: 2px solid rgba(167, 243, 208, 0.85) !important;
    box-shadow: 0 10px 25px -4px rgba(5, 150, 105, 0.65), 0 4px 12px rgba(0, 0, 0, 0.5) !important;
    cursor: pointer !important;
    outline: none !important;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    animation: aiFloat 4s ease-in-out infinite, aiPulseGlow 3s ease-in-out infinite;
}

#ai-widget-toggle-btn:hover {
    transform: scale(1.08) !important;
    box-shadow: 0 14px 30px -4px rgba(16, 185, 129, 0.8), 0 6px 14px rgba(0, 0, 0, 0.6) !important;
}

#ai-widget-toggle-btn:active {
    transform: scale(0.94) !important;
}

#ai-widget-toggle-btn .ai-icon {
    font-size: 26px !important;
    line-height: 1 !important;
    transition: transform 0.3s ease !important;
}

#ai-widget-toggle-btn:hover .ai-icon {
    transform: rotate(15deg) !important;
}

/* Status Indicator (Pulse) */
.ai-status-indicator {
    position: absolute !important;
    top: -3px !important;
    right: -3px !important;
    width: 14px !important;
    height: 14px !important;
    background-color: #34d399 !important;
    border: 2px solid #020617 !important;
    border-radius: 9999px !important;
    pointer-events: none !important;
}

.ai-status-ping {
    position: absolute !important;
    top: -3px !important;
    right: -3px !important;
    width: 14px !important;
    height: 14px !important;
    background-color: #34d399 !important;
    border-radius: 9999px !important;
    animation: aiPing 1.5s cubic-bezier(0, 0, 0.2, 1) infinite !important;
    pointer-events: none !important;
}

/* Modal Flutuante */
#ai-widget-modal {
    position: fixed !important;
    bottom: 5.5rem !important;
    right: 1rem !important;
    width: calc(100% - 2rem) !important;
    max-width: 420px !important;
    height: 560px !important;
    max-height: 82vh !important;
    z-index: 10000 !important;
}

@media (min-width: 768px) {
    #ai-widget-modal {
        bottom: 6.5rem !important;
        right: 2rem !important;
        width: 420px !important;
    }
}

.ai-widget-modal {
    animation: aiSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.ai-typing-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #10b981;
    animation: aiDotBounce 1.4s infinite ease-in-out both;
}

.ai-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.ai-typing-dot:nth-child(2) { animation-delay: -0.16s; }
.ai-typing-dot:nth-child(3) { animation-delay: 0s; }

/* Custom scrollbar para a janela de mensagens */
.ai-messages-container::-webkit-scrollbar {
    width: 5px;
}
.ai-messages-container::-webkit-scrollbar-track {
    background: transparent;
}
.ai-messages-container::-webkit-scrollbar-thumb {
    background: rgba(51, 65, 85, 0.6);
    border-radius: 10px;
}
.ai-messages-container::-webkit-scrollbar-thumb:hover {
    background: rgba(16, 185, 129, 0.5);
}
