/**
 * Estilos CSS para Video Slider Pro
 * Basado en el diseño de referencia con video principal, banners laterales y miniaturas
 */

/* Reset y base */
.vsp-slider-container * {
    box-sizing: border-box;
}

.vsp-slider-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.4;
    color: #333;
    position: relative;
    max-width: 100%;
    margin: 1.5rem auto 0; /* Agregado margin-top: 1.5rem */
    background: rgba(0, 153, 204, 1); /* Nuevo color de fondo azul */
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* Título del slider */
.vsp-slider-header {
    padding: 15px 30px;
    background: rgba(0, 153, 204, 1); /* Fondo azul sólido */
    border-bottom: none;
    position: relative;
}

.vsp-slider-header::before {
    display: none; /* Eliminar gradiente */
}

.vsp-slider-title {
    margin: 0;
    font-size: 18px; /* Tamaño más pequeño y simple */
    font-weight: 700;
    color: white;
    text-align: left;
    text-shadow: none; /* Sin sombra para look más limpio */
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    z-index: 1;
}

.vsp-slider-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 60px; /* Línea corta debajo del título */
    height: 3px;
    background: white;
}

/* Contenedor principal del slider */
.vsp-slider-wrapper {
    display: flex;
    gap: 10px; /* Cambiado de 5px a 10px */
    align-items: stretch; /* Cambiar a stretch para que todos los elementos tengan la misma altura */
    position: relative;
    min-height: auto; /* Cambiar a auto para que se ajuste al contenido */
    padding: 12px; /* Reducido de 20px a 12px */
    background: #f5f5f5; /* Fondo gris claro que contrasta bien con el azul */
    margin: 0;
}

/* Área principal del contenido */
.vsp-main-content {
    flex: 0 0 67%; /* Cambiado de 68% a 67% del ancho total para el video */
    min-width: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 600px; /* Altura mínima para asegurar que los banners tengan suficiente altura */
}

/* Video principal */
.vsp-main-video {
    position: relative;
    width: 100%;
    height: 500px; /* Aumentado de 400px a 500px */
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    margin-bottom: 8px; /* Reducido de 20px a 8px */
}

.vsp-video-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.vsp-video-container iframe {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border: none !important;
    border-radius: 12px;
    object-fit: cover;
}

/* Placeholder del video */
.vsp-video-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.vsp-video-placeholder::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(0, 0, 0, 0.1) 0%,
        rgba(0, 0, 0, 0.3) 50%,
        rgba(0, 0, 0, 0.6) 100%
    );
    transition: opacity 0.3s ease;
}

.vsp-video-placeholder:hover::before {
    opacity: 0.8;
}

/* Botón de play */
.vsp-play-button {
    position: relative;
    z-index: 2;
    width: 80px;
    height: 56px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.vsp-play-button:hover {
    transform: scale(1.1);
    background: #fff;
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.4);
}

.vsp-play-button svg {
    transition: transform 0.3s ease;
}

.vsp-play-button:hover svg {
    transform: scale(1.1);
}

/* Iframe del video */
.vsp-video-iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
}

.vsp-video-iframe iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Información del video */
.vsp-video-info {
    position: relative;
    background: transparent;
    color: #333; /* Color oscuro para contrastar con fondo claro */
    padding: 15px 0;
    z-index: 2;
    border-radius: 0;
}

.vsp-video-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 8px 0;
    line-height: 1.3;
    color: #333; /* Color oscuro */
    text-shadow: none; /* Sin sombra */
}

