/* Estilos para la sección de videos */
.videos-section {
    margin: 3rem 0;
}

/* Video Principal */
.video-main {
    margin-bottom: 2rem;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.video-main video {
    width: 100%;
    display: block;
    background: #000;
}

/* Miniaturas de videos */
.video-thumbnail {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 2.5rem;
    height: 100%;
    background: #fff;
    border: 1px solid #eee;
    padding: 0.75rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Espaciado entre filas de miniaturas */
.row.g-3 {
    row-gap: 2rem !important;
}

.video-thumbnail:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.video-thumbnail img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
}

.play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #dd4017;
    font-size: 1.2rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-thumbnail:hover .play-icon {
    opacity: 1;
}

.video-thumbnail-title {
    padding: 0.75rem;
    background: #f8f9fa;
    font-weight: 500;
    text-align: center;
    color: #333;
}

/* Título del video */
#video-title {
    color: #333;
    margin: 1rem 0 0;
    font-size: 1.25rem;
}

/* Responsive */
@media (max-width: 768px) {
    .video-thumbnail {
        margin-bottom: 1.5rem;
    }
    
    .video-thumbnail img {
        height: 140px;
    }
}

.video-container:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* Video Styles */
.video-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background-color: #000;
}

/* Custom video controls */
.video-container::-webkit-media-controls {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-container:hover::-webkit-media-controls {
    opacity: 1;
}

/* Fallback for browsers that don't support object-fit */
@supports not (object-fit: cover) {
    .video-container video {
        position: absolute;
        top: 50%;
        left: 50%;
        min-width: 100%;
        min-height: 100%;
        transform: translate(-50%, -50%);
    }
}

/* Loading State */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.25em;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .video-container {
        margin-bottom: 1rem;
    }
}

/* Video Grid Layout */
#video-players {
    margin: 2rem 0;
}

/* Asegurar que los videos tengan la misma altura */
#video-players .col-12 {
    display: flex;
}

/* Estilos para móviles */
@media (max-width: 767.98px) {
    #video-players .col-12 {
        margin-bottom: 1.5rem;
    }
}

/* Video Thumbnails */
.video-thumbnail {
    position: relative;
    display: block;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 16/9;
}

.video-thumbnail::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    transition: background 0.3s ease;
}

.video-thumbnail:hover::after {
    background: rgba(0, 0, 0, 0.5);
}

.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: all 0.3s ease;
}

.video-thumbnail:hover .play-button {
    transform: translate(-50%, -50%) scale(1.1);
    background: #fff;
}

.play-button::after {
    content: '';
    display: block;
    width: 0;
    height: 0;
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
    border-left: 20px solid #dd4017;
    margin-left: 4px;
}

/* Video Modal */
.video-modal .modal-dialog {
    max-width: 800px;
    margin: 1.75rem auto;
}

.video-modal .modal-content {
    background: transparent;
    border: none;
}

.video-modal .modal-body {
    padding: 0;
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
}

.video-modal iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}
/* Video captions */
.video-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: #fff;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
    pointer-events: none;
    text-align: center;
    font-weight: 500;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.video-container:hover .video-caption {
    opacity: 1;
}

.video-controls button {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 0.5rem;
    font-size: 1.2rem;
    transition: transform 0.2s ease;
}

.video-controls button:hover {
    transform: scale(1.1);
    color: #ff6b6b;
}

.video-controls .control-group {
    display: flex;
    gap: 0.5rem;
}

/* Video Thumbnails */
.video-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.video-thumbnail {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 16/9;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.video-thumbnail:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.video-thumbnail::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
    opacity: 0.8;
    transition: all 0.3s ease;
}

.video-thumbnail:hover::after {
    background: rgba(0, 0, 0, 0.5);
    opacity: 1;
}

.video-thumbnail::before {
    content: '▶';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    z-index: 2;
    transition: all 0.3s ease;
}

.video-thumbnail:hover::before {
    transform: translate(-50%, -50%) scale(1.1);
}

/* Video Lightbox */
.video-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.video-lightbox.active {
    opacity: 1;
    visibility: visible;
}

.video-lightbox-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.video-lightbox-close {
    position: absolute;
    top: 15px;
    right: 20px;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    z-index: 10;
    transition: color 0.2s ease;
}

.video-lightbox-close:hover {
    color: #f00;
}

.video-lightbox-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
}

.video-lightbox-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.video-lightbox-caption {
    padding: 1rem;
    color: #fff;
    text-align: center;
    font-size: 1.1rem;
    background: rgba(0, 0, 0, 0.8);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .video-gallery {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }
    
    .video-lightbox-content {
        width: 95%;
    }
}

/* Keyboard Shortcuts Helper */
.keyboard-shortcuts {
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.85rem;
    margin-top: 0.5rem;
    display: none;
}

.keyboard-shortcuts.show {
    display: block;
}

.keyboard-shortcuts kbd {
    background: #333;
    color: #fff;
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    font-family: monospace;
    font-size: 0.8em;
    margin: 0 0.2rem;
    border: 1px solid #555;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}
