/* Chat Bot Styles */
.chat-widget {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 10000;
    font-family: 'Inter', sans-serif;
}

/* Responsivo - Garantir que chat e WhatsApp não se sobreponham */
@media (max-width: 768px) {
    .chat-widget {
        bottom: 20px; /* Chat na parte inferior */
        left: 20px;
    }
}

@media (max-width: 480px) {
    .chat-widget {
        bottom: 20px;
        left: 20px;
    }
}

.chat-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #C41E3A, #D63446);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(196, 30, 58, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1001;
    /* Força a interatividade */
    pointer-events: auto;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.chat-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(196, 30, 58, 0.6);
}

.chat-button.active {
    background: #6b7280;
}

.chat-container {
    position: absolute;
    bottom: 80px;
    left: 0;
    width: 380px;
    height: 500px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.chat-container.active {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: all;
}

.chat-header {
    background: linear-gradient(135deg, #1a1f36, #2c3e50);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #C41E3A;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.chat-info h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chat-info p {
    margin: 0;
    font-size: 12px;
    opacity: 0.8;
}

.chat-status {
    margin-left: auto;
    font-size: 10px;
    background: #10b981;
    padding: 4px 8px;
    border-radius: 12px;
}

.chat-messages {
    height: 340px;
    overflow-y: auto;
    padding: 16px;
    background: #f8fafc;
}

.chat-message {
    margin-bottom: 16px;
    display: flex;
    gap: 8px;
}

.chat-message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    flex-shrink: 0;
}

.message-avatar.bot {
    background: #C41E3A;
    color: white;
}

.message-avatar.user {
    background: #e5e7eb;
    color: #6b7280;
}

.message-content {
    max-width: 280px;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.4;
}

.message-content.bot {
    background: white;
    color: #1f2937;
    border: 1px solid #e5e7eb;
}

.message-content.user {
    background: #C41E3A;
    color: white;
}

.message-time {
    font-size: 10px;
    opacity: 0.6;
    margin-top: 4px;
}

.chat-input-container {
    padding: 16px;
    background: white;
    border-top: 1px solid #e5e7eb;
}

.chat-input-form {
    display: flex;
    gap: 8px;
}

.chat-input {
    flex: 1;
    border: 1px solid #d1d5db;
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s ease;
}

.chat-input:focus {
    border-color: #C41E3A;
}

.chat-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #C41E3A;
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.chat-send-btn:hover {
    background: #D63446;
}

.chat-send-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    background: white;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    margin-bottom: 16px;
}

.typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #9ca3af;
    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);
    }
    30% {
        transform: translateY(-10px);
    }
}

.chat-powered {
    text-align: center;
    padding: 8px;
    font-size: 10px;
    color: #9ca3af;
    background: #f9fafb;
}

/* Responsivo */
@media (max-width: 768px) {
    .chat-widget {
        bottom: 20px;
        left: 20px;
    }
    
    .chat-container {
        width: calc(100vw - 40px);
        height: calc(100vh - 200px);
        bottom: 80px;
        left: 0;
        right: auto;
    }
    
    .chat-messages {
        height: calc(100vh - 280px);
    }
}

/* Animações suaves */
.fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
