/**
 * GALERÍA DE VIDEOS - DISEÑO LIMPIO 2025
 */

/* ========================================
   VARIABLES
======================================== */
.galeria-video-page {
    --vid-primary: #6366f1;
    --vid-secondary: #ec4899;
    --vid-accent: #22d3ee;
    --vid-dark: #0f0f1a;
    --vid-darker: #080810;
    --vid-surface: #1a1a2e;
    --vid-text: #f1f5f9;
    --vid-text-muted: #94a3b8;
    --vid-gradient: linear-gradient(135deg, var(--vid-primary) 0%, var(--vid-secondary) 100%);
    --vid-radius: 12px;
    --vid-transition: cubic-bezier(0.4, 0, 0.2, 1);
}

.galeria-video-page {
    background: var(--vid-darker);
}

.galeria-video-main {
    min-height: 100vh;
    padding-bottom: 100px;
    background: var(--vid-darker);
}

/* ========================================
   HERO
======================================== */
.galeria-video-header {
    position: relative;
    min-height: 32vh;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    background: var(--vid-dark);
}

.hero-background {
    position: absolute;
    inset: 0;
}

.hero-background::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(8,8,16,0.4) 0%, rgba(8,8,16,0.95) 100%);
    z-index: 1;
}

.hero-background img,
.hero-background video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.6);
}

.hero-background-placeholder {
    width: 100%;
    height: 100%;
    background: var(--vid-surface);
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-background-placeholder i {
    font-size: 6rem;
    color: var(--vid-text-muted);
    opacity: 0.2;
}


.galeria-video-hero {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1.5rem 2.5rem;
}

.galeria-video-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--vid-text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 100px;
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(10px);
    margin-bottom: 1.5rem;
    transition: all 0.3s var(--vid-transition);
}

.galeria-video-back:hover {
    color: var(--vid-text);
    background: rgba(255,255,255,0.12);
    transform: translateX(-4px);
}

.galeria-video-info {
    display: flex;
    gap: 1.5rem;
    align-items: flex-end;
}

.galeria-video-cover {
    position: relative;
    width: 160px;
    height: 160px;
    border-radius: var(--vid-radius);
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 16px 48px rgba(0,0,0,0.5);
}

.galeria-video-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.galeria-video-cover-placeholder {
    width: 100%;
    height: 100%;
    background: var(--vid-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
}

.galeria-video-cover-placeholder i {
    font-size: 3rem;
    color: white;
}

/* Botón de compartir en el cover */
.cover-share-btn {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    border: none;
    color: white;
    font-size: 0.875rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 5;
}

.cover-share-btn:hover {
    background: var(--vid-primary);
    transform: scale(1.1);
}

.galeria-video-details {
    flex: 1;
    min-width: 0;
}

.galeria-video-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--vid-gradient);
    padding: 0.375rem 0.875rem;
    border-radius: 100px;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: white;
    margin-bottom: 0.75rem;
}

.galeria-video-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 800;
    color: var(--vid-text);
    margin: 0 0 0.5rem;
    line-height: 1.15;
}

.galeria-video-description {
    font-size: 1rem;
    color: var(--vid-text-muted);
    margin: 0 0 1rem;
    line-height: 1.5;
    max-width: 550px;
}

.galeria-video-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.875rem;
}

.galeria-video-meta-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--vid-text-muted);
}

.galeria-video-meta-item i {
    color: var(--vid-primary);
}

@media (max-width: 640px) {
    .galeria-video-header {
        min-height: 50vh;
    }
    
    .galeria-video-hero {
        padding: 1.5rem 1rem 2rem;
    }
    
    .galeria-video-info {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .galeria-video-cover {
        width: 120px;
        height: 120px;
    }
    
    .galeria-video-meta {
        justify-content: center;
    }
}

/* ========================================
   GRID DE VIDEOS - LIMPIO
======================================== */
.galeria-video-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.video-item {
    cursor: pointer;
    animation: fadeIn 0.4s var(--vid-transition) backwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.video-thumb {
    position: relative;
    aspect-ratio: 16/9;
    border-radius: var(--vid-radius);
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.video-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s var(--vid-transition), filter 0.3s;
}

.video-item:hover .video-thumb img {
    transform: scale(1.05);
    filter: brightness(0.7);
}

.video-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(255,255,255,0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--vid-dark);
    font-size: 1.5rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.video-play i {
    margin-left: 3px;
}

.video-item:hover .video-play {
    transform: translate(-50%, -50%) scale(1);
}

.video-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0,0,0,0.85);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.video-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--vid-text);
    margin: 0 0 0.375rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s;
}

