/* Estilos para el chatbot flotante de Buscador AI */
#buscador-ai-floating-wrapper {
    position: fixed;
    bottom: 80px;
    right: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

.buscador-ai-floating-icon {
    width: 60px;
    height: 60px;
    background: #007cba;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.buscador-ai-floating-icon:hover {
    transform: scale(1.1);
    background: #005177;
}

.buscador-ai-floating-chat {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 400px;
    height: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.buscador-ai-chat-header {
    background: #007cba;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.buscador-ai-chat-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: white;
}

.buscador-ai-close-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s;
}

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

.buscador-ai-chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.buscador-ai-message {
    max-width: 80%;
}

.buscador-ai-bot-message {
    align-self: flex-start;
}

.buscador-ai-user-message {
    align-self: flex-end;
}

.buscador-ai-message-content {
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
}

.buscador-ai-bot-message .buscador-ai-message-content {
    background: #f1f3f4;
    color: #333;
}

.buscador-ai-user-message .buscador-ai-message-content {
    background: #007cba;
    color: white;
}

.buscador-ai-chat-input-wrapper {
    padding: 20px;
    border-top: 1px solid #eee;
}

.buscador-ai-search-container {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.buscador-ai-search-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 12px 16px;
    font-size: 14px;
    resize: none;
    max-height: 80px;
    min-height: 40px;
    font-family: inherit;
}

.buscador-ai-search-input:focus {
    outline: none;
    border-color: #007cba;
}

.buscador-ai-search-button {
    width: 40px;
    height: 40px;
    border: none;
    background: #007cba;
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.buscador-ai-search-button:hover:not(:disabled) {
    background: #005177;
}

.buscador-ai-search-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.buscador-ai-loading {
    text-align: center;
    margin-top: 10px;
}

.buscador-ai-typing-indicator {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}

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

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

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

@keyframes buscador-ai-typing {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.5;
    }

    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .buscador-ai-floating-chat {
        position: fixed;
        top: 10px;
        left: 10px;
        right: 10px;
        bottom: 10px;
        width: calc(100vw - 20px);
        height: calc(100vh - 20px);
        border-radius: 8px;
    }

    #buscador-ai-floating-wrapper {
        bottom: 80px;
        right: 15px;
    }

    .buscador-ai-floating-icon {
        width: 50px;
        height: 50px;
    }
}