/* Video Embed Styles - css/video-embed.css */

.video-section {
    margin: 40px 0;
}

.video-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    margin: 20px 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.video-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 12px;
}

/* Hide YouTube UI elements with CSS overlay */
.video-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px; /* Cover top area where YouTube UI appears */
    background: transparent;
    z-index: 5;
    pointer-events: none;
}

/* Hide YouTube branding and UI when video is playing */
.video-container.video-playing::after {
    display: none;
}

.video-description {
    text-align: center;
    color: #666;
    margin-top: 30px;
    font-size: 16px;
    line-height: 1.6;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Loading state for video */
.video-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #f0f0f0 25%, transparent 25%), 
                linear-gradient(-45deg, #f0f0f0 25%, transparent 25%), 
                linear-gradient(45deg, transparent 75%, #f0f0f0 75%), 
                linear-gradient(-45deg, transparent 75%, #f0f0f0 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    animation: loading 2s linear infinite;
    opacity: 0.3;
    z-index: 1;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* Hide loading animation when video is loaded */
.video-container.video-loaded::before {
    opacity: 0;
    animation: none;
}

.video-container iframe + * {
    z-index: 2;
    position: relative;
}

@keyframes loading {
    0% {
        background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    }
    100% {
        background-position: 20px 20px, 20px 30px, 30px 10px, 10px 20px;
    }
}

/* Custom play button overlay - always visible until clicked */
.custom-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.95);
    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 20px rgba(0, 0, 0, 0.2);
}

.custom-play-overlay:hover {
    background: rgba(255, 255, 255, 1);
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.3);
}

.custom-play-overlay.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0.8);
}

.play-icon {
    width: 0;
    height: 0;
    border-left: 20px solid #ff0000;
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
    margin-left: 4px;
}

/* Video analytics indicator (subtle) */
.video-viewed {
    opacity: 0.8;
}

.video-viewed::after {
    content: '';
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 8px;
    height: 8px;
    background: #4CAF50;
    border-radius: 50%;
    z-index: 5;
}

/* Responsive design */
@media (max-width: 768px) {
    .video-container {
        margin: 15px 0;
        border-radius: 8px;
    }
    
    .video-description {
        font-size: 14px;
        margin-top: 20px;
        padding: 0 10px;
    }
    
    .custom-play-overlay {
        width: 60px;
        height: 60px;
    }
    
    .play-icon {
        border-left-width: 15px;
        border-top-width: 9px;
        border-bottom-width: 9px;
    }
}

@media (max-width: 480px) {
    .video-section {
        margin: 20px 0;
    }
    
    .video-container {
        border-radius: 6px;
    }
    
    .custom-play-overlay {
        width: 50px;
        height: 50px;
    }
    
    .play-icon {
        border-left-width: 12px;
        border-top-width: 7px;
        border-bottom-width: 7px;
    }
}

/* Integration with existing projects section */
.projects .video-section {
    background: rgba(248, 249, 250, 0.5);
    padding: 30px;
    border-radius: 12px;
    margin-top: 30px;
}

/* Dark mode support (if your site supports it) */
@media (prefers-color-scheme: dark) {
    .video-description {
        color: #ccc;
    }
    
    .projects .video-section {
        background: rgba(30, 30, 30, 0.5);
    }
    
    .custom-play-overlay {
        background: rgba(40, 40, 40, 0.95);
    }
    
    .custom-play-overlay:hover {
        background: rgba(40, 40, 40, 1);
    }
}