﻿/* ============================================
   MODAL FOTO — modalfoto.css (versión optimizada)
   ============================================ */

/* Tamaño del modal (máx 75% del viewport) */
#fotoModal .modal-dialog {
    max-width: 75vw !important;
    max-height: 75vh !important;
    margin: auto;
}

/* Contenido oscuro y limitado en altura */
#fotoModal .modal-content {
    background-color: #111;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 75vh !important;
}

/* HEADER FIJO — Azul turquesa premium */
#fotoModal .modal-header {
    background-color: #0097A7; /* Turquesa estilo panorámicas */
    color: #fff;
    padding: 10px 16px;
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Botón de cierre circular */
#fotoModal .btn-close-circle {
    background-color: #000 !important;
    color: #fff !important;
    border-radius: 50% !important;
    width: 2rem;
    height: 2rem;
    display: flex !important;
    align-items: center;
    justify-content: center;
    opacity: 1 !important;
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: background 0.2s, color 0.2s;
    font-size: 1.5rem;
    padding: 0;
}

    #fotoModal .btn-close-circle span {
        color: #fff;
        font-size: 1.4rem;
        font-weight: bold;
        line-height: 1;
        margin-top: -2px;
    }

    #fotoModal .btn-close-circle:hover {
        background-color: #c00 !important;
    }

/* ============================================
   BODY DEL MODAL — Ajuste perfecto de contenido
   ============================================ */
#fotoModal .modal-body {
    flex: 1 1 auto;
    overflow: hidden; /* evita scroll feo */
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: calc(75vh - 60px); /* 75vh menos header */
    padding: 0 !important;
}

/* ============================================
   IMAGEN — Se adapta SIEMPRE al modal
   ============================================ */
#fotoModalImg {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    margin: auto;
    display: none;
}

/* ============================================
   VIDEO — Ajuste igual que la imagen
   ============================================ */
#fotoModalVideoContainer {
    width: 100%;
    height: 100%;
    display: none;
}

#fotoModalVideo {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* ============================================
   IFRAME — Visores externos (IPCamLive, Axis…)
   ============================================ */
#fotoModalIframeContainer {
    width: 100%;
    height: 100%;
    display: none;
}

#fotoModalIframe {
    width: 100%;
    height: 100%;
    border: 0;
}

/* ============================================
   BACKDROP PERSONALIZADO
   ============================================ */
#custom-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.6);
    z-index: 5000;
    display: none;
}

/* Modal por encima del backdrop */
#fotoModal.modal.show {
    z-index: 5001 !important;
}
