/* Estilos para las ventanas flotantes (.pantalla) */
.pantalla {
    /* Tamaño inicial más pequeño */
    width: 500px;
    height: 400px;
    
    /* Centrado inicial en la pantalla */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    background-color: #dddddd00; /* Color de fondo oscuro */
    color: #000000; /* Color de texto claro */
    border: 0px solid #555;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    border-radius: 8px;
    resize: both;
    overflow: hidden; /* Importante para que el contenido no se salga */
    display: none; /* Ocultas por defecto */
    flex-direction: column;
    min-width: 250px;
    min-height: 150px;
}

/* Estilo para la ventana minimizada */
.pantalla.minimizada {
    height: 42px; /* Solo se ve el título */
    min-height: 42px;
    resize: none;
    overflow: hidden;
}

.titulo-ventana {
    height: 42px; /* Altura del título */
    background-color: rgba(31, 31, 31, 0.103); /* Semi-transparent background */
    color: #000000;
    padding: 8px 12px;
    cursor: move;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    border-bottom: 0px solid #444;
    backdrop-filter: blur(5px); /* Adjust the blur value as needed */
    -webkit-backdrop-filter: blur(5px); /* For Safari support */
}

.titulo-ventana .titulo {
    font-weight: bold;
}

.botones-ventana {
    display: flex;
    align-items: center;
}

.botones-ventana button {
    background: transparent;
    border: none;
    color: #000000;
    cursor: pointer;
    margin-left: 4px;
    padding: 4px;
    border-radius: 4px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.botones-ventana button:hover {
    background-color: #555;
}

.botones-ventana button svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.contenido-ventana {
    background-color: #fafafa;
   
    flex-grow: 1; /* Hace que el contenido ocupe el espacio restante */
    overflow: auto; /* Añade scroll si el contenido es muy largo */
}

/* Gestor de ventanas */
#gestor-ventanas {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%; background-color: #ffffff25;
       backdrop-filter: blur(5px); /* Adjust the blur value as needed */
    -webkit-backdrop-filter: blur(5px); /* For Safari support */
    color: #000000;
    padding: 5px 10px;
    box-sizing: border-box;
    z-index: 10000;
    border-top: 0px solid #444;
    display: flex;
    align-items: center;
    gap: 15px;
}

#gestor-ventanas h3 {
    margin: 0;
    font-size: 14px;
    font-weight: normal;
}

#lista-ventanas {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 8px;
}

/* --- ESTILOS PARA LA VISTA CLARA --- */

/* Por defecto, el botón de cierre del modo claro está oculto */
.clear-mode-close {
    display: none;
    position: absolute;
    top: 15px;
    right: 20px;
    width: 32px;
    height: 32px;
    background-color:transparent;
    color: rgb(0, 0, 0);
    border: none;
    border-radius: 50%;
    font-size: 20px;
    line-height: 32px;
    text-align: center;
    cursor: pointer;
    z-index: 10001; /* Encima del contenido de la pantalla */
    transition: background-color 0.2s;
}

.clear-mode-close:hover {
    background-color: rgba(0, 0, 0, 0);
}


/* Cuando el modo claro está activo en el body... */
body.clear-view-mode .pantalla {
    /* Ocupar toda la pantalla menos la barra inferior */
    width: 100vw !important;
    height: calc(100vh - 42px) !important; /* Ajusta 42px si la altura de tu barra inferior es diferente */
    top: 0 !important;
    left: 0 !important;
    
    /* Quitar estilos de ventana */
    transform: none !important;
    border-radius: 0;
    border: none;
    resize: none;
    box-shadow: none;
    z-index: 5000; /* Alto z-index para estar por encima de otros elementos */
}

/* Ocultar la barra de título original en modo claro */
body.clear-view-mode .titulo-ventana {
    display: none;
}

/* El contenido debe ocupar todo el espacio disponible */
body.clear-view-mode .contenido-ventana {
    height: 100%;
}

/* Mostrar el nuevo botón de cierre solo en modo claro */
body.clear-view-mode .clear-mode-close {
    display: block;
}