.video-item:hover .video-title {
    color: var(--vid-accent);
}

.video-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.8125rem;
    color: var(--vid-text-muted);
}

.video-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

@media (max-width: 640px) {
    .galeria-video-content {
        padding: 1.5rem 1rem;
    }
    
    .video-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .video-play {
        width: 52px;
        height: 52px;
        font-size: 1.25rem;
    }
}


/* ========================================
   VIDEO LIGHTBOX CON PLAYLIST
======================================== */
.video-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.98);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s var(--vid-transition);
}

.video-lightbox.active {
    opacity: 1;
    visibility: visible;
}

.video-lightbox-inner {
    display: flex;
    height: 100%;
    width: 100%;
    position: relative;
}

/* Botón cerrar - posición fija en el lightbox */
.video-lightbox-close {
    position: fixed;
    top: 1.25rem;
    left: 1.25rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1.375rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 100;
}

.video-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

/* Área principal */
.video-lightbox-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
    padding-top: 4rem;
    min-width: 0;
}

/* Contenedor del video */
.video-player-container {
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 70vh;
}

.video-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.video-frame {
    position: relative;
    display: inline-block;
}

.video-player-container video {
    display: block;
    max-width: 100%;
    max-height: 70vh;
    border-radius: var(--vid-radius);
    background: #000;
}

/* Título inline debajo del video */
.video-inline-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--vid-text);
    margin-top: 1.25rem;
    opacity: 0.9;
    text-align: left;
    width: 100%;
}

/* Contador de tiempo restante (mobile) */
.video-time-remaining {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.4);
    color: rgba(255, 255, 255, 0.6);
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    font-size: 0.5625rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    z-index: 10;
    pointer-events: none;
}

/* Botón de mute (mobile) */
.video-mute-btn {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.35);
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 15;
    transition: all 0.2s;
}

.video-mute-btn:active {
    background: rgba(0, 0, 0, 0.8);
}

/* Overlay para tap (mobile) */
.video-tap-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5;
    cursor: pointer;
    border-radius: var(--vid-radius);
}

/* Indicador de pausa/play */
.video-pause-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.75rem;
    opacity: 0;
    transition: all 0.2s ease;
    pointer-events: none;
}

.video-pause-indicator.visible {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.video-pause-indicator.flash {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    animation: pauseFlash 0.3s ease;
}

@keyframes pauseFlash {
    0% { transform: translate(-50%, -50%) scale(0.8); opacity: 0; }
    50% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}

.video-pause-indicator.visible.flash {
    animation: none;
}

/* Info del video - pegado debajo del video */
.video-lightbox-info {
    padding: 0.75rem 0 0;
    text-align: left;
    width: 100%;
}

.video-lightbox-title {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--vid-text);
    margin: 0;
    opacity: 0.85;
}

.video-lightbox-meta {
    display: none;
}

.video-lightbox-meta span {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

/* ========================================
   PLAYLIST SIDEBAR (DESKTOP)
======================================== */
.video-playlist-sidebar {
    width: 360px;
    background: var(--vid-surface);
    display: flex;
    flex-direction: column;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.video-playlist-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.video-playlist-count {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--vid-text);
}

.video-playlist-shuffle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: var(--vid-text-muted);
    font-size: 1.125rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.video-playlist-shuffle:hover {
    background: var(--vid-gradient);
    color: white;
}

.video-playlist-shuffle.shuffling {
    animation: shuffleSpin 0.5s ease;
}

@keyframes shuffleSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.video-playlist-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

/* Item de playlist */
.playlist-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.625rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.playlist-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.playlist-item.active {
    background: rgba(99, 102, 241, 0.2);
}

.playlist-item-thumb {
    width: 120px;
    aspect-ratio: 16/9;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
}

.playlist-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.playlist-item-duration {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    font-size: 0.6875rem;
    font-weight: 600;
}

.playlist-item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.playlist-item-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--vid-text);
    margin: 0 0 0.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.playlist-item.active .playlist-item-title {
    color: var(--vid-accent);
}

.playlist-item-meta {
    font-size: 0.75rem;
    color: var(--vid-text-muted);
}

/* Playing indicator */
.playlist-item.active .playlist-item-thumb::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(99, 102, 241, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

.playlist-item-playing {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
}

.playlist-item.active .playlist-item-playing {
    display: flex;
}

.playing-bars {
    display: flex;
    gap: 2px;
    align-items: flex-end;
    height: 16px;
}

.playing-bars span {
    width: 3px;
    background: var(--vid-accent);
    border-radius: 1px;
    animation: playingBar 0.8s ease-in-out infinite;
}

.playing-bars span:nth-child(1) { animation-delay: 0s; height: 8px; }
.playing-bars span:nth-child(2) { animation-delay: 0.2s; height: 12px; }
.playing-bars span:nth-child(3) { animation-delay: 0.4s; height: 6px; }

@keyframes playingBar {
    0%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(0.5); }
}

