/* ===== GALERIE VIDEO - DESIGN ULTRA MODERNE 2026 ===== */
/* ===== PREMIÈRE VIDÉO AUTO, LES AUTRES AU SCROLL ===== */

/* Variables - Palette épurée */
:root {
    --primary: #0066ff;
    --primary-light: #3385ff;
    --primary-dark: #0044cc;
    --accent: #00e5ff;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --bg-glass: rgba(255, 255, 255, 0.08);
    --border-light: rgba(255, 255, 255, 0.1);
    --shadow-sm: 0 10px 30px -10px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 30px 60px -15px rgba(0, 0, 0, 0.2);
    --shadow-glow: 0 0 40px rgba(0, 102, 255, 0.3);
    --transition-smooth: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ===== ANIMATION D'ENTRÉE SPECTACULAIRE ===== */
@keyframes flyInFromBottom {
    0% {
        opacity: 0;
        transform: translateZ(-200px) translateY(100px) rotateX(-10deg);
        filter: blur(10px);
    }
    40% {
        opacity: 0.5;
        filter: blur(5px);
    }
    100% {
        opacity: 1;
        transform: translateZ(0) translateY(0) rotateX(0);
        filter: blur(0);
    }
}

@keyframes flyInFromLeft {
    0% {
        opacity: 0;
        transform: translateX(-150px) translateZ(-100px) rotateY(15deg);
        filter: blur(8px);
    }
    100% {
        opacity: 1;
        transform: translateX(0) translateZ(0) rotateY(0);
        filter: blur(0);
    }
}

@keyframes flyInFromRight {
    0% {
        opacity: 0;
        transform: translateX(150px) translateZ(-100px) rotateY(-15deg);
        filter: blur(8px);
    }
    100% {
        opacity: 1;
        transform: translateX(0) translateZ(0) rotateY(0);
        filter: blur(0);
    }
}

@keyframes textReveal {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== ÉTAT INITIAL : TOUT EST CACHÉ SAUF LA PREMIÈRE ===== */
.video-section {
    margin-bottom: 100px;
    opacity: 0;
    visibility: hidden;
    position: relative;
    perspective: 1000px;
}

/* La première vidéo est visible immédiatement */
.video-section:first-of-type {
    opacity: 1;
    visibility: visible;
    animation: flyInFromBottom 0.8s var(--transition-smooth) forwards;
}

/* Les autres vidéos deviennent visibles quand on scroll */
.video-section.visible {
    opacity: 1;
    visibility: visible;
}

/* Alternance des animations pour les vidéos au scroll */
.video-section.visible:nth-of-type(odd):not(:first-of-type) {
    animation: flyInFromLeft 0.8s var(--transition-smooth) forwards;
}

.video-section.visible:nth-of-type(even):not(:first-of-type) {
    animation: flyInFromRight 0.8s var(--transition-smooth) forwards;
}

/* Animations des éléments enfants */
.video-section .video-date,
.video-section .video-title,
.video-section .video-meta-item,
.video-section .video-description,
.video-section .video-music-section {
    opacity: 0;
}

/* Première vidéo : animations des enfants */
.video-section:first-of-type .video-date {
    animation: textReveal 0.6s var(--transition-smooth) forwards;
    animation-delay: 0.2s;
}

.video-section:first-of-type .video-title {
    animation: textReveal 0.6s var(--transition-smooth) forwards;
    animation-delay: 0.3s;
}

.video-section:first-of-type .video-meta-item:nth-child(1) {
    animation: textReveal 0.5s var(--transition-smooth) forwards;
    animation-delay: 0.4s;
}

.video-section:first-of-type .video-meta-item:nth-child(2) {
    animation: textReveal 0.5s var(--transition-smooth) forwards;
    animation-delay: 0.45s;
}

.video-section:first-of-type .video-meta-item:nth-child(3) {
    animation: textReveal 0.5s var(--transition-smooth) forwards;
    animation-delay: 0.5s;
}

.video-section:first-of-type .video-description {
    animation: textReveal 0.6s var(--transition-smooth) forwards;
    animation-delay: 0.5s;
}

.video-section:first-of-type .video-music-section {
    animation: textReveal 0.6s var(--transition-smooth) forwards;
    animation-delay: 0.55s;
}

/* Vidéos au scroll : animations des enfants */
.video-section.visible .video-date {
    animation: textReveal 0.6s var(--transition-smooth) forwards;
    animation-delay: 0.2s;
}

.video-section.visible .video-title {
    animation: textReveal 0.6s var(--transition-smooth) forwards;
    animation-delay: 0.3s;
}

.video-section.visible .video-meta-item:nth-child(1) {
    animation: textReveal 0.5s var(--transition-smooth) forwards;
    animation-delay: 0.4s;
}

.video-section.visible .video-meta-item:nth-child(2) {
    animation: textReveal 0.5s var(--transition-smooth) forwards;
    animation-delay: 0.45s;
}

.video-section.visible .video-meta-item:nth-child(3) {
    animation: textReveal 0.5s var(--transition-smooth) forwards;
    animation-delay: 0.5s;
}

.video-section.visible .video-description {
    animation: textReveal 0.6s var(--transition-smooth) forwards;
    animation-delay: 0.5s;
}

.video-section.visible .video-music-section {
    animation: textReveal 0.6s var(--transition-smooth) forwards;
    animation-delay: 0.55s;
}

/* ===== WRAPPER VIDÉO ===== */
.video-wrapper {
    position: relative;
    cursor: pointer;
    border-radius: 24px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    transform-style: preserve-3d;
    transition: all 0.4s var(--transition-smooth);
    box-shadow: var(--shadow-lg);
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.video-wrapper:hover {
    transform: translateZ(20px) scale(1.01);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.video-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s var(--transition-smooth);
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
    pointer-events: auto;
}

.video-wrapper:hover img {
    transform: scale(1.05);
}

/* Overlay play */
.video-wrapper::after {
    content: "▶";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 70px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 102, 255, 0.4);
    z-index: 2;
}

.video-wrapper:hover::after {
    opacity: 1;
}

/* Badge date sur l'image */
.video-thumbnail-badge {
    position: absolute;
    bottom: 16px;
    left: 16px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    color: white;
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    z-index: 3;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* ===== CONTENU TEXTE CONDENSÉ ===== */
.video-content-wrapper {
    padding: 15px 0 15px 30px;
    height: 100%;
    display: flex;
    flex-direction: column;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

@media (max-width: 992px) {
    .video-content-wrapper {
        padding: 25px 0 0 0;
    }
}

/* Date */
.video-date {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--primary);
    margin-bottom: 10px;
}

/* Titre */
.video-title {
    font-weight: 800;
    margin-bottom: 12px;
    font-size: 2.2rem;
    line-height: 1.2;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@media (max-width: 768px) {
    .video-title {
        font-size: 1.8rem;
    }
}

/* Métadonnées compactes */
.video-meta-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px 25px;
    margin: 10px 0 12px;
}

.video-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.video-meta-item i {
    font-size: 1.1rem;
    color: var(--primary);
}

.video-meta-item:hover {
    color: var(--primary);
}

/* Description condensée */
.video-description {
    margin: 8px 0 12px;
    padding: 14px 18px;
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border-radius: 14px;
    color: var(--text-primary);
    line-height: 1.5;
    font-size: 0.9rem;
    border: 1px solid var(--border-light);
    max-height: 120px;
    overflow-y: auto;
}

/* Scrollbar stylisée */
.video-description::-webkit-scrollbar {
    width: 4px;
}

.video-description::-webkit-scrollbar-track {
    background: transparent;
}

.video-description::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

/* Section musique compacte */
.video-music-section {
    margin-top: 8px;
    padding: 12px 16px;
    background: rgba(0, 102, 255, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(0, 102, 255, 0.1);
    max-height: 150px;
    overflow-y: auto;
}

.video-music-section strong {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--primary);
    margin-bottom: 10px;
}

.video-music-section strong i {
    font-size: 1rem;
}

.music-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.music-list li {
    padding: 6px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.music-list li:last-child {
    border-bottom: none;
}

.music-list li::before {
    content: "♪";
    color: var(--primary);
    font-size: 1rem;
    opacity: 0.6;
}

.music-list a {
    color: white;
    text-decoration: none;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 50px;
    background: var(--primary);
    transition: all 0.3s ease;
    margin-left: auto;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.music-list a:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

/* ===== CINEMA OVERLAY ===== */
.cinema-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.96);
    backdrop-filter: blur(20px);
    display: none;
    place-items: center;
    padding: 4vh 4vw;
    z-index: 9999;
}

.cinema-overlay.active {
    display: grid;
}

.cinema-content {
    width: 100%;
    max-width: 1400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cinema-content video {
    width: 100%;
    max-height: 90vh;
    border-radius: 20px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}

/* ===== PROTECTION CONTRE LE TÉLÉCHARGEMENT - RENFORCÉE ===== */
#cinemaVideo::-internal-media-controls-download-button {
    display: none !important;
}

#cinemaVideo::-webkit-media-controls-enclosure {
    overflow: hidden;
}

#cinemaVideo::-webkit-media-controls-panel {
    width: calc(100% + 30px);
}

/* Cache le bouton de téléchargement sur tous les navigateurs */
video::-webkit-media-controls-download-button,
video::-internal-media-controls-download-button {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    width: 0 !important;
    height: 0 !important;
}

/* Pour Firefox */
video::-moz-media-controls-download-button {
    display: none !important;
}

/* Désactiver le menu contextuel et la sélection */
#cinemaVideo {
    pointer-events: auto;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
}

