/* ========================================
   SECTION TRAILERS CAROUSEL
   Style Netflix/Prime - Défilement horizontal
======================================== */

.trailers-carousel-section {
    margin: 3rem 3rem;
    padding: 0 1rem;
}

/* ========================================
   HEADER
======================================== */
.trailers-carousel-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.trailers-carousel-section .section-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #FFD700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.trailers-carousel-section .section-link {
    font-size: 1rem;
    color: #999;
    text-decoration: none;
    transition: color 0.3s;
}

.trailers-carousel-section .section-link:hover {
    color: #FFD700;
}

/* ========================================
   CONTAINER CAROUSEL
======================================== */
.carousel-container {
    position: relative;
    width: 100%;
}

/* ========================================
   NAVIGATION FLÈCHES
======================================== */
.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;
    width: 50px;
    height: 100px;
    background: rgba(0, 0, 0, 0.8);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 0;
    pointer-events: none;
}

.carousel-container:hover .carousel-nav {
    opacity: 1;
    pointer-events: all;
}

.carousel-nav:hover {
    background: rgba(227, 6, 19, 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 svg {
    width: 32px;
    height: 32px;
}

/* ========================================
   TRACK (conteneur scrollable)
======================================== */
.carousel-track {
    overflow-x: hidden;
    overflow-y: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.carousel-items {
    display: flex;
    gap: 1rem;
    padding: 0.5rem 0;
}

/* ========================================
   CARDS TRAILERS
======================================== */
.carousel-card {
    flex: 0 0 calc(33.333% - 0.75rem); /* 3 cards visibles */
    min-width: 280px;
    max-width: 400px;
    background: #1a1a1a;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.carousel-card:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 32px rgba(227, 6, 19, 0.5);
    z-index: 10;
}

.carousel-card-link {
    display: block;
    text-decoration: none;
    color: white;
}

/* ========================================
   IMAGE 16:9
======================================== */
.carousel-card-image {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* Ratio 16:9 */
    overflow: hidden;
    background: #000;
}

.carousel-card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.carousel-card:hover .carousel-card-image img {
    transform: scale(1.1);
}

/* ========================================
   OVERLAY PLAY
======================================== */
.carousel-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.carousel-card:hover .carousel-overlay {
    opacity: 1;
}

.play-icon {
    width: 64px;
    height: 64px;
    background: #9D1313;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.carousel-card:hover .play-icon {
    transform: scale(1);
}

.play-icon svg {
    margin-left: 4px; /* Centrage optique du triangle */
}

/* ========================================
   BADGES
======================================== */
.carousel-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    padding: 0.4rem 0.85rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: white;
    background: #9D1313;
    border-radius: 6px;
    z-index: 10;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}

/* Durée vidéo */
.carousel-duration {
    position: absolute;
    bottom: 0.75rem;
    right: 0.75rem;
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    background: rgba(0, 0, 0, 0.85);
    border-radius: 4px;
    z-index: 10;
}

/* ========================================
   CONTENU (titre + date)
======================================== */
.carousel-card-content {
    padding: 1rem;
}

.carousel-card-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
    color: white;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.carousel-card-date {
    font-size: 0.85rem;
    color: #999;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

/* ========================================
   RESPONSIVE
======================================== */

/* Tablette (< 1200px) : 2 cards visibles */
@media (max-width: 1200px) {
    .carousel-card {
        flex: 0 0 calc(50% - 0.5rem);
    }
}

/* Tablette portrait (< 768px) : 1.5 cards visibles (effet peek) */
@media (max-width: 768px) {
    .trailers-carousel-section {
        margin: 3rem 0;
    }

    .trailers-carousel-section .section-title {
        font-size: 1.5rem;
    }

    .carousel-card {
        flex: 0 0 calc(100% - 3rem);
        min-width: 250px;
    }

    .carousel-nav {
        width: 40px;
        height: 80px;
        opacity: 0.7; /* Toujours visible sur mobile */
        pointer-events: all;
    }

    .carousel-nav svg {
        width: 24px;
        height: 24px;
    }
}

/* Mobile (< 480px) : 1 card visible */
@media (max-width: 480px) {
    .trailers-carousel-section .section-title {
        font-size: 1.3rem;
    }

    .carousel-card {
        flex: 0 0 calc(100% - 2rem);
        min-width: 220px;
    }

    .carousel-card-title {
        font-size: 0.95rem;
    }

    .carousel-nav {
        width: 35px;
        height: 70px;
    }
}

