/**
 * TAZDUCA CHATBOT ULTRA COMPACT
 * Botones 50% más pequeños, todos circulares uniformes, logo animado
 */

/* ============================================
   BOTONES ULTRA COMPACTOS - 50% MÁS PEQUEÑOS
   ============================================ */

/* Botones de control del header - ULTRA PEQUEÑOS */
#tazduca-chatbot .chatbot-controls button {
    width: 16px !important;
    height: 16px !important;
    min-width: 16px !important;
    min-height: 16px !important;
    border-radius: 50% !important;
    padding: 0 !important;
    font-size: 8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(255, 255, 255, 0.3) !important;
    backdrop-filter: blur(8px) !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    transition: all 0.2s ease !important;
}

#tazduca-chatbot .chatbot-controls button i {
    font-size: 7px !important;
    line-height: 1 !important;
    color: white !important;
}

#tazduca-chatbot .chatbot-controls button:hover {
    width: 18px !important;
    height: 18px !important;
    background: rgba(255, 255, 255, 0.5) !important;
    transform: scale(1.1) !important;
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.3) !important;
}

/* Botón de enviar mensaje - CIRCULAR COMPACTO */
#tazduca-chatbot #chatbot-send {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    min-height: 20px !important;
    border-radius: 50% !important;
    padding: 0 !important;
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
    border: none !important;
    color: white !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3) !important;
}

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

#tazduca-chatbot #chatbot-send:hover {
    width: 22px !important;
    height: 22px !important;
    transform: scale(1.1) rotate(5deg) !important;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.5) !important;
}

/* Botón de voz (si existe) - CIRCULAR COMPACTO */
#tazduca-chatbot #chatbot-voice {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    min-height: 18px !important;
    border-radius: 50% !important;
    margin-right: 3px !important;
    padding: 0 !important;
    background: linear-gradient(135deg, #10b981, #059669) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

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

/* Quick action buttons - CIRCULARES PEQUEÑOS */
#tazduca-chatbot .quick-action {
    padding: 4px 8px !important;
    font-size: 9px !important;
    border-radius: 12px !important;
    min-height: 20px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(102, 126, 234, 0.1) !important;
    border: 1px solid rgba(102, 126, 234, 0.2) !important;
    color: #667eea !important;
    transition: all 0.2s ease !important;
}

#tazduca-chatbot .quick-action:hover {
    border-radius: 14px !important;
    background: #667eea !important;
    color: white !important;
    transform: scale(1.05) !important;
}

/* Action buttons en mensajes - CIRCULARES */
#tazduca-chatbot .action-btn {
    padding: 3px 6px !important;
    font-size: 8px !important;
    border-radius: 10px !important;
    min-height: 16px !important;
    min-width: 16px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease !important;
}

/* Botón flotante principal - CIRCULAR PERFECTO */
#chatbot-toggle {
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    bottom: 20px !important;
    right: 20px !important;
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

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

#chatbot-toggle:hover {
    width: 36px !important;
    height: 36px !important;
    transform: scale(1.1) translateY(-2px) rotate(10deg) !important;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.5) !important;
}

/* ============================================
   LOGO ANIMADO EN RECUADRO BLANCO DEL HEADER
   ============================================ */

/* Avatar/Logo container - PERFECTO EN RECUADRO BLANCO */
#tazduca-chatbot .chatbot-avatar {
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    min-height: 42px !important;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%) !important;
    border-radius: 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8) !important;
    flex-shrink: 0 !important;
    overflow: hidden !important;
    animation: logoFloat 3s ease-in-out infinite !important;
}

/* Logo SVG dentro del recuadro blanco */
#tazduca-chatbot .chatbot-avatar img,
#tazduca-chatbot .chatbot-avatar svg {
    width: 28px !important;
    height: 28px !important;
    object-fit: contain !important;
    filter: contrast(1.1) brightness(0.95) !important;
    animation: logoSpin 8s linear infinite !important;
    transition: all 0.3s ease !important;
}

/* Hover effect en el logo */
#tazduca-chatbot .chatbot-avatar:hover img,
#tazduca-chatbot .chatbot-avatar:hover svg {
    transform: scale(1.1) !important;
    animation-duration: 2s !important;
}

/* Fallback cuando el logo no carga */
#tazduca-chatbot .chatbot-avatar.logo-failed::after {
    content: 'T' !important;
    position: absolute !important;
    font-size: 18px !important;
    font-weight: 800 !important;
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    animation: logoFloat 3s ease-in-out infinite !important;
}

/* Ocultar el ::before por defecto */
#tazduca-chatbot .chatbot-avatar::before {
    display: none !important;
}

