/**
 * NAPSA Video Fix CSS
 * This file contains optimizations for video embeds and replaces deprecated properties
 */

/* Video container optimizations */
.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    max-width: 100%;
    background-color: #f1f1f1;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    margin-bottom: 0;
    border-radius: 8px;
}

/* Ensure consistent card heights and alignment */
.napsa-video-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.napsa-video-card figure {
    flex: 0 0 auto;
}

.napsa-video-card .box-content {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
}

.napsa-video-card .box-content p {
    flex-grow: 1;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
    transition: opacity 0.3s ease;
}

.video-container.loading::after {
    content: "Loading video...";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #333;
    font-size: 14px;
    z-index: 1;
}

.video-container .play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 68px;
    height: 48px;
    background-color: rgba(0,0,0,0.7);
    border-radius: 14%;
    z-index: 2;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.video-container .play-button::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 55%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 10px 0 10px 20px;
    border-color: transparent transparent transparent white;
}

.video-container .play-button:hover {
    background-color: #ff0000;
}

.video-container .video-error {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f1f1f1;
    color: #333;
    text-align: center;
    padding: 20px;
    font-size: 14px;
}

/* Light placeholder while video loads */
.video-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #f1f1f1;
    z-index: -1;
}

/* Modern high contrast support instead of -ms-high-contrast */
@media (forced-colors: active) {
    .btn:focus,
    a:focus,
    input:focus,
    select:focus,
    textarea:focus {
        outline: 2px solid transparent;
        outline-offset: 2px;
    }
    
    /* Additional high contrast mode styles */
    .btn {
        forced-color-adjust: none;
    }
    
    /* Enhanced focus states for improved accessibility */
    button:focus, 
    [role="button"]:focus {
        outline: 2px solid transparent !important;
        outline-offset: 2px !important;
    }
}

/* Improved button focus styles that work cross-browser */
.btn:focus,
button:focus {
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Adding fallback for browser compatibility */
@supports not (forced-colors: active) {
    button:focus:not(:focus-visible),
    [role="button"]:focus:not(:focus-visible) {
        outline: 0 !important;
    }
}
