/* Video Frame Responsive Styles */

.video-frame-responsive {
    /* Fallback para navegadores que no soportan aspect-ratio */
    position: relative;
    width: 100%;
    /* Removemos min-height y max-height para que aspect-ratio funcione correctamente */
}

/* Soporte para navegadores sin aspect-ratio */
@supports not (aspect-ratio: 1) {
    .video-frame-responsive {
        height: 450px; /* Altura por defecto */
    }
    
    .video-frame-responsive::before {
        content: '';
        display: block;
        padding-top: 66.67%; /* 3:2 ratio por defecto (2/3 = 0.6667) */
    }
}

/* Responsive breakpoints - Solo aplicamos límites si es absolutamente necesario */
@media (max-width: 768px) {
    .video-frame-responsive {
        /* Permitir que aspect-ratio funcione sin restricciones de altura */
        max-height: 80vh; /* Solo límite máximo para evitar pantallas muy altas */
    }
}

@media (max-width: 480px) {
    .video-frame-responsive {
        /* En móviles, mantener el ratio sin límites mínimos */
        max-height: 70vh;
    }
}

/* Altura mínima solo para casos extremos donde el ancho sea muy pequeño */
@media (max-width: 320px) {
    .video-frame-responsive {
        min-height: 180px; /* Solo para pantallas muy pequeñas */
    }
    .play-button.large {
        width: 60px;
        height: 60px;
        margin-top: 0;
    }
}
@media (max-width: 500px) {
    .play-button-dynamic.inline {
        position: absolute;
        top: 60%;
        left: 50%;
        margin-top: 0px;
        margin-left: 0px;
    }
}

/* Mejorar la visualización del botón de play */
.video-frame-responsive .play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

/* Asegurar que el contenedor del modal ocupe toda la altura */
.video-frame-responsive .modal-container {
    height: 100% !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Optimización para imágenes de fondo */
.video-frame-responsive {
    background-attachment: scroll; /* Mejor rendimiento en móviles */
}

/* Transición suave al cambiar tamaños */
.video-frame-responsive {
    transition: height 0.3s ease-in-out;
}

/* Indicador de carga para imágenes */
.video-frame-responsive:not(.height-adjusted) {
    background-color: #f0f0f0;
}

.video-frame-responsive:not(.height-adjusted)::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #ccc;
    border-top-color: #333;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
