/* Chatbot Flotante */
#ollama-chatbot-container {
    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Posiciones */
#ollama-chatbot-container.ollama-chatbot-bottom-right {
    bottom: 20px;
    right: 20px;
}

#ollama-chatbot-container.ollama-chatbot-bottom-left {
    bottom: 20px;
    left: 20px;
}

#ollama-chatbot-container.ollama-chatbot-top-right {
    top: 20px;
    right: 20px;
}

#ollama-chatbot-container.ollama-chatbot-top-left {
    top: 20px;
    left: 20px;
}

/* Botón Toggle (Icono Flotante) */
#ollama-chatbot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-color, #667eea);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 0;
    overflow: hidden;
}

#ollama-chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

#ollama-chatbot-toggle .ollama-chatbot-toggle-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* Ventana del Chat */
#ollama-chatbot-window {
    width: 380px;
    height: 600px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    margin-bottom: 80px;
    animation: slideUp 0.3s ease;
}

#ollama-chatbot-container.active #ollama-chatbot-window {
    display: flex;
}

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

/* Header del Chat */
.ollama-chatbot-header {
    background: linear-gradient(135deg, var(--primary-color, #667eea) 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ollama-chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ollama-chatbot-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.ollama-chatbot-name {
    font-weight: 600;
    font-size: 16px;
}

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

.ollama-chatbot-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.ollama-chatbot-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Área de Mensajes */
.ollama-chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ollama-chatbot-message {
    display: flex;
    gap: 10px;
    animation: messageSlide 0.3s ease;
}

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

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

.ollama-chatbot-message-content {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 18px;
    word-wrap: break-word;
    line-height: 1.4;
}

.ollama-chatbot-message-bot .ollama-chatbot-message-content {
    background: white;
    color: #333;
    border-bottom-left-radius: 4px;
}

.ollama-chatbot-message-user .ollama-chatbot-message-content {
    background: var(--primary-color, #667eea);
    color: white;
    border-bottom-right-radius: 4px;
}

/* Input Container */
.ollama-chatbot-input-container {
    padding: 15px;
    background: white;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
    align-items: center;
}

.ollama-chatbot-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
}

.ollama-chatbot-input:focus {
    border-color: var(--primary-color, #667eea);
}

.ollama-chatbot-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color, #667eea);
    border: none;
    color: white;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.ollama-chatbot-send:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.ollama-chatbot-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Typing Indicator */
.ollama-chatbot-typing {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
}

.ollama-chatbot-typing span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #999;
    animation: typing 1.4s infinite;
}

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

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

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

/* Responsive */
@media (max-width: 480px) {
    #ollama-chatbot-window {
        width: calc(100vw - 40px);
        height: calc(100vh - 100px);
        margin-bottom: 80px;
    }
    
    #ollama-chatbot-container.ollama-chatbot-bottom-right,
    #ollama-chatbot-container.ollama-chatbot-bottom-left {
        bottom: 10px;
    }
    
    #ollama-chatbot-container.ollama-chatbot-bottom-right {
        right: 10px;
    }
    
    #ollama-chatbot-container.ollama-chatbot-bottom-left {
        left: 10px;
    }
}
