/* Chat IA - Sistema Baja e Aguiar */

.chat-container {
    height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
    background: #f8f9fa;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.chat-header {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    padding: 20px;
    text-align: center;
    position: relative;
}

.chat-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.chat-header h3 {
    margin: 0;
    position: relative;
    z-index: 1;
}

.chat-status {
    position: relative;
    z-index: 1;
    font-size: 0.9rem;
    opacity: 0.9;
    margin-top: 5px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: white;
    scroll-behavior: smooth;
}

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

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.message {
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    animation: fadeInUp 0.3s ease-out;
}

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

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

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

.message.user .message-avatar {
    background: linear-gradient(135deg, #28a745, #20c997);
    margin-left: 12px;
}

.message.assistant .message-avatar {
    background: linear-gradient(135deg, #007bff, #6f42c1);
    margin-right: 12px;
}

.message-content {
    max-width: 70%;
    position: relative;
}

.message-bubble {
    padding: 12px 16px;
    border-radius: 18px;
    position: relative;
    word-wrap: break-word;
    line-height: 1.4;
}

.message.user .message-bubble {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border-bottom-right-radius: 6px;
}

.message.assistant .message-bubble {
    background: #f8f9fa;
    color: #333;
    border: 1px solid #e9ecef;
    border-bottom-left-radius: 6px;
}

.message-time {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 4px;
    text-align: right;
}

.message.assistant .message-time {
    text-align: left;
}

.typing-indicator {
    display: none;
    align-items: center;
    margin-bottom: 20px;
}

.typing-indicator.show {
    display: flex;
}

.typing-dots {
    display: flex;
    align-items: center;
    margin-left: 52px;
}

.typing-dots span {
    height: 8px;
    width: 8px;
    background: #007bff;
    border-radius: 50%;
    display: inline-block;
    margin: 0 2px;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }

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

.chat-input-container {
    padding: 20px;
    background: white;
    border-top: 1px solid #e9ecef;
}

.chat-input-wrapper {
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

.chat-input {
    flex: 1;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    padding: 12px 20px;
    resize: none;
    font-size: 0.95rem;
    line-height: 1.4;
    max-height: 120px;
    min-height: 48px;
    transition: all 0.2s ease;
}

.chat-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.chat-send-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.chat-send-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.chat-send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.chat-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.suggestion-chip {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #495057;
}

.suggestion-chip:hover {
    background: #007bff;
    color: white;
    border-color: #007bff;
    transform: translateY(-1px);
}

.chat-welcome {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.chat-welcome-icon {
    font-size: 4rem;
    color: #007bff;
    margin-bottom: 20px;
    opacity: 0.7;
}

.chat-welcome h4 {
    color: #495057;
    margin-bottom: 15px;
}

.chat-welcome p {
    margin-bottom: 25px;
    line-height: 1.6;
}

.welcome-suggestions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 12px;
    margin-top: 25px;
}

.welcome-suggestion {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.welcome-suggestion:hover {
    border-color: #007bff;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.1);
    transform: translateY(-2px);
}

.welcome-suggestion i {
    color: #007bff;
    margin-bottom: 8px;
}

.welcome-suggestion h6 {
    margin-bottom: 4px;
    color: #495057;
}

.welcome-suggestion small {
    color: #6c757d;
}

/* Responsividade */
@media (max-width: 768px) {
    .chat-container {
        height: calc(100vh - 80px);
        border-radius: 0;
    }
    
    .message-content {
        max-width: 85%;
    }
    
    .welcome-suggestions {
        grid-template-columns: 1fr;
    }
    
    .chat-suggestions {
        flex-direction: column;
    }
    
    .suggestion-chip {
        text-align: center;
    }
}

/* Animações para mensagens */
.message-bubble.assistant {
    animation: slideInLeft 0.3s ease-out;
}

.message-bubble.user {
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

/* Efeito de pulse no botão de enviar quando há texto */
.chat-send-btn.has-text {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(0, 123, 255, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 123, 255, 0);
    }
}