/* ================================================= */
/* 1. CONTENEDOR DEL ROBOT Y ANIMACIÓN               */
/* ================================================= */
#contenedor-robot {
    position: fixed;
    bottom: -10px;
    right: 130px; /* Robot desplazado a la izquierda */
    width: 180px;
    z-index: 9999;
    cursor: pointer;
    user-select: none;
    animation: flotar 3s ease-in-out infinite;
}

#img-robot {
    width: 100% !important;
    height: auto !important;
    display: block;
    position: relative;
}

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

/* ================================================= */
/* 2. LA BOCA (Sincronizada y en su lugar)           */
/* ================================================= */
#boca-ia {
    position: absolute;
    top: 40.5%;   /* Altura exacta de la ranura */
    left: 35.5%;  /* Centrado en la cara */
    width: 12%; 
    height: 4px;
    background-color: #00f2ff;
    box-shadow: 0 0 12px #00f2ff;
    border-radius: 2px;
    border:0.9px solid #000 ;
    z-index: 10001;
    transform: scaleY(1);
}

/* Animación cuando el JS activa la clase .hablando */
#contenedor-robot.hablando #boca-ia {
    animation: vibrarBoca 0.15s infinite alternate;
}

@keyframes vibrarBoca {
    from { transform: scaleY(1); }
    to { transform: scaleY(4.5); }
}

/* ================================================= */
/* 3. BURBUJA "TOCAME" (A la derecha y abajo)       */
/* ================================================= */
.burbuja {
    position: absolute;
    top: -20px;       /* Bajada desde la cabeza */
    right: -55px;   /* Desplazada a la derecha del robot */
    background: white;
    padding: 10px;
    border-radius: 18px 18px 18px 0  ; /* Punta hacia el robot */
    border: 3px solid #333;
    font-weight: bold;
    width: 130px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    font-family: sans-serif;color: #000;
    font-size: 0.85rem;
    z-index: 10002;
}

/* ================================================= */
/* 4. VENTANA DE CHAT                                */
/* ================================================= */
#chat-ventana {
    position: absolute;
    bottom: 180px;
    right: -60px;
    width: 320px;
    height: 300px;
    background: #fff;color: #000;
    border: 3px solid #333;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    transition: all 0.4s ease;
}

.chat-oculto { display: none !important; }

/* ================================================= */
/* 5. HEADER Y BOTONES INTERACTIVOS                  */
/* ================================================= */
.chat-header {
    background: #333;
    color: #fff;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.controles-voz {
    display: flex;
    gap: 12px;
    align-items: center;
}

.btn-interactivo {
    background: none;
    border: none;
    color: rgb(48, 47, 47);
    font-size: 1.3rem;
    cursor: pointer;
}

.btn-cerrar {
    background: #ff4444 !important;
    color: white !important;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: 0.3s;
}

.btn-cerrar:hover {
    transform: rotate(90deg);
    background: #cc0000 !important;
}

/* ================================================= */
/* 6. ÁREA DE CHAT Y ENTRADA                         */
/* ================================================= */
#chat-mensajes {
    flex-grow: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f0e7c9;
}

/* 6. ÁREA DE CHAT Y ENTRADA - BOTONES CHICOS */
#sugerencias-rapidas {
    padding: 8px; /* Menos margen interno */
    display: flex;
    gap: 5px;    /* Espacio bien cortito entre botones */
    flex-wrap: wrap;
    background: #f5f5f5;
    border-top: 1px solid #ddd;
    justify-content: center; /* Centrados para que se vean prolijos */
}

.btn-sugerencia {
    background: #fff;
    border: 1px solid #ccc;
    padding: 3px 8px; /* MÁS CHICO: Antes era 5px 10px */
    border-radius: 8px;
    font-size: 0.7rem; /* LETRA MÁS CHICA: Antes era 0.75rem */
    cursor: pointer;
    transition: all 0.2s;
    font-family: sans-serif;
}

.btn-sugerencia:hover {
    background: #333;
    color: #fff;
    border-color: #333;
}

/* Ajuste para el input para que no quede pegado */
.chat-input-area {
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%; /* Asegura que ocupe todo el ancho del chat */
    box-sizing: border-box;
}
/* Efecto para los iconos del header (Parlantes) */
.btn-interactivo:hover {
    color: #00f2ff !important; /* Brillo celeste como la boca */
    transform: scale(1.2);    /* Se agranda un poquito */
}

