/**
 * Video Thumbnails CSS
 * Styles for YouTube video thumbnails and play buttons in portfolio items
 */

/* Video thumbnail container */
.video-thumbnail {
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

/* Mantener relación de aspecto 16:9 para las miniaturas */
.video-thumbnail figure {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* Relación de aspecto 16:9 (9/16 = 0.5625 = 56.25%) */
    margin: 0;
    overflow: hidden;
}

.video-thumbnail figure img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Modificar el comportamiento del overlay en el proyecto */
.project-item .project-content {
    z-index: 1; /* Asegura que el overlay esté debajo del botón de reproducción */
    pointer-events: none; /* Hace que el overlay no capture eventos del mouse */
}

/* Permitir que los enlaces dentro del proyecto sigan siendo clickeables */
.project-item .project-content a {
    pointer-events: auto; /* Restaura la capacidad de hacer clic en los enlaces */
    position: relative;
    z-index: 5; /* Mayor que el overlay */
}

/* Play button overlay */
.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10; /* Asegura que esté por encima de cualquier otro elemento */
    pointer-events: auto; /* Garantiza que capture eventos del mouse */
}

.play-button i {
    color: white;
    font-size: 24px;
}

/* Hover effect for play button */
.video-thumbnail:hover .play-button {
    background-color: rgba(255, 0, 0, 0.8);
    transform: translate(-50%, -50%) scale(1.1);
}

/* Video Modal Styles */
.video-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    overflow: hidden;
    align-items: center;
    justify-content: center;
}

.video-modal.active {
    display: flex;
}

.video-modal-content {
    position: relative;
    width: 90%;
    max-width: 900px;
    margin: 0 auto;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.5);
}

.video-modal-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    border-radius: 12px;
}

.video-modal-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 12px;
}

.close-video-modal {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 30px;
    cursor: pointer;
    background: none;
    border: none;
    outline: none;
    z-index: 10000;
}

/* Responsive adjustments */
@media (max-width: 767px) {
    .video-modal-content {
        width: 95%;
    }
    
    .close-video-modal {
        top: -35px;
        font-size: 24px;
    }
}