.vsp-video-description {
    font-size: 16px;
    margin: 0;
    color: #666; /* Color gris oscuro */
    line-height: 1.4;
    text-shadow: none; /* Sin sombra */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.vsp-controls {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 4;
    pointer-events: none;
}

.vsp-control {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    pointer-events: auto;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.vsp-control:hover {
    background: #fff;
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.3);
}

.vsp-control svg {
    width: 24px;
    height: 24px;
    fill: #333;
}

/* Banners publicitarios */
.vsp-banner {
    flex: 0 0 16%; /* 16% del ancho total para cada banner */
    position: relative;
    height: 100% !important; /* Forzar altura completa */
    display: flex !important;
    align-items: center;
    justify-content: center;
    min-height: 600px; /* Altura mínima fija para los banners */
}

.vsp-banner-left {
    order: -1;
}

.vsp-banner-right {
    order: 1;
}

.vsp-banner-image {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important; /* Mantener relación de aspecto y cubrir todo el espacio */
    object-position: center !important; /* Centrar la imagen */
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.vsp-banner-image:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.vsp-banner-placeholder {
    width: 100% !important;
    height: 100% !important; /* Ocupar toda la altura disponible */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    min-height: auto !important; /* Cambiar a auto para que se ajuste al contenido */
}

/* Miniaturas */
.vsp-thumbnails {
    position: relative;
    margin-top: auto; /* Empujar las miniaturas hacia abajo para que el contenido se expanda */
    margin-bottom: 0;
}

.vsp-thumbnails-container {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 10px 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.vsp-thumbnails-container::-webkit-scrollbar {
    display: none;
}

/* Miniatura individual */
.vsp-thumbnail {
    flex-shrink: 0;
    width: 170px; /* Aumentado de 120px a 170px */
    position: relative;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: #f5f5f5;
}

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

.vsp-thumbnail.active {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.3);
    border: 2px solid #007bff;
}

.vsp-thumbnail img {
    width: 100%;
    height: 80px; /* Aumentado de 70px a 80px */
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.vsp-thumbnail:hover img {
    transform: scale(1.05);
}

/* Overlay de la miniatura */
.vsp-thumbnail-overlay {
    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;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.vsp-thumbnail:hover .vsp-thumbnail-overlay {
    opacity: 1;
}

.vsp-thumbnail-play {
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vsp-thumbnail-play svg {
    width: 16px;
    height: 16px;
    margin-left: 2px;
}

/* Información de la miniatura */
.vsp-thumbnail-info {
    padding: 10px;
    background: white;
}

.vsp-thumbnail-title {
    font-size: 12px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Navegación de miniaturas */
.vsp-thumbnails-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 2;
}

.vsp-thumbnails-nav:hover {
    background: #fff;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.vsp-thumbnails-prev {
    left: -20px;
}

.vsp-thumbnails-next {
    right: -20px;
}

.vsp-thumbnails-nav svg {
    width: 20px;
    height: 20px;
    fill: #333;
}

/* Estados de carga */
.vsp-loading {
    position: relative;
    pointer-events: none;
}

.vsp-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #fff;
    border-radius: 50%;
    animation: vsp-spin 1s linear infinite;
    z-index: 10;
}

@keyframes vsp-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Lazy loading */
.vsp-thumbnail img.lazy {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.vsp-thumbnail img.lazy.loaded {
    opacity: 1;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .vsp-banner {
        width: 160px;
    }
    
    .vsp-slider-wrapper {
        gap: 15px;
    }
}

@media (max-width: 992px) {
    .vsp-banner {
        width: 140px;
    }
    
    .vsp-main-video {
        height: 350px;
    }
    
    .vsp-video-title {
        font-size: 20px;
    }
    
    .vsp-video-description {
        font-size: 14px;
    }
    
    .vsp-thumbnail {
        width: 110px; /* Reducido de 140px a 110px */
    }
    
    .vsp-thumbnail img {
        height: 65px; /* Reducido de 80px a 65px */
    }
}

@media (max-width: 1024px) and (min-width: 769px) {
    /* Tablets - mantener proporciones pero ajustar banners */
    .vsp-banner {
        flex: 0 0 14%; /* Reducir banners a 14% en tablets */
        min-height: 500px;
    }
    
    .vsp-main-content {
        flex: 0 0 72%; /* Aumentar video a 72% en tablets */
    }
    
    .vsp-slider-wrapper {
        gap: 4px; /* Reducir gap en tablets */
        padding: 10px; /* Reducir padding en tablets */
    }
    
    .vsp-thumbnail {
        width: 150px; /* Reducir miniaturas en tablets */
    }
    
    .vsp-thumbnail img {
        height: 75px; /* Ajustar altura en tablets */
    }
}

@media (max-width: 768px) {
    .vsp-slider-wrapper {
        flex-direction: column;
        gap: 8px; /* Ajustar gap para móviles */
        padding: 8px; /* Reducir padding para móviles */
    }
    
    /* Ocultar banners en móviles */
    .vsp-banner {
        display: none !important;
    }
    
    .vsp-main-content {
        flex: 0 0 auto; /* En móviles, altura automática */
        width: 100%; /* Video ocupa todo el ancho sin banners */
    }
    
    .vsp-main-video {
        height: 280px;
        margin-bottom: 6px; /* Reducir margin en móviles */
    }
    
    .vsp-video-overlay {
        padding: 30px 20px 20px;
    }
    
    .vsp-video-title {
        font-size: 18px;
    }
    
    .vsp-video-description {
        font-size: 13px;
    }
    
    .vsp-control {
        width: 45px;
        height: 45px;
    }
    
    .vsp-control svg {
        width: 20px;
        height: 20px;
    }
    
    .vsp-thumbnail {
        width: 140px; /* Ajustado para móviles */
    }
    
    .vsp-thumbnail img {
        height: 70px; /* Ajustado para móviles */
    }
    
    .vsp-thumbnails-nav {
        width: 35px;
        height: 35px;
    }
    
    .vsp-thumbnails-nav svg {
        width: 18px;
        height: 18px;
    }
}

@media (max-width: 480px) {
    .vsp-slider-wrapper {
        gap: 6px; /* Ajustar gap para móviles pequeños */
        padding: 6px; /* Reducir padding para móviles pequeños */
    }
    
    /* Asegurar que los banners estén ocultos en móviles pequeños también */
    .vsp-banner {
        display: none !important;
    }
    
    .vsp-main-content {
        width: 100%; /* Video ocupa todo el ancho */
    }
    
    .vsp-main-video {
        height: 220px;
        border-radius: 8px;
        margin-bottom: 4px; /* Reducir margin para móviles pequeños */
    }
    
    .vsp-video-overlay {
        padding: 20px 15px 15px;
    }
    
    .vsp-video-title {
        font-size: 16px;
    }
    
    .vsp-video-description {
        font-size: 12px;
        -webkit-line-clamp: 1;
    }
    
    .vsp-play-button {
        width: 60px;
        height: 42px;
    }
    
    .vsp-play-button svg {
        width: 50px;
        height: 36px;
    }
    
    .vsp-control {
        width: 40px;
        height: 40px;
    }
    
    .vsp-controls {
        padding: 0 15px;
    }
    
    .vsp-thumbnail {
        width: 120px; /* Ajustado para móviles pequeños */
    }
    
    .vsp-thumbnail img {
        height: 60px; /* Ajustado para móviles pequeños */
    }
    
    .vsp-thumbnail-info {
        padding: 8px;
    }
    
    .vsp-thumbnail-title {
        font-size: 11px;
    }
    
    .vsp-thumbnails-container {
        gap: 10px;
    }
}

/* Animaciones y transiciones */
.vsp-fade-in {
    animation: vspFadeIn 0.5s ease-out;
}

@keyframes vspFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.vsp-slide-up {
    animation: vspSlideUp 0.4s ease-out;
}

@keyframes vspSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.vsp-zoom-in {
    animation: vspZoomIn 0.3s ease-out;
}

@keyframes vspZoomIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Estados de focus para accesibilidad */
.vsp-thumbnail:focus,
.vsp-control:focus,
.vsp-play-button:focus,
.vsp-thumbnails-nav:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Modo oscuro */
@media (prefers-color-scheme: dark) {
    .vsp-slider-container {
        color: #f0f0f0;
    }
    
    .vsp-thumbnail-info {
        background: #2a2a2a;
    }
    
    .vsp-thumbnail-title {
        color: #f0f0f0;
    }
    
    .vsp-banner-placeholder {
        background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
    }
}

/* Efectos de hover mejorados */
.vsp-video-placeholder:hover .vsp-play-button {
    animation: vspPulse 2s infinite;
}

@keyframes vspPulse {
    0% {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    }
    50% {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 0 10px rgba(255, 255, 255, 0.1);
    }
    100% {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    }
}

/* Mejoras de rendimiento */
.vsp-slider-container {
    will-change: transform;
}

.vsp-video-placeholder,
.vsp-thumbnail,
.vsp-control,
.vsp-play-button {
    will-change: transform;
}

/* Print styles */
@media print {
    .vsp-controls,
    .vsp-thumbnails-nav,
    .vsp-play-button {
        display: none !important;
    }
    
    .vsp-slider-wrapper {
        flex-direction: column;
    }
    
    .vsp-banner {
        width: 100%;
        margin-bottom: 20px;
    }
}

