/* ===============================
   LAUNCHER (BOTÓN FLOTANTE)
================================ */

#aiagenty-launcher {
    position: fixed;
    z-index: 99999;
    cursor: pointer;

    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    right: -10px;
    width: fit-content;
    height: auto;
}


#aiagenty-launcher:hover {
    transform: translateY(-2px);
}
#aiagenty-launcher.open {
    padding: 10px;
}

/* Avatar */
#aiagenty-launcher img {
    width: 75px;
    height: 84px;
    object-fit: cover;
    object-position: center;
    transform: scale(1.02);
}
#aiagenty-launcher {
    pointer-events: none;
}

#aiagenty-launcher img {
    pointer-events: auto;
}


/* ===============================
   TEXTO
================================ */

.aiagenty-text {
    font-size: 14px;
    font-weight: 500;
    color: #1f2937;
    white-space: nowrap;

    opacity: 1;
    transform: translateX(0);

    transition:
        opacity 0.3s ease,
        transform 0.3s ease;
}

/* Ocultar texto cuando el iframe está abierto */
#aiagenty-launcher.open .aiagenty-text {
    display: none;
    transform: translateX(10px);
    pointer-events: none;
}


/* ===============================
   IFRAME CONTAINER
================================ */

#aiagenty-iframe-container {
    position: fixed;
    width: 310px;
    height: 520px;
    z-index: 9999;
    border-radius: 18px;
    overflow: hidden;   
    background-color: transparent;
    opacity: 0;
    transform: translateY(40px) scale(0.92);
    transform-origin: bottom right;
    pointer-events: none;
    transition:
        opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Estado abierto */
#aiagenty-iframe-container.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}


/* ===============================
   IFRAME
================================ */

#aiagenty-iframe {
    width: 100%;
    height: 100%;
    border: none;
}




/* ===============================
   POSICIONES
================================ */

.bottom-right {
    bottom: 20px;
    right: 20px;
}

.bottom-left {
    bottom: 20px;
    left: 20px;
}

.top-right {
    top: 20px;
    right: 20px;
}

.top-left {
    top: 20px;
    left: 20px;
}
#aiagenty-iframe-container.fullscreen {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100vw;
    height: calc(var(--vh, 1vh) * 100); 
    z-index: 9999;
    background-color: rgb(255 255 255 / 7%) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding-bottom: env(safe-area-inset-bottom); 
}

#aiagenty-iframe-container.fullscreen iframe {
    height: 100%;
}
#aiagenty-close2 {
    position: absolute;
    bottom: 52px;
    left: 18px;
    z-index: 10001;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgb(0 0 0 / 48%);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}
#aiagenty-close2:hover {
    background: #929292;
}
#aiagenty-iframe-container.fullscreen #aiagenty-close2 {
    bottom: 62px;
    left: 18px;
    width: 41px;
    height: 41px;
    font-size: 16px;
}
.hidden{
    display: none;
}
#aiagentyicon-fullscreen{
    width: 46px !important;
    height: 54px !important;
}
@media (max-width: 768px) {
    #aiagenty-iframe-container.fullscreen {
        height: var(--mobile-vh);
        max-height: var(--mobile-vh);
    }
}


/* ===============================
   MOBILE
================================ */

@media (max-width: 480px) {

    #aiagenty-iframe-container {
        width: 72vw;
        height: 50vh;
    }

}
