/* 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);
    }
}

/* Sugerencias rápidas */
.ollama-chatbot-suggestions {
    padding: 12px 15px 14px;
    background: linear-gradient(180deg, #fafbfc 0%, #f0f2f5 100%);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    max-height: 140px;
    overflow-y: auto;
    align-content: flex-start;
}

.ollama-chatbot-suggestions:empty {
    display: none;
}

.ollama-chatbot-suggestion-chip {
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid rgba(102, 126, 234, 0.25);
    background: white;
    color: var(--primary-color, #667eea);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ollama-chatbot-suggestion-chip:hover {
    background: var(--primary-color, #667eea);
    color: white !important;
    border-color: var(--primary-color, #667eea);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.35);
}

.ollama-chatbot-suggestion-chip:active {
    transform: translateY(0);
}

/* Chips con enlace - WhatsApp destaca en verde */
.ollama-chatbot-suggestion-link {
    text-decoration: none;
}

.ollama-chatbot-suggestion-link:hover {
    text-decoration: none;
}

/* WhatsApp chip - estilo verde distintivo */
a.ollama-chatbot-suggestion-chip[href*="whatsapp"] {
    border-color: rgba(37, 211, 102, 0.4);
    color: #1a8c4a;
}

a.ollama-chatbot-suggestion-chip[href*="whatsapp"]:hover {
    background: #25d366;
    border-color: #25d366;
    color: white !important;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
}

/* Botón WhatsApp - siempre clickable */
.ollama-chatbot-whatsapp-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    margin: 0 15px 12px;
    background: #25d366;
    color: white !important;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s;
    cursor: pointer;
    position: relative;
    z-index: 10;
    pointer-events: auto;
    border: none;
}

.ollama-chatbot-whatsapp-btn:hover {
    background: #20bd5a;
    color: white !important;
}

/* Enlaces WhatsApp dentro de mensajes del bot */
.ollama-chatbot-message-content .ollama-chatbot-wa-link {
    color: #25d366;
    text-decoration: underline;
    font-weight: 600;
}
.ollama-chatbot-message-content .ollama-chatbot-wa-link:hover {
    color: #20bd5a;
}

/* Enlaces a páginas (excursiones, etc.) en mensajes del bot */
.ollama-chatbot-message-content .ollama-chatbot-msg-link {
    color: var(--primary-color, #667eea);
    text-decoration: underline;
    font-weight: 500;
    word-break: break-all;
}
.ollama-chatbot-message-content .ollama-chatbot-msg-link:hover {
    text-decoration: none;
    opacity: 0.9;
}

/* Scrollbar para sugerencias */
.ollama-chatbot-suggestions::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
.ollama-chatbot-suggestions::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
}
.ollama-chatbot-suggestions::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.3);
    border-radius: 3px;
}
.ollama-chatbot-suggestions::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.5);
}

/* Responsive */
@media (max-width: 480px) {
    #ollama-chatbot-window {
        width: calc(100vw - 40px);
        height: calc(100vh - 100px);
        margin-bottom: 80px;
    }
    
    .ollama-chatbot-suggestions {
        padding: 10px 12px 12px;
        gap: 8px;
    }
    
    .ollama-chatbot-suggestion-chip {
        padding: 8px 12px;
        font-size: 11px;
    }
    
    #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;
    }
}
