/* ESTILOS DO CHATBOT CHAMATIVO */
.chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: 'Nunito Sans', Arial, sans-serif;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.chatbot-container.show {
    transform: translateY(0);
    opacity: 1;
    animation: bounceIn 0.8s ease-out;
}

@keyframes bounceIn {
    0% { transform: scale(0.3) translateY(100px); opacity: 0; }
    50% { transform: scale(1.1) translateY(-10px); opacity: 0.8; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

.chatbot-toggle {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF6B6B, #FF8E53, #FF6B9D);
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    animation: pulse 2s infinite, shake 3s infinite;
}

.chatbot-toggle:hover {
    transform: scale(1.15) rotate(10deg);
    box-shadow: 0 12px 35px rgba(255, 107, 107, 0.6);
}

.chatbot-toggle::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background: linear-gradient(45deg, #FF6B6B, #4ECDC4, #45B7D1, #96CEB4, #FFEAA7);
    border-radius: 50%;
    z-index: -1;
    animation: rotateGradient 3s linear infinite;
}

@keyframes pulse {
    0%, 100% { 
        box-shadow: 0 8px 25px rgba(255, 107, 107, 0.4),
                    0 0 0 0 rgba(255, 107, 107, 0.7);
    }
    50% { 
        box-shadow: 0 12px 35px rgba(255, 107, 107, 0.6),
                    0 0 0 20px rgba(255, 107, 107, 0);
    }
}

@keyframes shake {
    0%, 100% { transform: rotate(0deg); }
    10% { transform: rotate(2deg); }
    20% { transform: rotate(-2deg); }
    30% { transform: rotate(2deg); }
    40% { transform: rotate(-2deg); }
    50% { transform: rotate(0deg); }
}

@keyframes rotateGradient {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Notificação atrativa */
.chat-notification {
    position: absolute;
    top: -15px;
    right: -10px;
    background: linear-gradient(135deg, #FF3B30, #FF9500);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    animation: bounce 1s infinite, glow 2s infinite;
    box-shadow: 0 4px 15px rgba(255, 59, 48, 0.4);
    min-width: 20px;
    text-align: center;
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% { transform: translate3d(0,0,0); }
    40%, 43% { transform: translate3d(0,-8px,0); }
    70% { transform: translate3d(0,-4px,0); }
    90% { transform: translate3d(0,-2px,0); }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 4px 15px rgba(255, 59, 48, 0.4); }
    50% { box-shadow: 0 4px 25px rgba(255, 59, 48, 0.8); }
}

/* Balão de mensagem preview */
.chat-preview {
    position: absolute;
    bottom: 80px;
    right: 0;
    background: white;
    padding: 15px 20px;
    border-radius: 20px;
    border-bottom-right-radius: 5px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    max-width: 280px;
    display: none;
    animation: slideInRight 0.5s ease-out;
    border: 2px solid transparent;
    background-clip: padding-box;
    position: relative;
}

.chat-preview::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #FF6B6B, #4ECDC4, #45B7D1);
    border-radius: 20px;
    z-index: -1;
    animation: rotateGradient 3s linear infinite;
}

.chat-preview.show {
    display: block;
}

@keyframes slideInRight {
    from {
        transform: translateX(100px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.chat-preview-text {
    font-size: 14px;
    color: #333;
    margin: 0;
    font-weight: 500;
}

.chat-preview-subtitle {
    font-size: 12px;
    color: #666;
    margin: 5px 0 0 0;
}

.chat-preview-close {
    position: absolute;
    top: 8px;
    right: 10px;
    background: none;
    border: none;
    font-size: 16px;
    color: #999;
    cursor: pointer;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Janela do chat mais atrativa */
.chatbot-window {
    position: absolute;
    bottom: 90px;
    right: 0;
    width: 380px;
    height: 550px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 25px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 3px solid white;
    animation: chatWindowIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.chatbot-window.open {
    display: flex;
}

@keyframes chatWindowIn {
    from {
        transform: scale(0.7) translateY(30px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.chatbot-header {
    background: linear-gradient(135deg, #FF6B6B, #4ECDC4);
    color: white;
    padding: 25px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.chatbot-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.chatbot-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 18px;
    cursor: pointer;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.chatbot-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1) rotate(90deg);
}

.chatbot-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.chatbot-subtitle {
    font-size: 14px;
    margin: 8px 0 0 0;
    opacity: 0.9;
    font-weight: 400;
}

.chatbot-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fff, #f0f0f0);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    margin: 10px auto;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    animation: avatarFloat 3s ease-in-out infinite;
}

@keyframes avatarFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    position: relative;
}

.chatbot-messages::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3) 0%, transparent 50%);
    pointer-events: none;
}

.message {
    margin-bottom: 15px;
    display: flex;
    align-items: flex-start;
    position: relative;
    animation: messageSlideIn 0.4s ease-out;
}

@keyframes messageSlideIn {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.message.bot {
    justify-content: flex-start;
}

.message.user {
    justify-content: flex-end;
}

.message-content {
    max-width: 85%;
    padding: 15px 20px;
    border-radius: 25px;
    font-size: 14px;
    line-height: 1.5;
    position: relative;
    backdrop-filter: blur(10px);
}

.message.bot .message-content {
    background: linear-gradient(135deg, rgba(255,255,255,0.9), rgba(255,255,255,0.7));
    color: #333;
    border-bottom-left-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255,255,255,0.2);
}

.message.user .message-content {
    background: linear-gradient(135deg, #FF6B6B, #FF8E53);
    color: white;
    border-bottom-right-radius: 8px;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.chatbot-input-area {
    padding: 20px;
    background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(255,255,255,0.85));
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255,255,255,0.2);
}

.chatbot-input-container {
    display: flex;
    gap: 12px;
    align-items: center;
    background: white;
    border-radius: 30px;
    padding: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    border: 2px solid transparent;
    background-clip: padding-box;
    position: relative;
}

.chatbot-input-container::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #FF6B6B, #4ECDC4, #45B7D1);
    border-radius: 30px;
    z-index: -1;
}

.chatbot-input {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 25px;
    outline: none;
    font-size: 14px;
    background: transparent;
}

.chatbot-input::placeholder {
    color: #999;
}

.chatbot-send {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF6B6B, #FF8E53);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 18px;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.chatbot-send:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.5);
}

.chatbot-send:active {
    transform: scale(0.95);
}

.chatbot-send:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.typing-indicator {
    display: none;
    padding: 15px 20px;
    background: linear-gradient(135deg, rgba(255,255,255,0.9), rgba(255,255,255,0.7));
    border-radius: 25px;
    border-bottom-left-radius: 8px;
    max-width: 85%;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
}

.typing-indicator.show {
    display: block;
    animation: messageSlideIn 0.4s ease-out;
}

.typing-dots {
    display: flex;
    gap: 6px;
    align-items: center;
}

.typing-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF6B6B, #4ECDC4);
    animation: typingDot 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingDot {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

.quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.quick-reply {
    padding: 10px 16px;
    background: linear-gradient(135deg, rgba(255,255,255,0.8), rgba(255,255,255,0.6));
    border: 2px solid rgba(255, 107, 107, 0.3);
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    color: #333;
    font-weight: 500;
}

.quick-reply:hover {
    background: linear-gradient(135deg, #FF6B6B, #FF8E53);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

/* Efeitos especiais */
.sparkle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: linear-gradient(45deg, #FFD700, #FFA500);
    border-radius: 50%;
    animation: sparkle 2s linear infinite;
}

@keyframes sparkle {
    0%, 100% { opacity: 0; transform: scale(0); }
    50% { opacity: 1; transform: scale(1); }
}

/* Responsivo */
@media (max-width: 768px) {
    .chatbot-window {
        width: 320px;
        height: 480px;
        bottom: 85px;
    }
    
    .chatbot-container {
        bottom: 15px;
        right: 15px;
    }
    
    .chat-preview {
        max-width: 220px;
        bottom: 75px;
    }
}

/* Animação de entrada chamativa */
@keyframes callAttention {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.1) rotate(5deg); }
    50% { transform: scale(1.05) rotate(-5deg); }
    75% { transform: scale(1.1) rotate(5deg); }
}

.chatbot-toggle.attention {
    animation: callAttention 0.6s ease-in-out 3;
}

/* Estado de carregamento */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.error-message {
    color: #ff4444;
    font-style: italic;
}

.reconnecting {
    background: linear-gradient(135deg, #ffa500, #ff6b6b);
    color: white;
    padding: 10px;
    border-radius: 15px;
    font-size: 12px;
    text-align: center;
    margin: 10px;
}
