/**
 * Video modal component
 * @package ASI_Solutions
 */

/* ========================================
   VIDEO MODAL COMPONENT STYLES
   ======================================== */

/* Modal Container - Hidden by default */
.video-modal[hidden] {
    display: none !important;
}

.video-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: var(--z-modal);
    opacity: 0;
    transition: opacity var(--transition-normal);
    overflow-y: auto;
    overflow-x: hidden;
}

.video-modal.is-open {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    padding: var(--spacing-4);
    box-sizing: border-box;
}

/* Modal Backdrop */
.video-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: var(--z-modal-backdrop);
    cursor: pointer;
}

/* Modal Container */
.video-modal-container {
    position: relative;
    width: 90vw;
    max-width: 1200px;
    max-height: calc(100vh - var(--spacing-8));
    z-index: calc(var(--z-modal) + 1);
    background: var(--gray-900);
    border-radius: var(--radius-2xl);
    overflow: hidden;
    box-shadow: var(--shadow-2xl);
    transform: scale(0.9);
    transition: transform var(--transition-normal);
    margin: auto;
    flex-shrink: 0;
}

.video-modal.is-open .video-modal-container {
    transform: scale(1);
}

/* Close Button */
.video-modal-close {
    position: absolute;
    top: var(--spacing-4);
    right: var(--spacing-4);
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: var(--radius-full);
    color: var(--gray-900);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    z-index: calc(var(--z-modal) + 2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    padding: 0;
}

.video-modal-close:hover,
.video-modal-close:focus {
    background: var(--white);
    transform: scale(1.1);
    outline: 2px solid var(--primary-green);
    outline-offset: 2px;
}

.video-modal-close:active {
    transform: scale(0.95);
}

/* Video Content Container */
.video-modal-content {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
}

/* Video Iframe */
.video-modal-content iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Responsive Design */

/* Tablet */
@media (max-width: 1024px) {
    .video-modal-container {
        width: 95vw;
        max-width: 900px;
    }
    
    .video-modal-close {
        width: 44px;
        height: 44px;
        font-size: 28px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .video-modal.is-open {
        padding: 0;
    }
    
    .video-modal-container {
        width: 100vw;
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
        height: 100vh;
    }
    
    .video-modal-content {
        height: 100%;
        padding-bottom: 0;
    }
    
    .video-modal-close {
        top: var(--spacing-3);
        right: var(--spacing-3);
        width: 48px;
        height: 48px;
        font-size: 32px;
        background: rgba(0, 0, 0, 0.7);
        color: var(--white);
    }
    
    .video-modal-close:hover,
    .video-modal-close:focus {
        background: rgba(0, 0, 0, 0.9);
        outline-color: var(--primary-green);
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .video-modal-close {
        width: 44px;
        height: 44px;
        font-size: 28px;
    }
}

/* Accessibility - Focus States */
.video-modal-close:focus-visible {
    outline: 3px solid var(--primary-green);
    outline-offset: 3px;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .video-modal,
    .video-modal-container,
    .video-modal-close {
        transition: none;
    }
}
