/* 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: 82%;
    padding: 12px 16px;
    border-radius: 18px;
    word-wrap: break-word;
    line-height: 1.62;
    font-size: 15px;
    letter-spacing: 0.1px;
    font-weight: 400;
}

.ollama-chatbot-message-bot .ollama-chatbot-message-content {
    background: #ffffff;
    color: #1f2937;
    border: 1px solid #e5e7eb;
    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;
    }
}

.ollama-chatbot-message-content a {
  color: #0b63ce;
  text-decoration: underline;
  font-weight: 600;
  pointer-events: auto !important;
  cursor: pointer;
  text-underline-offset: 2px;
}

.ollama-chatbot-message-content a:hover {
  color: #084d9c;
  text-decoration-thickness: 2px;
}

.ollama-chatbot-message-content a.ollama-chatbot-wa-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  margin: 4px 2px 2px 0;
  border-radius: 999px;
  background: #25d366;
  color: #ffffff !important;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.2px;
  border: 1px solid #1da851;
}

.ollama-chatbot-message-content a.ollama-chatbot-wa-button:hover {
  background: #1fb95a;
  color: #ffffff !important;
  text-decoration: none;
}

.ollama-chatbot-message-content a.ollama-chatbot-phone-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  margin: 4px 0 2px;
  border-radius: 999px;
  background: #0f172a;
  color: #ffffff !important;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.2px;
  border: 1px solid #111827;
}

.ollama-chatbot-message-content a.ollama-chatbot-phone-button:hover {
  background: #1f2937;
  color: #ffffff !important;
  text-decoration: none;
}

.ollama-chatbot-message-content .ollama-chatbot-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  padding: 10px;
  border-radius: 12px;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #e2e8f0;
}
