/* Chat IA Simulada - Estilo */

.chat-ai-container {
    position: fixed;
    bottom: 6rem;
    right: 1.5rem;
    z-index: 1000;
}

.chat-ai-button {
    width: 3.5rem;
    height: 3.5rem;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.chat-ai-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
    background: linear-gradient(135deg, #2563eb, #1e40af);
}

.chat-ai-button .pulse-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 2px solid #3b82f6;
    border-radius: 50%;
    animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

.chat-ai-window {
    position: absolute;
    bottom: 4.5rem;
    right: 0;
    width: 360px;
    height: 500px;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid #e2e8f0;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.chat-ai-window.active {
    display: flex;
    animation: slideUp 0.3s ease-out;
}

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

.chat-ai-header {
    background: linear-gradient(135deg, #1e293b, #334155);
    color: white;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: between;
    border-radius: 1rem 1rem 0 0;
}

.chat-ai-header-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.chat-ai-avatar {
    width: 2.5rem;
    height: 2.5rem;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    position: relative;
}

.chat-ai-avatar::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0.75rem;
    height: 0.75rem;
    background: #10b981;
    border: 2px solid white;
    border-radius: 50%;
}

.chat-ai-info h3 {
    font-size: 0.875rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}

.chat-ai-info p {
    font-size: 0.75rem;
    margin: 0;
    opacity: 0.8;
    line-height: 1.2;
}

.chat-close-button {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0.25rem;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.chat-close-button:hover {
    opacity: 1;
}

.chat-ai-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chat-message {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
}

.chat-message.user {
    flex-direction: row-reverse;
}

.chat-message-content {
    max-width: 80%;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    line-height: 1.4;
    position: relative;
}

.chat-message.bot .chat-message-content {
    background: white;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 0.25rem;
}

.chat-message.user .chat-message-content {
    background: #3b82f6;
    color: white;
    border-bottom-right-radius: 0.25rem;
}

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

.chat-message.bot .chat-message-avatar {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
}

.chat-message.user .chat-message-avatar {
    background: #64748b;
    color: white;
}

.chat-ai-input-area {
    padding: 1rem;
    border-top: 1px solid #e2e8f0;
    background: white;
}

.chat-quick-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.quick-action-btn {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    color: #475569;
    font-weight: 500;
}

.quick-action-btn:hover {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
    transform: translateY(-1px);
}

.chat-input-container {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.chat-input {
    flex: 1;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 0.75rem;
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.2s;
}

.chat-input:focus {
    border-color: #3b82f6;
}

.chat-send-button {
    background: #3b82f6;
    border: none;
    border-radius: 0.75rem;
    color: white;
    padding: 0.75rem;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-send-button:hover {
    background: #2563eb;
}

.chat-send-button:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: #64748b;
    font-style: italic;
}

.typing-dots {
    display: flex;
    gap: 2px;
}

.typing-dot {
    width: 4px;
    height: 4px;
    background: #64748b;
    border-radius: 50%;
    animation: typing-bounce 1.4s infinite both;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing-bounce {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.validation-result {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 0.75rem;
    padding: 0.75rem;
    margin: 0.5rem 0;
}

.validation-result.invalid {
    background: #fef2f2;
    border-color: #fecaca;
}

.validation-result .result-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.validation-result.valid .result-header {
    color: #16a34a;
}

.validation-result.invalid .result-header {
    color: #dc2626;
}

.validation-details {
    font-size: 0.8rem;
    color: #4b5563;
    line-height: 1.4;
}

/* Responsividade */
@media (max-width: 480px) {
    .chat-ai-container {
        bottom: 5rem;
        right: 1rem;
    }
    
    .chat-ai-window {
        width: calc(100vw - 2rem);
        height: calc(100vh - 10rem);
        max-height: 500px;
    }
}