/* =====================================================
   SECURE VIDEO PLAYER - Modal & Protection (Full Window)
   ===================================================== */

/* =====================================================
   VIDEO THUMBNAIL STYLE
   ===================================================== */
.popular-courses-image {
    position: relative;
    overflow: hidden;
}

.video-thumbnail {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.video-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.video-thumbnail:hover {
    transform: scale(1.02);
}

.video-thumbnail:hover img {
    transform: scale(1.05);
}

/* Play Button Overlay */
.play-button-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    pointer-events: all;
}

.play-btn {
    width: 70px;
    height: 70px;
    background: rgba(255, 89, 81, 0.95);
    border: 3px solid rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    pointer-events: all;
}

.play-btn i {
    font-size: 32px;
    color: #fff;
    margin-left: 3px;
}

.play-btn:hover {
    background: #ff5951;
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(255, 89, 81, 0.4);
}

/* =====================================================
   FULL WINDOW VIDEO MODAL STYLES
   ===================================================== */
.video-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-modal.active {
    display: flex;
    opacity: 1;
    animation: fadeIn 0.3s ease forwards;
}

/* Overlay - Dark background (NOT CLICKABLE) */
.video-modal-overlay-no-close {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1;
    pointer-events: none; /* Prevent clicking on overlay */
}

/* Modal Content Container - Full Window */
.video-modal-content {
    position: relative;
    width: 100vw;
    height: 100vh;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: popIn 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

/* Close Button - Top Right */
.modal-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: rgba(255, 89, 81, 0.9);
    border: 2px solid rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.modal-close-btn i {
    font-size: 28px;
    color: #fff;
}

.modal-close-btn:hover {
    background: #ff5951;
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 6px 20px rgba(255, 89, 81, 0.6);
}

/* Video Title */
.modal-video-title {
    color: #fff;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
    text-align: center;
    max-width: 90%;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

/* Secure Video Wrapper - Takes Most of Screen */
.modal-video-wrapper {
    position: relative;
    width: 95vw;
    max-width: 1400px;
    height: 80vh;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
}

.modal-video-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* =====================================================
   BLOCKING OVERLAYS IN MODAL (Security)
   ===================================================== */

/* Block YouTube footer controls (share button area) */
.modal-video-wrapper .youtube-footer-blocker {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 48px;
    background: transparent;
    z-index: 100;
    cursor: not-allowed;
    pointer-events: auto;
}

/* Block YouTube header (settings menu) */
.modal-video-wrapper .youtube-header-blocker {
    position: absolute;
    top: 0;
    right: 0;
    width: 150px;
    height: 48px;
    background: transparent;
    z-index: 100;
    cursor: not-allowed;
    pointer-events: auto;
}

/* Block YouTube logo (top-left, prevents redirect) */
.modal-video-wrapper .youtube-logo-blocker {
    position: absolute;
    top: 0;
    left: 0;
    width: 120px;
    height: 48px;
    background: transparent;
    z-index: 100;
    cursor: not-allowed;
    pointer-events: auto;
}

/* Block YouTube title area (top-center, prevents sharing via title click) */
.modal-video-wrapper .youtube-title-blocker {
    position: absolute;
    top: 0;
    left: 120px;
    right: 150px;
    height: 48px;
    background: transparent;
    z-index: 100;
    cursor: not-allowed;
    pointer-events: auto;
}

/* Show message when blocked areas are clicked */
.youtube-footer-blocker:active::after,
.youtube-header-blocker:active::after,
.youtube-title-blocker:active::after {
    content: '🔒 Protected';
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 89, 81, 0.95);
    color: #fff;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    animation: fadeIn 0.2s ease;
}

/* =====================================================
   ANIMATIONS
   ===================================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes popIn {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* =====================================================
   RESPONSIVE DESIGN
   ===================================================== */
@media (max-width: 768px) {
    .play-btn {
        width: 60px;
        height: 60px;
    }
    
    .play-btn i {
        font-size: 28px;
    }
    
    .modal-close-btn {
        top: 10px;
        right: 10px;
        width: 45px;
        height: 45px;
    }
    
    .modal-close-btn i {
        font-size: 24px;
    }
    
    .modal-video-title {
        font-size: 18px;
        margin-bottom: 15px;
    }
    
    .modal-video-wrapper {
        width: 100vw;
        height: 50vh;
        border-radius: 0;
    }
    
    .video-modal-content {
        padding: 10px;
    }
    
    /* Adjust blocking overlays for mobile */
    .modal-video-wrapper .youtube-header-blocker {
        width: 100px;
    }
    
    .modal-video-wrapper .youtube-logo-blocker {
        width: 80px;
    }
    
    .modal-video-wrapper .youtube-title-blocker {
        left: 80px;
        right: 100px;
    }
}

@media (max-width: 480px) {
    .play-btn {
        width: 50px;
        height: 50px;
    }
    
    .play-btn i {
        font-size: 24px;
    }
    
    .modal-video-title {
        font-size: 16px;
    }
    
    .modal-video-wrapper {
        height: 40vh;
    }
}

/* =====================================================
   ACCESSIBILITY
   ===================================================== */
.video-thumbnail:focus,
.play-btn:focus,
.modal-close-btn:focus {
    outline: 3px solid #ff5951;
    outline-offset: 3px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .video-modal,
    .video-modal-content,
    .video-thumbnail,
    .play-btn,
    .modal-close-btn {
        animation: none;
        transition: none;
    }
}
