﻿/* ==========================================================
   VISOR DE DOCUMENTOS HABECU (unificado con HABECU-theme.css)
   ========================================================== */

#visorContainer {
    width: 100%;
    border: 1px solid var(--HABECU-gris-borde);
    border-radius: 8px;
    background: var(--HABECU-blanco);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Barra superior del visor */
#visorBarra {
    background: linear-gradient(180deg, #f9faf9 0%, #e9efe9 100%);
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--HABECU-gris-borde);
    height: 42px;
}

#lblNombreArchivo {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--HABECU-verde-oscuro);
    font-weight: 600;
    font-size: 14px;
}

/* Botón de abrir en nueva pestaña */
#btnAbrirNuevaPestana {
    display: none;
    color: var(--HABECU-verde-medio);
    text-decoration: none;
    font-weight: 600;
    border: 1px solid var(--HABECU-verde-medio);
    padding: 3px 10px;
    border-radius: 6px;
    transition: all 0.2s ease;
    background: var(--HABECU-blanco);
}

    #btnAbrirNuevaPestana:hover {
        background: var(--HABECU-verde-medio);
        color: #fff;
    }

/* Contenedor del visor (iframe o placeholder) */
#visorPlaceholder,
#iframePreviewDoc {
    flex: 1;
    width: 100%;
    height: 100%;
    border: none;
}

/* Transición suave al cargar documento */
#iframePreviewDoc {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

    #iframePreviewDoc[style*="display: block"] {
        opacity: 1;
    }

/* Estado inicial: mensaje de espera */
#visorPlaceholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 14px;
    background: #fff;
}

/* === Grid de ficheros adjuntos === */
.mGridDetalle {
    border-collapse: collapse;
    width: 100%;
    font-size: 13px;
}

    .mGridDetalle th,
    .mGridDetalle td {
        padding: 6px 8px;
        border-bottom: 1px solid #e0e0e0;
    }

    .mGridDetalle tr {
        transition: background-color 0.15s;
        cursor: pointer;
    }

        .mGridDetalle tr:hover {
            background-color: #e8f5e9 !important;
        }

/* === Separador visual === */
.separador-titulo {
    margin: 10px auto 20px auto;
    width: 95%;
    border: 0;
    height: 1px;
    background-color: var(--HABECU-gris-borde);
}

/* === Ajuste visual entre pestañas === */
.ajax__tab_xp .ajax__tab_body {
    min-height: 520px !important; /* ajustable según contenido */
}

/* === Imagen dentro del visor (vista HTML generada) === */
.visordoc-img-body {
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
}

    .visordoc-img-body img {
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
    }

/* === Herramientas flotantes (zoom/descarga) === */
.visordoc-tools {
    position: absolute;
    bottom: 10px;
    right: 10px;
    display: flex;
    gap: 8px;
    z-index: 9999;
}

.visordoc-tool-btn {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--HABECU-gris-borde);
    border-radius: 6px;
    padding: 6px 8px;
    cursor: pointer;
    color: var(--HABECU-verde-oscuro);
    font-weight: 600;
    transition: all 0.2s ease;
}

    .visordoc-tool-btn:hover {
        background: var(--HABECU-verde-medio);
        color: #fff;
    }
