/**
 * zones.css — Contenedores emergentes deslizantes y modales superpuestos
 * Biblia Conexiones PWA
 *
 * Delimita las áreas superpuestas estrictamente dentro del área de lectura (#reading_overlay_canvas):
 * Búsqueda (#search_zone: 70%), Planes (#plans_zone: 40%), Conexiones (#connections_zone: 70%),
 * Mis Conexiones (#my_connections_zone: 70%), Acerca de (#about-card) y Licencia (#licence-card).
 */

/* ─── CANVAS CONTENEDOR DEL ÁREA DE LECTURA (BOUNDING BOX) ──────────────────── */

#reading_overlay_canvas {
    position: absolute;
    top: 60px !important;                    /* Debajo de la línea divisoria de #show_menulat */
    bottom: 70px !important;                 /* Sobre los botones de navegación y pie */
    left: 16px;
    right: 16px;
    pointer-events: none;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    /* background-color: var(--bs-gray-200); */
}

/* En pantallas de administración sobre la zona conjunta (lectura + temas) */
#admin_workspace #reading_overlay_canvas,
#main_container #reading_overlay_canvas {
    top: 48px;
    bottom: 20px;
    left: 8px;
    right: 8px;
}

/* ─── BASE COMÚN PARA PANELES DESLIZANTES INFERIORES ────────────────────────── */

.overlay-zone,
#search_zone,
#ai_zone,
#connections_zone,
#plans_zone,
#my_connections_zone {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-height: 100%;
    pointer-events: none;
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    z-index: 1045;
}

.overlay-zone.show,
#search_zone.show,
#ai_zone.show,
#connections_zone.show,
#plans_zone.show,
#my_connections_zone.show {
    transform: translateY(0);
    opacity: 1;
}

.overlay-zone > div,
#search_zone > div,
#ai_zone > div,
#connections_zone > div,
#plans_zone > div,
#my_connections_zone > div {
    pointer-events: auto;
    height: 100%;
}

/* ─── ALTURAS VERTICALES ESPECÍFICAS DENTRO DEL BOUNDING BOX ────────────────── */

/* Búsqueda: 70% del área contenedora de lectura */
#search_zone {
    height: 100% !important;
}

/* Asistente IA: 100% del área contenedora de lectura */
#ai_zone {
    height: 100% !important;
}

/* Conexiones: 70% del área contenedora de lectura */
#connections_zone {
    height: 80% !important;
}

/* Planes: 40% del área contenedora de lectura */
#plans_zone {
    height: 40% !important;
}

/* Mis Conexiones: 70% del área contenedora de lectura */
#my_connections_zone {
    height: 80% !important;
}

/* ─── FONDOS OSCURECIDOS (BACKDROPS) ───────────────────────────────────────── */

#about-card-backdrop,
#licence-card-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1050;
    pointer-events: auto;
}

/* ─── TARJETAS MODALES CENTRADAS (ACERCA DE / LICENCIA) ──────────────────────── */

.overlay-modal,
#about-card,
#licence-card {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 95%;
    max-width: 440px;
    max-height: 100%;
    pointer-events: auto;
    z-index: 1060;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

#about-card .card,
#licence-card .card {
    max-height: 100%;
    overflow-y: auto;
}

/* Contenido de "Acerca de" con scroll propio */
#about-card .about-scroll {
    max-height: 35vh;
    overflow-y: auto;
}

/* ─── RESPONSIVE TWEAKS ─────────────────────────────────────────────────────── */

@media (max-width: 576px) {
    #reading_overlay_canvas {
        top: 44px;
        bottom: 112px;
        left: 4px;
        right: 4px;
    }

    #search_zone {
        height: 100% !important;
    }

    #ai_zone {
        height: 100% !important;
    }

    #connections_zone {
        height: 80% !important;
    }

    #plans_zone {
        height: 40% !important;
    }

    #my_connections_zone {
        height: 80% !important;
    }
}

/* ─── TARJETA PUBLICITARIA: CREAR CUENTA GRATIS ─────────────────────────────── */

#promo-registro-backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1070;
}

/* Móvil: 340 x 520 centrada en la pantalla; botón en la franja inferior (20%) */
#promo-registro {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 340px;
    height: 520px;
    transform: translate(-50%, -50%) scale(var(--promo-scale, 1));
    background: var(--promo-img-movil) center / cover no-repeat;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    z-index: 1075;
}

#promo-registro .promo-registro-accion {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 20%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#promo-registro .promo-registro-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Tablet en adelante: 640 x 480; botón centrado en la esquina inferior derecha (50% x 20%) */
@media (min-width: 768px) {
    #promo-registro {
        width: 640px;
        height: 480px;
        background-image: var(--promo-img-grande);
    }

    #promo-registro .promo-registro-accion {
        left: auto;
        width: 50%;
    }
}
