/**
 * CMS Slider - Video Modal Styles
 * Optimized for performance and accessibility
 * 
 * @version 1.0.0
 */

/* Video Modal */
.cms-video-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cms-video-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.cms-video-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    cursor: pointer;
}

.cms-video-modal-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    z-index: 1;
    animation: cms-modal-slide-up 0.3s ease;
}

@keyframes cms-modal-slide-up {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.cms-video-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    z-index: 2;
}

.cms-video-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: rotate(90deg);
}

.cms-video-modal-body {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

.cms-video-modal-body iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Prevent body scroll when modal is open */
body.cms-video-modal-open {
    overflow: hidden;
}

/* Responsive */
@media (max-width: 768px) {
    .cms-video-modal-content {
        width: 95%;
    }
    
    .cms-video-modal-close {
        top: -35px;
        width: 35px;
        height: 35px;
        font-size: 20px;
    }
}

/* Accessibility */
.cms-video-modal-close:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.cms-video-modal-close:focus:not(:focus-visible) {
    outline: none;
}