body {
    background-color: #111;
    margin: 0;
    padding: 0px 20px 20px 20px;
    color: #eee;
    font-family:"Fira-Sans", "Open Sans", Arial, Helvetica, sans-serif;
    height: 100%;
    overflow: hidden;
}

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 42px;
    background-color: #111;
    z-index: 100;
    display: flex;
    align-items: center;
    padding: 3px 4px;
    box-sizing: border-box;
    
}
.header .logo{
    
}
.header .alias,
.header .tokens
{
    margin-left: 5px;
    font-size:10pt;
}

.header .btnmenu{
    
    width:25px;
    height: 25px;
    border:1px solid #ccc;
    padding:3px;
    margin:0px;
    margin-left:auto;
    background-color: #ccc;
}
.header .btnmenu:hover{
    cursor: pointer;
    background-color: #fff;
    opacity:1;
    border:1px solid whitesmoke;
}
ul li:hover{
    background-color: #555;
}            

.scroll-wrapper {
    position: absolute;
    top: 42px; /* altura del header */
    left: 0;
    right: 0;
    bottom: 0;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #aaa rgba(0, 0, 0, 0.6);
}
.contenedor {
    
    top: 2px; 
    left: 0;
    right: 0;
    bottom: 0;    
    
    /*max-width: 1400px; opcional: limita el ancho en desktop grande */
    margin: 0 auto;        /* centra el grid */
    box-sizing: border-box;
}