/* Status indicator ajustado */
#tazduca-chatbot .status-indicator {
    position: absolute !important;
    bottom: -1px !important;
    right: -1px !important;
    width: 8px !important;
    height: 8px !important;
    background: linear-gradient(135deg, #10b981, #059669) !important;
    border: 2px solid white !important;
    border-radius: 50% !important;
    animation: statusPulse 2s infinite, statusFloat 4s ease-in-out infinite !important;
}

/* ============================================
   ANIMACIONES PARA EL LOGO Y ELEMENTOS
   ============================================ */

/* Animación flotante del logo */
@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }
    50% {
        transform: translateY(-3px) rotate(1deg);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    }
}

/* Animación de rotación sutil del logo */
@keyframes logoSpin {
    0% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(3deg) scale(1.02); }
    50% { transform: rotate(0deg) scale(1); }
    75% { transform: rotate(-3deg) scale(1.02); }
    100% { transform: rotate(0deg) scale(1); }
}

/* Animación del status indicator */
@keyframes statusPulse {
    0%, 100% { 
        transform: scale(1); 
        opacity: 1;
    }
    50% { 
        transform: scale(1.3); 
        opacity: 0.8;
    }
}

@keyframes statusFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-2px); }
}

/* ============================================
   AJUSTES DE ESPACIADO ULTRA COMPACTO
   ============================================ */

/* Espaciado entre botones de control */
#tazduca-chatbot .chatbot-controls {
    gap: 3px !important;
    display: flex !important;
    align-items: center !important;
}

/* Espaciado en input container */
#tazduca-chatbot .input-container {
    padding: 2px 2px 2px 8px !important;
    gap: 4px !important;
    border-radius: 20px !important;
}

/* Espaciado de quick actions */
#tazduca-chatbot .quick-actions {
    gap: 3px !important;
    margin-top: 6px !important;
}

/* Espaciado de message actions */
#tazduca-chatbot .message-actions {
    gap: 2px !important;
    margin-top: 4px !important;
}

/* Padding del área de input */
#tazduca-chatbot .chatbot-input-area {
    padding: 8px !important;
}

/* Header padding ajustado */
#tazduca-chatbot .chatbot-header {
    padding: 12px 16px !important;
    gap: 12px !important;
}

/* ============================================
   RESPONSIVE ULTRA COMPACTO
   ============================================ */
@media (max-width: 480px) {
    /* Botones aún más pequeños en móvil */
    #tazduca-chatbot .chatbot-controls button {
        width: 14px !important;
        height: 14px !important;
        font-size: 6px !important;
    }
    
    #tazduca-chatbot #chatbot-send {
        width: 18px !important;
        height: 18px !important;
        font-size: 8px !important;
    }
    
    #chatbot-toggle {
        width: 28px !important;
        height: 28px !important;
        bottom: 16px !important;
        right: 16px !important;
    }
    
    #chatbot-toggle i {
        font-size: 12px !important;
    }
    
    /* Logo móvil */
    #tazduca-chatbot .chatbot-avatar {
        width: 36px !important;
        height: 36px !important;
    }
    
    #tazduca-chatbot .chatbot-avatar img,
    #tazduca-chatbot .chatbot-avatar svg {
        width: 24px !important;
        height: 24px !important;
    }
}

/* ============================================
   EFECTOS HOVER MEJORADOS PARA BOTONES PEQUEÑOS
   ============================================ */

/* Todos los botones tienen efecto hover consistente */
#tazduca-chatbot button {
    cursor: pointer !important;
    user-select: none !important;
}

#tazduca-chatbot button:active {
    transform: scale(0.9) !important;
}

/* Ripple effect para botones circulares */
#tazduca-chatbot button {
    position: relative !important;
    overflow: hidden !important;
}

#tazduca-chatbot button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

#tazduca-chatbot button:hover::after {
    width: 100%;
    height: 100%;
}

/* ============================================
   ASEGURAR VISIBILIDAD CON TAMAÑOS ULTRA PEQUEÑOS
   ============================================ */

/* Contraste mejorado para botones tiny */
#tazduca-chatbot .chatbot-controls button {
    backdrop-filter: blur(10px) saturate(150%) !important;
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
}

/* Sombras más prominentes para visibilidad */
#tazduca-chatbot #chatbot-send {
    box-shadow: 
        0 2px 8px rgba(102, 126, 234, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1) !important;
}

#chatbot-toggle {
    box-shadow: 
        0 4px 20px rgba(102, 126, 234, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.2) !important;
}

/* ============================================
   LOADING STATE PARA LOGO
   ============================================ */

/* Mostrar loading mientras carga el logo */
#tazduca-chatbot .chatbot-avatar:empty::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #667eea;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: logoLoading 1s linear infinite;
}

@keyframes logoLoading {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}