/* Стили для видео в портфолио */
.portfolio-item.videos {
    position: relative;
    overflow: hidden;
}

.portfolio-item.videos video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.portfolio-item.videos:hover video {
    transform: scale(1.05);
}

.video-play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0.8;
}

.video-play-button i {
    color: #ffffff;
    font-size: 24px;
}

.portfolio-item.videos:hover .video-play-button {
    background-color: rgba(255, 255, 255, 0.6);
    transform: translate(-50%, -50%) scale(1.1);
    opacity: 1;
}

/* Модальное окно для видео */
.video-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.video-modal.active {
    display: flex;
}

.video-modal-content {
    position: relative;
    width: 80%;
    max-width: 1000px;
}

.video-modal video {
    width: 100%;
    height: auto;
}

.video-modal-close {
    position: absolute;
    top: -40px;
    right: -40px;
    font-size: 28px;
    color: #fff;
    background: none;
    border: none;
    cursor: pointer;
}

/* Default styling for the video poster */
video.video-hover-play {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

@media (max-width: 768px) {
    .video-play-button {
        width: 40px;
        height: 40px;
    }
    
    .video-play-button i {
        font-size: 18px;
    }
    
    .video-modal-content {
        width: 95%;
    }
    
    /* Ensure poster image is always visible on mobile */
    video.video-hover-play {
        min-height: 180px;
        background-color: #000;
        object-position: center top;
        object-fit: cover;
    }
    
    .video-modal-close {
        top: -30px;
        right: 0;
    }
}
