.videos-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 20px;
}

.video-item {
    text-align: center;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.video-item:hover {
    transform: translateY(-5px);
}

.video-thumbnail {
    position: relative;
    cursor: pointer;
}

.video-thumbnail img {
    width: 100%;
    border-bottom: 3px solid var(--accent);
}

.play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    color: white;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
}

.video-title {
    font-size: 1rem;
    margin: 10px 0;
}

.video-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    width: 70%;
    max-width: 960px;
    height: 56.25%; /* Proporzioni 16:9 */
    background: black;
    position: relative;
}

.close-modal {
    position: absolute;
    top: -30px;
    right: -30px;
    background: var(--accent);
    color: white;
    font-size: 2rem;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    text-align: center;
    cursor: pointer;
    line-height: 40px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Media query per dispositivi mobili */
@media (max-width: 768px) {
    .videos-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .modal-content {
        width: 90%; /* Più largo per piccoli schermi */
        height: auto; /* Lascia che l'aspect-ratio gestisca l'altezza */
        aspect-ratio: 16 / 9; /* Rispetta sempre il layout 16:9 */
    }

    .close-modal {
        top: 10px;
        right: 10px;
    }
}