/* ========================================
   PLAYLIST MOBILE (CINTA HORIZONTAL)
======================================== */
.video-playlist-mobile {
    display: none;
    flex-direction: row;
    padding: 0.75rem 0;
    overflow-x: scroll;
    overflow-y: hidden;
    gap: 0.625rem;
    flex-shrink: 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    width: 100%;
}

.video-playlist-mobile::-webkit-scrollbar {
    display: none;
}

.playlist-mobile-item {
    flex: 0 0 auto;
    width: 100px;
    cursor: pointer;
}

.playlist-mobile-item:active {
    opacity: 0.8;
}

.playlist-mobile-item-thumb {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.playlist-mobile-item.active .playlist-mobile-item-thumb {
    border-color: var(--vid-accent);
    box-shadow: 0 0 12px rgba(34, 211, 238, 0.4);
}

.playlist-mobile-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: filter 0.2s;
}

.playlist-mobile-item:not(.active) .playlist-mobile-item-thumb img {
    filter: brightness(0.7);
}

.playlist-mobile-item-duration {
    position: absolute;
    bottom: 3px;
    right: 3px;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    font-size: 0.5625rem;
    font-weight: 600;
}

/* Mobile responsive */
@media (max-width: 900px) {
    .video-playlist-sidebar {
        display: none;
    }
    
    .video-playlist-mobile {
        display: flex;
        flex-shrink: 0;
        overflow-x: scroll;
        -webkit-overflow-scrolling: touch;
    }
    
    .video-frame {
        width: 100%;
    }
    
    .video-lightbox-main {
        padding: 0.75rem;
        justify-content: flex-start;
        align-items: center;
    }
    
    .video-lightbox-close {
        top: 0.75rem;
        left: 0.75rem;
        width: 38px;
        height: 38px;
        font-size: 1.25rem;
    }
    
    .video-lightbox-info {
        display: none;
    }
    
    .video-player-container {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        max-height: none;
    }
    
    .video-player-container video {
        max-height: 55vh;
        width: 100%;
        border-radius: 8px;
    }
    
    .video-wrapper {
        width: 100%;
    }
    
    .video-inline-title {
        font-size: 1rem;
        margin-top: 1rem;
    }
}

/* ========================================
   ESTADOS
======================================== */
.video-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5rem 2rem;
    color: var(--vid-text-muted);
}

.video-loading-spinner {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 3px solid var(--vid-surface);
    border-top-color: var(--vid-primary);
    animation: spin 0.8s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.video-empty {
    text-align: center;
    padding: 5rem 2rem;
    color: var(--vid-text-muted);
}

.video-empty-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--vid-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
}

.video-empty-icon i {
    font-size: 2.5rem;
    opacity: 0.4;
}

.video-empty h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--vid-text);
    margin: 0 0 0.5rem;
}

.video-empty p {
    margin: 0 0 1.25rem;
}

.video-empty-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--vid-primary);
    text-decoration: none;
    font-weight: 600;
}

.video-empty-link:hover {
    color: var(--vid-accent);
}


/* ========================================
   SWIPE INDICATOR (MOBILE)
======================================== */
.swipe-indicator {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.75rem;
    pointer-events: none;
    z-index: 20;
    animation: swipeIndicatorFade 0.4s ease forwards;
}

.swipe-indicator.swipe-next {
    right: 12px;
    animation: swipeSlideLeft 0.4s ease forwards;
}

.swipe-indicator.swipe-prev {
    left: 12px;
    animation: swipeSlideRight 0.4s ease forwards;
}

@keyframes swipeSlideLeft {
    0% { opacity: 0; transform: translateY(-50%) translateX(20px); }
    30% { opacity: 1; transform: translateY(-50%) translateX(0); }
    100% { opacity: 0; transform: translateY(-50%) translateX(-10px); }
}

@keyframes swipeSlideRight {
    0% { opacity: 0; transform: translateY(-50%) translateX(-20px); }
    30% { opacity: 1; transform: translateY(-50%) translateX(0); }
    100% { opacity: 0; transform: translateY(-50%) translateX(10px); }
}

@keyframes swipeIndicatorFade {
    0% { opacity: 0; }
    30% { opacity: 1; }
    100% { opacity: 0; }
}
