/* ACTotal Video Modal - Styles */

/* Botón por defecto */
.avm-button {
    display: inline-block;
    padding: 12px 30px;
    background: #ffffff;
    color: #2ea3f2;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Open Sans', Arial, sans-serif;
    border: 2px solid #2ea3f2;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    text-decoration: none;
    text-align: center;
    line-height: 1.5;
}

.avm-button:hover {
    background: #2ea3f2;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(46, 163, 242, 0.4);
}

.avm-button:active {
    transform: translateY(0);
}

.avm-button:focus {
    outline: 3px solid rgba(46, 163, 242, 0.3);
    outline-offset: 2px;
}

/* Modal Overlay */
.avm-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 20px;
}

.avm-modal-overlay.avm-active {
    opacity: 1;
    visibility: visible;
}

/* Modal Container */
.avm-modal-container {
    position: relative;
    width: 100%;
    max-width: 1200px;
    background: #000000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.avm-modal-overlay.avm-active .avm-modal-container {
    transform: scale(1);
}

/* Botón de cierre */
.avm-modal-close {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 44px;
    height: 44px;
    background: #ffffff;
    color: #000000;
    border: none;
    border-radius: 50%;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.avm-modal-close:hover {
    background: #f0f0f0;
    transform: rotate(90deg);
}

.avm-modal-close:focus {
    outline: 3px solid rgba(102, 126, 234, 0.5);
    outline-offset: 2px;
}

/* Contenido del Modal */
.avm-modal-content {
    position: relative;
    width: 100%;
    padding: 0;
}

/* Contenedor de Video */
.avm-video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* Aspect ratio 16:9 */
    height: 0;
    overflow: hidden;
    background: #000000;
}

.avm-video-container iframe,
.avm-video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.avm-video-container video {
    object-fit: contain;
}

/* Loading spinner */
.avm-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: avm-spin 0.8s linear infinite;
}

@keyframes avm-spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .avm-modal-container {
        max-width: 90%;
    }
}

@media (max-width: 768px) {
    .avm-modal-overlay {
        padding: 15px;
    }

    .avm-modal-container {
        max-width: 95%;
        border-radius: 8px;
    }

    .avm-modal-close {
        top: 10px;
        right: 10px;
        width: 36px;
        height: 36px;
        font-size: 24px;
    }

    .avm-button {
        padding: 10px 24px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .avm-modal-overlay {
        padding: 10px;
    }

    .avm-modal-container {
        max-width: 100%;
        border-radius: 6px;
    }

    .avm-modal-close {
        width: 32px;
        height: 32px;
        font-size: 20px;
        top: 8px;
        right: 8px;
    }

    .avm-button {
        padding: 10px 20px;
        font-size: 14px;
    }
}

/* Prevenir scroll del body cuando el modal está activo */
body.avm-modal-open {
    overflow: hidden;
}

/* Accesibilidad - focus visible */
.avm-modal-overlay:focus-within .avm-modal-container {
    outline: 3px solid rgba(255, 255, 255, 0.3);
    outline-offset: 4px;
}

/* Animación de entrada */
@keyframes avm-fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes avm-slideUp {
    from {
        transform: scale(0.9) translateY(20px);
    }
    to {
        transform: scale(1) translateY(0);
    }
}

.avm-modal-overlay.avm-active {
    animation: avm-fadeIn 0.3s ease;
}

.avm-modal-overlay.avm-active .avm-modal-container {
    animation: avm-slideUp 0.3s ease;
}
