/* ==========================================
   🔥 CARROSSEL NETFLIX - CSS DEFINITIVO
   ⚠️  COLOCA ESSE CSS **DEPOIS** DOS OUTROS
   ========================================== */

/* 🎯 RESETA A GALLERY ANTIGA - FORÇA O CARROSSEL */
.gallery-videos {
    display: block !important; /* Mata o grid antigo */
    grid-template-columns: unset !important;
    max-width: 100% !important;
    position: relative;
    padding: 0 50px !important;
    margin: 0 auto 60px auto !important;
    background: transparent !important;
    min-height: auto !important;
}

/* Container do título */
.section-title {
    max-width: 100% !important;
    margin: 40px auto 20px auto !important;
    padding: 0 50px !important;
}

.section-title h2 {
    color: #fff;
    font-size: 28px;
    font-weight: 700;
    text-align: left;
}

/* ==========================================
   🎬 ESTRUTURA DO CARROSSEL
   ========================================== */

.carousel-wrapper {
    position: relative;
    overflow: hidden;
    width: 100%;
}

.carousel-track {
    display: grid !important;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - (6 * 16px)) / 6); /* 7 cards */
    gap: 16px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 10px 0;
    width: 100%;
}

.carousel-track::-webkit-scrollbar {
    display: none;
}

/* ==========================================
   🎯 CARDS - RESETA TUDO
   ========================================== */

.card-link {
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
    min-width: 0 !important;
    width: auto !important;
    max-width: none !important;
    flex: none !important;
}

.card-video {
    background: #1a1a1a !important;
    border: 1px solid #333 !important;
    border-radius: 8px !important;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    height: 100%;
    display: flex !important;
    flex-direction: column;
    width: 100% !important;
    position: relative;
}

.card-video:hover {
    transform: scale(1.05) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5) !important;
    border-color: #555 !important;
    z-index: 10;
}

/* ==========================================
   📹 CONTAINER DO VÍDEO
   ========================================== */

.video-container {
    position: relative;
    width: 100% !important;
    aspect-ratio: 1/1 !important; /* 🔥 QUADRADO (1:1) */
    overflow: hidden;
    background: #000;
    border-bottom: 1px solid #333;
}

.video-container video,
.video-container img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
}

.credit-badge-video {
    position: absolute;
    top: 12px !important;
    right: 12px !important;
    background: rgba(0, 0, 0, 0.8) !important;
    color: #fff !important;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    z-index: 5;
    backdrop-filter: blur(10px);
}

/* ==========================================
   📝 CONTEÚDO DO CARD
   ========================================== */

.content-video {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #1a1a1a;
}

.title-video {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 8px 0;
}

.author-video {
    font-size: 13px;
    color: #888;
    margin: 0 0 12px 0;
}

.description-video {
    font-size: 14px;
    color: #ccc;
    line-height: 1.5;
    margin: 0 0 12px 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.mode-video {
    font-size: 12px;
    color: #999;
    margin-bottom: 12px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    display: inline-block;
    align-self: flex-start;
}

.footer-video {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.runs-video {
    font-size: 13px;
    color: #999;
}

.official-video {
    font-size: 11px;
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.official-video::before {
    content: "✓";
    margin-right: 4px;
}

/* ==========================================
   🎮 BOTÕES DE NAVEGAÇÃO
   ========================================== */

.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 100px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: #fff;
    font-size: 32px;
    cursor: pointer;
    z-index: 100;
    transition: all 0.3s ease;
    display: none;
}

.carousel-nav:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: translateY(-50%) scale(1.1);
}

.carousel-nav.prev {
    left: 0;
    border-radius: 0 8px 8px 0;
}

.carousel-nav.next {
    right: 0;
    border-radius: 8px 0 0 8px;
}

.carousel-nav.show {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

/* ==========================================
   📱 RESPONSIVO
   ========================================== */

/* 6 cards - 1600px */
@media (max-width: 1600px) {
    .carousel-track {
        grid-auto-columns: calc((100% - (5 * 16px)) / 6) !important;
    }
}

/* 5 cards - 1400px */
@media (max-width: 1400px) {
    .carousel-track {
        grid-auto-columns: calc((100% - (4 * 16px)) / 5) !important;
    }
}

/* 4 cards - 1200px */
@media (max-width: 1200px) {
    .carousel-track {
        grid-auto-columns: calc((100% - (3 * 16px)) / 4) !important;
    }
}

/* 3 cards - 900px */
@media (max-width: 900px) {
    .carousel-track {
        grid-auto-columns: calc((100% - (2 * 16px)) / 3) !important;
    }
    
    .gallery-videos {
        padding: 0 30px !important;
    }
    
    .section-title {
        padding: 0 30px !important;
    }
}

/* 2 cards - MOBILE 600px */
@media (max-width: 600px) {
    .carousel-track {
        grid-auto-columns: calc((100% - 16px) / 2) !important;
        gap: 12px;
    }
    
    .gallery-videos {
        padding: 0 20px !important;
    }
    
    .section-title {
        padding: 0 20px !important;
        margin: 20px auto 15px auto !important;
    }
    
    .section-title h2 {
        font-size: 22px;
    }
    
    .carousel-nav {
        width: 40px;
        height: 80px;
        font-size: 24px;
    }
    
    .title-video {
        font-size: 16px;
    }
    
    .description-video {
        font-size: 13px;
        -webkit-line-clamp: 2;
    }
    
    .content-video {
        padding: 12px;
    }
}

/* 1 card - MOBILE PEQUENO 400px */
@media (max-width: 400px) {
    .carousel-track {
        grid-auto-columns: 100% !important;
    }
}

/* ==========================================
   🎨 ANIMAÇÕES
   ========================================== */

.card-video {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================
   ⚡ PERFORMANCE
   ========================================== */

.carousel-track.scrolling {
    scroll-behavior: auto;
}

/* Otimização de renderização */
.card-video {
    will-change: transform;
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
}