.cuadro-container {
    position: relative;
    width: 320px;                 /* ancho por defecto: 1 columna */
    /* height: auto;             /* dejá que el contenido determine la altura */
    margin-bottom: 10px;         /* gutter vertical para Masonry */
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}
.cuadro-container:hover { outline: 1px solid #777; cursor: pointer; }
.cuadro-container.selected { outline: 2px solid #888; }
.cuadro-container img {
    top: 0;
    left: 0;
    object-fit: cover;
}


.hovered2 .front {
    opacity: 1;
    z-index: 2;
}

.hovered2 .back {
    opacity: 0;
    z-index: 1;
}

/* Al hacer hover sobre el contenedor, mostramos la back y ocultamos la front */
.cuadro-container:hover .hovered2 .front {
    opacity: 0;
}

.cuadro-container:hover .hovered2 .back {
    opacity: 1;
}
.hovered2 .front,
.hovered2 .back {
    position: absolute;
    top: 0;
    left: 0;
    object-fit: cover;
    transition: opacity 0.5s ease; /* 🔥 acá está la transición */
}
/* Si está seleccionado, mostrar la .front y ocultar la .back */
.cuadro-container.selected .hovered2 .front {
    opacity: 1;
}

.cuadro-container.selected .hovered2 .back {
    opacity: 0;
}


/* --- El resto de tus estilos queda igual --- */

.imagen-con-overlay { position: relative; width: 100%; }
.imagen-con-overlay img { width: 100%; display: block; }

/* Overlays */
.subtitle-overlay,
.menu-overlay,
.hover-overlay {
    position: absolute;
    left: 0;
    width: 100%;
    padding: 4px 4px;
    background-color: rgba(0, 0, 0, 0.5);
    font-size: 11pt;
    box-sizing: border-box;
    text-align: left; 
    z-index: 3;
}

.menu-overlay {
    top: 0;
    display: flex;
    gap: 4px;
    align-items: center;
}
.menu-overlay img {
    height: 24px;
    width: 24px;
    border: 2px solid whitesmoke;
    border-radius: 7px;
    cursor: pointer;
}
.menu-overlay .btnNotes{
    margin-left: auto;
}

.ai-overlay{
    position: absolute;
    top:36px;
    background-color: black;
    opacity: 0.7;
    transition: opacity 0.3s ease;   
    z-index: 3;
    width: 100%;
    height: calc(100% - 36px);

}

/* question fija abajo */
.question-overlay {
    overflow:hidden;   
    
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    box-sizing: border-box;
    /* z-index: 4; Opcional, por encima del answer si se superponen */
    background: transparent;    
}
.question-overlay textarea{
    box-sizing: border-box;
    width: 100%;
    resize: none;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color:#aaa rgba(0, 0, 0, 0.8);
    padding: 4px;
    font-size: 11pt;
    color: white;
    background: transparent;
    border: none;
    outline: none;


}

.question-overlay textarea:focus { outline: none; border: none; }
/* answer ocupa todo el espacio posible menos la question */
.answer-overlay {

    position: absolute;
    top: 0;
    bottom: 33px; /* Sí, esto está bien */
    left: 0;
    right: 0;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color:#aaa rgba(0, 0, 0, 0.6);
    padding: 4px;
    box-sizing: border-box;
}

/*--------------------------------------*/

.video-overlay {
    position:absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    top: 0;
    left: 0;
}
.ai-send { color: whitesmoke; font-size: 11pt; }
.ai-response{ color: wheat; font-size: 11pt; margin-left: 10px; margin-bottom:10px; }
.ai-response-html{ color: wheat; font-size: 11pt; margin-left: 2px; margin-bottom:2px; }

.btnProjectorLeft,
.btnProjectorRight{
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size : 18px;
    font-family: courier;
    font-weight: bold;
    color : white;
    background-color: rgba(0,0,0,0.4);
    border: 0;
    padding: 8px 12px;
    cursor: pointer;
    z-index: 5;
    
}

.btnProjectorLeft:hover,
.btnProjectorRight:hover{
    background-color: black;
}

a:link {
    color: #4da6ff;   /* azul claro para no visitado */
    text-decoration: none;
}

a:visited {
    color: #4da6ff;    /* #1a4d80; azul más oscuro para visitado */
}

a:hover {
    color: #66c2ff;   /* un poquito más brillante al pasar el mouse */
    text-decoration: underline;
}

a:active {
    color:  #4da6ff;   /* #003366; azul muy oscuro al hacer click */
}

.dialog {all: unset;}
.dialog {
    opacity: 0; /* Invisible por defecto */
    display:flex;
    flex-direction: column;

    position: fixed; /* Fijo respecto a la ventana */
    top: 50px; /* Margen superior fijo */
    left: 50%; /* Centrar horizontalmente */
    transform: translateX(-50%); /* Ajustar el centrado horizontal */
    width: 70%;
    max-width: 400px;
    max-height: calc(100vh - 60px); /* Altura máxima respetando el margen superior */
    border: 2px solid rgba(0, 0, 0, 0.3);
    /*box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);*/
    z-index: 6;
    transition: opacity 0.7s ease;
    background-color: #333;

}
.dialog[open]{
    opacity: 1; 
}
.dialog .dheader{
    display: flex;
    flex-direction: row;
    font-size:11pt;
    font-weight: 400;
    align-items: center;
    margin-left:0px;
    background-color: #111;
}
.dialog .dheader .close{
    width:20px;
    height: 20px;
    border:1px solid #ccc;
    padding:3px;
    margin:3px;
    margin-left:auto;
    background-color: #ccc;
    
}
.dialog .dheader .close:hover{
    background-color: #fff;
    cursor:pointer;

}
.dialog .dbody{
    position: relative;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color:#aaa rgba(0, 0, 0, 0.6);
    font-size:11pt;
    margin:3px;
    overflow-x: hidden;    

}
.dialog .dbody:focus {
    outline: none;
}


.dialog .dfooter{
    font-size: 10pt;
    color: wheat;
    margin:0 0 4px 0;
}
.dialog .dfooter .divFooter{
    display: flex;
    align-items: center;
    border-top:1px solid;
}
.dialog .dfooter hr{
    border: none;
    border-top: 1px solid #888;  /* color gris neutro */
    opacity: 0.3;                /* para hacerlo más sutil */
}
.dialog .dfooter input[type="checkbox"] {
    border:none;
    background-color: white;
    cursor: pointer;
    width: 20px;
    height: 15px;
    outline: none;
    box-shadow: none;
}





.dialog .next,
.dialog .prev{
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size : 18px;
    font-family: courier;
    font-weight: bold;
    color : black;
    background-color: rgba(255,255,255,0.4);
    border: 0;
    padding: 8px 12px;
    cursor: pointer;
    z-index: 5;
    margin-top:15px;

}

.dialog .prev:hover,
.dialog .next:hover{
    background-color: white;
    
}
.dialog .prev:focus,
.dialog .next:focus{
    outline: none;
    
}






.dialog .page {
    position: absolute;
    top: 0;
    left: 0; /* oculto por defecto */
    width: 100%;
    opacity: 0;
    transition: all 0.4s ease;
    padding: 10px;
    box-sizing: border-box;
}

.page.visible {
    left: 0;
    opacity: 1;
    z-index: 2;
    position: relative;    
}

.page.slide-left {
    left: -100%;
    opacity: 0;
    z-index: 1;
}

.page.slide-right {
    left: 100%;
    opacity: 0;
    z-index: 1;
}

/* Opcional: animaciones si querés transiciones */
.dialog .page.slide-left {
    animation: slideLeft 0.4s forwards;
}
.dialog .page.slide-right {
    animation: slideRight 0.4s forwards;
}
.page h1{
    font-size:12pt;
    font-weight: 600;
    
}
