/* ===================================
   PORTFOLIO VIDEO ORIENTATION FIX
   =================================== */

/* Allow portfolio videos to display in their natural orientation */
.portfolio-video {
    width: 100% !important;
    background: #000 !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 200px !important;
    aspect-ratio: auto !important;
    position: relative !important;
}

.portfolio-video video {
    width: 100% !important;
    height: auto !important;
    max-height: 600px !important;
    object-fit: contain !important;
    display: block !important;
    cursor: pointer !important;
    transition: 0.4s ease !important;
}


/* Ensure hover effect still works */
.portfolio-item:hover .portfolio-video video {
    transform: scale(1.05) !important;
}

/* Hide overlay when video is playing */
.portfolio-video.playing~.portfolio-overlay {
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Loading indicator for videos */
.portfolio-video.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: 4px solid rgba(46, 156, 219, 0.3);
    border-top-color: #2E9CDB;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 10;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .portfolio-video video {
        max-height: 500px !important;
    }

    /* On mobile, hide overlay by default and only show when video is paused */
    .portfolio-overlay {
        opacity: 1 !important;
    }

    .portfolio-video.playing~.portfolio-overlay {
        opacity: 0 !important;
        transition: opacity 0.3s ease !important;
    }
}