/**
 * TAZDUCA CHATBOT - SOLO DOS BOTONES
 * Configuración DREV1: Solo botón minimizar arriba + botón verde abajo
 */

/* ============================================
   HEADER - SOLO BOTÓN MINIMIZAR
   ============================================ */

/* Contenedor de controles - solo minimizar */
#tazduca-chatbot .chatbot-controls {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0 !important;
}

/* Botón minimizar - único botón superior */
#tazduca-chatbot #chatbot-minimize {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    min-height: 28px !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%) !important;
    border: none !important;
    color: white !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2) !important;
    
    /* Asegurar que es el único */
    position: relative !important;
    z-index: 5 !important;
}

#tazduca-chatbot #chatbot-minimize i {
    font-size: 14px !important;
    color: white !important;
}

#tazduca-chatbot #chatbot-minimize:hover {
    transform: scale(1.1) !important;
    background: linear-gradient(135deg, #4b5563 0%, #374151 100%) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3) !important;
}

/* Ocultar cualquier otro botón en el header */
#tazduca-chatbot #chatbot-close,
#tazduca-chatbot .chatbot-controls button:not(#chatbot-minimize) {
    display: none !important;
}

/* ============================================
   INPUT AREA - SOLO BOTÓN VERDE
   ============================================ */

/* Asegurar que solo existe el botón verde */
#tazduca-chatbot .input-container button:not(#chatbot-send) {
    display: none !important;
}

/* Botón verde - único botón inferior */
#tazduca-chatbot #chatbot-send {
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    min-height: 42px !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%) !important;
    border: none !important;
    color: white !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative !important;
    overflow: hidden !important;
    box-shadow: 
        0 4px 12px rgba(34, 197, 94, 0.4),
        0 2px 6px rgba(34, 197, 94, 0.2) !important;
    
    /* Identificador único */
    z-index: 10 !important;
}

#tazduca-chatbot #chatbot-send i {
    font-size: 18px !important;
    color: white !important;
    z-index: 2 !important;
}

#tazduca-chatbot #chatbot-send:hover {
    transform: scale(1.1) translateY(-2px) !important;
    box-shadow: 
        0 8px 20px rgba(34, 197, 94, 0.5),
        0 4px 12px rgba(34, 197, 94, 0.3) !important;
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%) !important;
}

/* ============================================
   ELIMINAR OTROS BOTONES
   ============================================ */

/* Ocultar cualquier botón adicional */
#tazduca-chatbot button:not(#chatbot-minimize):not(#chatbot-send) {
    display: none !important;
}

/* Ocultar botones específicos si existen */
#tazduca-chatbot #chatbot-voice,
#tazduca-chatbot #chatbot-attachment,
#tazduca-chatbot .voice-button,
#tazduca-chatbot .attachment-button,
#tazduca-chatbot .quick-action {
    display: none !important;
}

/* ============================================
   LAYOUT OPTIMIZADO PARA 2 BOTONES
   ============================================ */

/* Header con solo un botón */
#tazduca-chatbot .chatbot-header {
    padding: 12px 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
}

/* Info area expandida */
#tazduca-chatbot .chatbot-info {
    flex: 1 !important;
}

/* Input container optimizado */
#tazduca-chatbot .input-container {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%) !important;
    border-radius: 25px !important;
    padding: 6px 6px 6px 16px !important;
    border: 2px solid transparent !important;
    transition: all 0.3s ease !important;
}

#tazduca-chatbot .input-container:focus-within {
    background: white !important;
    border-color: #22c55e !important;
    box-shadow: 
        0 0 0 3px rgba(34, 197, 94, 0.1),
        0 2px 8px rgba(34, 197, 94, 0.15) !important;
}

/* ============================================
   CONTADOR DE BOTONES (DEBUG)
   ============================================ */

/* Agregar indicador visual de que solo hay 2 botones */
#tazduca-chatbot::before {
    content: '2 botones activos' !important;
    position: absolute !important;
    top: -25px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    background: rgba(34, 197, 94, 0.9) !important;
    color: white !important;
    padding: 4px 8px !important;
    border-radius: 4px !important;
    font-size: 10px !important;
    font-weight: bold !important;
    opacity: 0 !important;
    transition: opacity 0.3s !important;
    pointer-events: none !important;
    z-index: 1000 !important;
}

#tazduca-chatbot:hover::before {
    opacity: 0.8 !important;
}

/* ============================================
   RESPONSIVE PARA MÓVIL
   ============================================ */

@media (max-width: 480px) {
    #tazduca-chatbot #chatbot-minimize {
        width: 24px !important;
        height: 24px !important;
        min-width: 24px !important;
        min-height: 24px !important;
    }
    
    #tazduca-chatbot #chatbot-minimize i {
        font-size: 12px !important;
    }
    
    #tazduca-chatbot #chatbot-send {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        min-height: 36px !important;
    }
    
    #tazduca-chatbot #chatbot-send i {
        font-size: 16px !important;
    }
}

/* ============================================
   VERIFICACIÓN DE CONFIGURACIÓN
   ============================================ */

/* Asegurar que el chatbot solo tenga exactamente 2 botones visibles */
#tazduca-chatbot {
    --total-buttons: 2;
    --minimize-button: 1;
    --send-button: 1;
}

/* Forzar ocultación de elementos innecesarios */
#tazduca-chatbot .chatbot-controls > *:not(#chatbot-minimize) {
    display: none !important;
}

#tazduca-chatbot .input-container > *:not(input):not(#chatbot-send) {
    display: none !important;
}

/* ============================================
   ANIMACIONES ESPECIALES PARA 2 BOTONES
   ============================================ */

/* Animación sincronizada entre los 2 botones */
@keyframes twoButtonSync {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(0.95); }
}

/* Aplicar animación cada 10 segundos para mostrar que están activos */
#tazduca-chatbot #chatbot-minimize,
#tazduca-chatbot #chatbot-send {
    animation: twoButtonSync 10s infinite !important;
    animation-delay: 0.5s !important;
}