/* ============================================================================
   CHATBOT DE IA - ESTILOS
   ============================================================================ */

/* Botón flotante del chatbot */
.ai-chatbot-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 64px;
    height: 64px;
    background: #6A1B9A;
    border: none;
    border-radius: 50%;
    box-shadow: 0 8px 24px rgba(106, 27, 154, 0.4);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 999;
    color: white;
}

.ai-chatbot-toggle.show {
    display: flex;
}

.ai-chatbot-toggle:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(106, 27, 154, 0.5);
}

.ai-chatbot-toggle svg {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.ai-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #FF6B35;
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 6px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.4);
}

/* Contenedor del chatbot */
.ai-chatbot-container {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 400px;
    height: 600px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    animation: slideUp 0.3s ease;
    overflow: hidden;
}

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

/* Header del chatbot */
.ai-chatbot-header {
    background: #6A1B9A;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}

.ai-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.ai-title {
    font-size: 16px;
    font-weight: 700;
}

.ai-status {
    font-size: 12px;
    opacity: 0.9;
}

.ai-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.ai-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Mensajes del chat */
.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f8fafc;
}

.ai-message {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.ai-message-user {
    justify-content: flex-end;
}

.ai-message-bot {
    justify-content: flex-start;
}

.ai-message-content {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
}

.ai-message-user .ai-message-content {
    background: #6A1B9A;
    color: white;
    border-bottom-right-radius: 4px;
}

.ai-message-bot .ai-message-content {
    background: #f3f4f6;
    color: #1f2937;
    border-bottom-left-radius: 4px;
}

/* Indicador de escritura */
.ai-typing-indicator {
    display: flex;
    gap: 4px;
    padding: 4px 0;
}

.ai-typing-indicator span {
    width: 8px;
    height: 8px;
    background: #667eea;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

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

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

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Sugerencias */
.ai-suggestions {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
}

.ai-suggestions-title {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 8px;
    font-weight: 600;
}

.ai-suggestions-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ai-suggestion-btn {
    background: white;
    border: 1px solid #e5e7eb;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    color: #667eea;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
}

.ai-suggestion-btn:hover {
    background: #f3f4f6;
    border-color: #667eea;
    transform: translateX(4px);
}

/* Input del chat */
.ai-chat-input-container {
    padding: 16px;
    background: white;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 8px;
}

.ai-chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
}

.ai-chat-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    scroll-margin-top: 100px;
}

.ai-send-btn {
    width: 44px;
    height: 44px;
    background: #6A1B9A;
    border: none;
    border-radius: 12px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.ai-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(106, 27, 154, 0.3);
    background: #5A2470;
}

.ai-send-btn:active {
    transform: scale(0.95);
}

/* Notificaciones */
.ai-notification {
    position: fixed;
    top: 100px;
    right: 32px;
    width: 350px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    padding: 20px;
    z-index: 10000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
}

.ai-notification.ai-notification-show {
    transform: translateX(0);
}

.ai-notification-title {
    font-size: 16px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 8px;
}

.ai-notification-message {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.5;
}

/* Responsive */
@media (max-width: 768px) {
    .ai-chatbot-container {
        width: calc(100vw - 32px);
        height: calc(100vh - 100px);
        bottom: 16px;
        right: 16px;
    }
    
    .ai-chatbot-toggle {
        bottom: 100px;
        right: 16px;
        width: 56px;
        height: 56px;
    }
    
    .ai-notification {
        width: calc(100vw - 32px);
        right: 16px;
        top: 80px;
    }
}

/* Scrollbar personalizado para el chat */
.ai-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.ai-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

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

.ai-chat-messages::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}