/* Protection des miniatures */
.video-thumbnail {
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
    pointer-events: auto;
}

/* ===== MODE NUIT ===== */
[data-bs-theme="dark"] {
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --bg-glass: rgba(255, 255, 255, 0.03);
    --border-light: rgba(255, 255, 255, 0.08);
}

[data-bs-theme="dark"] .video-title {
    background: linear-gradient(135deg, #ffffff 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

[data-bs-theme="dark"] .video-description {
    background: rgba(20, 20, 30, 0.6);
}

[data-bs-theme="dark"] .music-list li {
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 992px) {
    .video-section {
        margin-bottom: 70px;
    }
    
    .video-content-wrapper {
        padding-left: 0;
    }
}

@media (max-width: 768px) {
    .video-section {
        margin-bottom: 50px;
    }
    
    .video-wrapper {
        margin-bottom: 20px;
    }
    
    .video-title {
        font-size: 1.6rem;
    }
    
    .video-meta-grid {
        gap: 12px;
    }
    
    .video-description {
        padding: 12px;
        font-size: 0.85rem;
    }
    
    .video-wrapper::after {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .video-title {
        font-size: 1.4rem;
    }
    
    .video-thumbnail-badge {
        bottom: 10px;
        left: 10px;
        padding: 4px 10px;
        font-size: 0.65rem;
    }
}