/* ============================================
   YOUNA - Modal Styles
   ============================================ */

#videoModal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    opacity: 0;
    background: rgba(0, 0, 0, 0.247);
    backdrop-filter: blur(10px);
    transition: opacity 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: opacity;
    backface-visibility: hidden;
}

#videoModal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1 !important;
    pointer-events: all !important;
}

#videoModal.active > div {
    transform: scale(1) !important;
}

.video-player-container {
    position: relative;
    width: 100%;
    height: 100%;
    background: #000;
}

#videoModal .video-player-container {
    padding-bottom: 56.25%;
    overflow: hidden;
    border-radius: 0.75rem;
}

#videoPlayer {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border: none !important;
    background: #000;
}

#videoModal .modal-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94), background 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94), border-color 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 10000;
    font-size: 1.2rem;
    will-change: transform;
    backface-visibility: hidden;
}

#videoModal .modal-close-btn:hover {
    background: rgba(255, 50, 50, 0.8) !important;
    border-color: rgba(255, 100, 100, 0.5) !important;
    transform: translate3d(0, 0, 0) scale(1.1);
}

.modal-action-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    cursor: pointer;
    z-index: 60;
    will-change: transform;
    backface-visibility: hidden;
}

.modal-action-btn:hover {
    transform: translate3d(0, 0, 0) scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.modal-action-btn i {
    font-size: 1.1rem;
}

#modalLikeVideo.liked {
    background: rgba(255, 50, 50, 0.3) !important;
    color: #ff6b6b !important;
    border-color: rgba(255, 100, 100, 0.5) !important;
}

#modalLikeVideo.liked:hover {
    background: rgba(255, 50, 50, 0.4) !important;
}

#closeVideoModal {
    position: absolute;
    top: -12px;
    right: -12px;
    z-index: 9999;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94), color 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
    backface-visibility: hidden;
}

#closeVideoModal:hover {
    color: #FF0000;
    transform: translate3d(0, 0, 0) scale(1.15) rotate(90deg);
}

#closeVideoModal i {
    transition: all 0.3s ease;
}

#closeVideoModal:hover i {
    transform: scale(1.2);
}

.animate-fadeIn {
    animation: fadeIn 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    will-change: transform, opacity;
    backface-visibility: hidden;
}

/* ============================================
   Responsive Design
   ============================================ */

/* Extra small mobile: < 480px */
@media (max-width: 479px) {
    #videoModal {
        padding: 0;
        align-items: flex-start;
        background: rgba(0, 0, 0, 0.95);
    }

    #videoModal > div {
        width: 100%;
        height: 100vh;
        margin: 0;
        border-radius: 0;
    }

    #videoModal .modal-close-btn {
        width: 40px;
        height: 40px;
        top: 10px;
        right: 10px;
        font-size: 1rem;
    }

    #videoModal.active {
        touch-action: pan-y;
    }
    
    .modal-action-btn {
        width: 36px;
        height: 36px;
    }
    
    .modal-action-btn i {
        font-size: 0.9rem;
    }

    #closeVideoModal {
        width: 40px;
        height: 40px;
        top: -10px;
        right: -10px;
        font-size: 16px;
    }
}

/* Mobile: 480px - 767px */
@media (min-width: 480px) and (max-width: 767px) {
    #videoModal {
        padding: 0;
        align-items: flex-start;
        background: rgba(0, 0, 0, 0.95);
    }

    #videoModal > div {
        width: 100%;
        height: 100vh;
        margin: 0;
        border-radius: 0;
    }

    #videoModal .modal-close-btn {
        width: 40px;
        height: 40px;
        top: 10px;
        right: 10px;
        font-size: 1rem;
    }

    #videoModal.active {
        touch-action: pan-y;
    }
    
    .modal-action-btn {
        width: 40px;
        height: 40px;
    }
    
    .modal-action-btn i {
        font-size: 1rem;
    }

    #closeVideoModal {
        width: 40px;
        height: 40px;
        top: -10px;
        right: -10px;
        font-size: 16px;
    }
}

/* Tablet: 768px - 1023px */
@media (min-width: 768px) and (max-width: 1023px) {
    #videoModal > div {
        max-width: 90%;
        margin: 2rem auto;
    }

    #videoModal > div {
        width: 95vw !important;
        max-height: 85vh !important;
    }
}

/* Desktop: 1024px - 1439px */
@media (min-width: 1024px) and (max-width: 1439px) {
    #videoModal > div {
        max-width: 96rem;
        margin: 2rem auto;
    }
}

/* Large screens: ≥ 1440px */
@media (min-width: 1440px) {
    #videoModal > div {
        width: 66.666667% !important;
        max-width: 900px !important;
        margin: 2rem auto;
    }
}
