body {
    margin: 0;
    min-height: 100vh;
    background-color: #4c7ea0;
    overflow-x: hidden;
}

.videos-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding: 15px;
    box-sizing: border-box;
}

.back-button {
    align-self: flex-start;
    width: 54px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0a192f;
    font-size: 2rem;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.back-button:active {
    transform: scale(0.9);
}

.video-grid-container {
    max-width: 460px;
    margin-top: 4px;
}

.video-card {
    position: relative;
    background-color: #ffffff;
    border-radius: 16px;
    aspect-ratio: 16 / 9;
    width: 100%;
    overflow: hidden;
    box-shadow: 0 6px 14px rgba(0,0,0,0.25);
    cursor: pointer;
    transition: transform 0.2s ease;
    background-size: cover;
    background-position: center;
    position: relative;
}

#vid-1 { 
    background-image: url('videos/miniatura1.png'); 
}
#vid-2 { 
    background-image: url('videos/miniatura2.png'); 
}
#vid-3 { 
    background-image: url('videos/miniatura3.png'); 
}
#vid-4 { 
    background-image: url('videos/miniatura4.png'); 
}
#vid-5 { 
    background-image: url('videos/miniatura5.png'); 
}


.video-card:active {
    transform: scale(0.96);
}

.video-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 46px;
    height: 46px;
    background-color: rgba(10, 25, 47, 0.75);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.4rem;
    pointer-events: none;
}

.video-modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: #5b87a4;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
}

.video-modal-content {
    width: 90%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 20px 0;
}

.video-modal.active {
    display: flex;
}

.video-modal video {
    width: 100%;
    max-width: 700px;
    aspect-ratio: 16 / 9;
    border-radius: 10px;
}

#video-player {
    width: 100%;
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    transition: filter 0.3s ease;
}

.video-modal-close {
    position: absolute;
    top: 20px;
    left: 20px; 
    font-size: 30px;
    color: #0b1f2e; 
    cursor: pointer;
    z-index: 100;
    transition: transform 0.2s ease, color 0.2s ease;
}

.video-modal-close:hover {
    color: #1a1a1a;
    transform: scale(1.1);
}

.filtros-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 80%;
}

.filtro-btn {
    background-color: #0b1f2e;
    color: white;
    border: none;
    border-radius: 10px;
    padding: 15px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.btn-reset {
    background-color: #4a6b82;
}

.guardar-btn {
    background-color: #cc1010;
    color: white;
    border: none;
    border-radius: 10px;
    padding: 15px;
    font-size: 18px;
    font-weight: bold;
    width: 80%;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    margin-top: 10px;
}

@media (min-width: 576px) {
    .video-grid-container {
        max-width: 460px;
    }
}

@media (min-width: 992px) {
    .video-grid-container {
        max-width: 520px;
    }
}