/* Efecto para el Micrófono */
#btn-voz {
    transition: all 0.3s ease;
    filter: grayscale(1); /* Empieza un poco apagado */
}

#btn-voz:hover {
    filter: grayscale(0); /* Toma color al pasar el mouse */
    transform: scale(1.2) rotate(-10deg); /* Se inclina un poco */
}

/* Efecto extra para la X (si no lo tenías) */
.btn-cerrar:hover {
    background: #cc0000 !important;
    transform: rotate(90deg) scale(1.1);
}
#user-input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 10px;
    outline: none;
    font-size: 16px;
}

#btn-voz {
    font-size: 2rem;
    background: none;
    border: none;
    cursor: pointer;
}
/* USÁ ESTA: Es más pro y tiene brillo */
.micro-activo {
    color: #ff4444 !important;
    animation: pulso-micro 1.2s infinite ease-in-out;
    filter: drop-shadow(0 0 8px rgba(255, 0, 0, 0.6)); /* Brillo rojo */
    cursor: pointer;
}

@keyframes pulso-micro {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); } /* Se agranda un 30% */
    100% { transform: scale(1); }
}


/* ================================================= */
/* 7. AJUSTES PARA CELULAR (Responsive)              */
/* ================================================= */
/* 📱 AJUSTES EXCLUSIVOS PARA MÓVIL (Pantallas chicas) */
@media screen and (max-width: 480px) {
    
   /* 1. Movemos el robot a la izquierda para que no tape el WhatsApp */
    #contenedor-robot {
        width: 130px !important; 
        right: auto !important; /* Anulamos el pegado a la derecha */
        left: 150px !important;  /* Lo pegamos a la izquierda */
        bottom:-10px !important;
    }

    /* 2. Reajuste de la boca para el robot chico */
    #boca-ia {
        top: 40.8% !important; /* Ajuste fino vertical */
        left: 36.3% !important; /* Ajuste fino horizontal */
        width: 11.5% !important;
        height: 3px !important;
    }

    /* 3. El globito (burbuja) más compacto y arriba del robot */
    .burbuja {
        top: -35px !important;
        left: 70px !important;
        right: auto !important;
        width: 120px !important;
        font-size: 0.75rem !important;
        padding: 8px !important;
        border-radius: 15px 15px 15px 0 !important;
        z-index: 10002 !important;
    }

    /* 4. LA VENTANA DE CHAT (Casi pantalla completa) */
    #chat-ventana {
        width: 82vw !important;
        height: 55vh !important;
        left: -30vw !important; 
        right: auto !important;
        bottom: 120px !important;
        z-index: 10005 !important;
    }

   #chat-mensajes {
        flex: 1 !important; 
        height: auto !important; 
        max-height: calc(100% - 130px) !important; 
        overflow-y: auto !important; 
        padding: 10px !important;
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    /* Extra de la 5: Ajuste de las sugerencias */
    #sugerencias-rapidas {
        padding: 4px !important;
        gap: 4px !important;
        justify-content: center !important;
    }

   .btn-sugerencia {
        padding: 5px 8px !important;
        font-size: 0.68rem !important;
    }

    /* 6. HEADER DEL CHAT (Botones grandes para dedos) */
    .btn-cerrar {
        width: 35px !important;
        height: 35px !important;
        font-size: 1.1rem !important;
    }

    .btn-interactivo {
        font-size: 1.7rem !important;
    }

    #btn-voz {
        font-size: 2.2rem !important; /* Micrófono fácil de tocar */
    }

    /* 7. AJUSTE INPUT */
    #user-input {
         flex: 1 !important; /* Obliga al input a estirarse o achicarse */
    min-width: 0 !important; /* Evita que el input mantenga un ancho fijo y rompa el flex */
}


/* Dentro de @media screen and (max-width: 480px) */

.chat-input-area {
    padding: 6px 10px !important; /* Un poquito más compacto en móvil */
    width: 100% !important;
    box-sizing: border-box !important;
}



/* Si usás un botón de enviar aparte del micrófono */
.chat-input-area button, 
.chat-input-area #btn-voz {
    flex-shrink: 0 !important; /* Evita que los botones se aplasten */
}

}