/* INTEQ Chatbot Styles */

/* Botón flotante */
.chatbot-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #3dd598, #4e9fb8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(61, 213, 152, 0.4);
    transition: all 0.3s;
    z-index: 9997;
    color: white;
}

.chatbot-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(61, 213, 152, 0.6);
}

/* Cuando el chat está abierto, el botón debe estar detrás */
.chatbot-window.active ~ .chatbot-button {
    z-index: 9996;
}

.chatbot-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(61, 213, 152, 0.6);
}

.chatbot-notification {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Ventana del chatbot */
.chatbot-window {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 380px;
    height: 550px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(20px) scale(0.9);
    pointer-events: none;
    transition: all 0.3s;
    z-index: 10000;
    overflow: hidden;
}

.chatbot-window.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
    z-index: 10000;
}

.chatbot-window.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Header del chatbot */
.chatbot-header {
    background: linear-gradient(135deg, #0f172a, #1e3a8a);
    padding: 1.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}

.chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.chatbot-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    padding: 5px;
}

.chatbot-header h3 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
}

.chatbot-status {
    font-size: 0.75rem;
    color: #3dd598;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.chatbot-status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #3dd598;
    border-radius: 50%;
    display: inline-block;
    animation: blink 2s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.chatbot-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background 0.3s;
}

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

/* Área de mensajes */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    background: #f9fafb;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: #3dd598;
    border-radius: 10px;
}

/* Mensajes */
.chatbot-message {
    display: flex;
    animation: slideIn 0.3s ease-out;
}

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

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

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

.message-content {
    display: flex;
    gap: 0.5rem;
    max-width: 80%;
}

.bot-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #3dd598, #4e9fb8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.2rem;
}

.message-text {
    background: white;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.chatbot-message.user .message-text {
    background: linear-gradient(135deg, #3dd598, #4e9fb8);
    color: white;
    border-radius: 12px 12px 0 12px;
}

.chatbot-message.bot .message-text {
    border-radius: 12px 12px 12px 0;
}

/* Respuestas rápidas */
.chatbot-quick-replies {
    padding: 0.8rem 1.5rem;
    background: white;
    border-top: 1px solid #e5e7eb;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    max-height: 120px;
    overflow-y: auto;
}

.quick-reply-btn {
    padding: 0.5rem 1rem;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s;
    color: #1f2937;
    font-weight: 500;
}

.quick-reply-btn:hover {
    background: linear-gradient(135deg, #3dd598, #4e9fb8);
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
}

/* Input de mensaje */
.chatbot-input-container {
    padding: 1rem 1.5rem;
    background: white;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 0.8rem;
}

.chatbot-input {
    flex: 1;
    padding: 0.8rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 25px;
    font-size: 0.9rem;
    outline: none;
    transition: border 0.3s;
    font-family: 'Poppins', sans-serif;
}

.chatbot-input:focus {
    border-color: #3dd598;
}

.chatbot-send {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #3dd598, #4e9fb8);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    flex-shrink: 0;
}

.chatbot-send:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(61, 213, 152, 0.4);
}

/* Responsive */
@media (max-width: 768px) {
    .chatbot-window {
        width: calc(100vw - 20px);
        height: calc(100vh - 100px);
        right: 10px;
        bottom: 10px;
        border-radius: 15px;
        max-height: 600px;
    }
    
    .chatbot-button {
        bottom: 20px;
        right: 20px;
        width: 55px;
        height: 55px;
        z-index: 9999;
    }
    
    .chatbot-window.active {
        z-index: 9998;
    }
    
    /* FIX: Input y botón de envío */
    .chatbot-input-container {
        padding: 0.8rem 0.8rem !important;
        display: flex !important;
        gap: 0.5rem !important;
        align-items: center !important;
    }
    
    .chatbot-input {
        flex: 1 !important;
        min-width: 0 !important;
        padding: 0.7rem !important;
        font-size: 0.9rem !important;
    }
    
    .chatbot-send {
        width: 38px !important;
        height: 38px !important;
        min-width: 38px !important;
        flex-shrink: 0 !important;
    }
}
