/* YouTube Scraper - Style comme capture */

:root {
    --yts-height: 400px;
}

/* ==== WRAPPER ==== */
.yts-wrapper {
    position: relative;
    margin: 20px 0;
}

/* ==== MODE GRILLE ==== */
.yts-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin: 0;
    padding: 0;
}

.yts-col-1 .yts-item { width: 100%; }
.yts-col-2 .yts-item { width: calc(50% - 8px); }
.yts-col-3 .yts-item { width: calc(33.333% - 11px); }
.yts-col-4 .yts-item { width: calc(25% - 12px); }
.yts-col-5 .yts-item { width: calc(20% - 13px); }

/* ==== MODE SLIDER ==== */
.yts-slider-wrapper {
    position: relative;
}

.yts-slider-wrapper .swiper {
    width: 100%;
    padding: 0 50px;
}

.yts-slider-wrapper .swiper-slide {
    height: auto;
}

/* Boutons navigation */
.yts-slider-wrapper .swiper-button-prev,
.yts-slider-wrapper .swiper-button-next {
    color: #fff;
    background: rgba(0, 0, 0, 0.5);
    width: 44px;
    height: 44px;
    border-radius: 50%;
}

.yts-slider-wrapper .swiper-button-prev:after,
.yts-slider-wrapper .swiper-button-next:after {
    font-size: 20px;
    font-weight: bold;
}

.yts-slider-wrapper .swiper-button-prev:hover,
.yts-slider-wrapper .swiper-button-next:hover {
    background: rgba(0, 0, 0, 0.8);
}

/* Pagination */
.yts-slider-wrapper .swiper-pagination {
    bottom: -30px !important;
}

.yts-slider-wrapper .swiper-pagination-bullet {
    background: #1E90FF;
    opacity: 0.5;
    width: 10px;
    height: 10px;
}

.yts-slider-wrapper .swiper-pagination-bullet-active {
    opacity: 1;
    width: 24px;
    border-radius: 5px;
}

/* ==== ITEMS VIDÉO ==== */
.yts-item {
    position: relative;
    cursor: pointer;
    transition: transform 0.3s ease;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
    height: var(--yts-height);
}

.yts-item:hover {
    transform: translateY(-4px);
}

/* Miniature vidéo - TOUT DEDANS */
.yts-thumb {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000;
}

.yts-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Overlay sombre au survol */
.yts-item:hover .yts-thumb::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1;
}

/* Logo M. en haut à gauche */
.yts-item::before {
    content: 'M.';
    position: absolute;
    top: 12px;
    left: 12px;
    background: #1E90FF;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    z-index: 3;
    font-family: Arial, sans-serif;
}

/* Durée en bas à droite */
.yts-duration {
    position: absolute;
    right: 8px;
    bottom: 60px; /* Au-dessus du titre */
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 13px;
    font-weight: 600;
    z-index: 3;
}

/* Bouton Play centré */
.yts-play {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: #1E90FF;
    color: #fff;
    border: none;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(30, 144, 255, 0.5);
}

.yts-play::before {
    content: '';
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 12px 0 12px 20px;
    border-color: transparent transparent transparent #fff;
    margin-left: 4px;
}

.yts-item:hover .yts-play {
    transform: translate(-50%, -50%) scale(1.15);
    background: #0077FF;
    box-shadow: 0 6px 20px rgba(30, 144, 255, 0.7);
}

/* Titre EN BAS sur l'image (comme la capture) */
.yts-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px 12px 12px 12px;
    background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.8) 70%, transparent 100%);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    z-index: 2;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    max-height: 50px;
}

/* ==== MODAL ==== */
.yts-modal {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.yts-modal-inner {
    width: 90%;
    max-width: 1200px;
    position: relative;
    padding-top: 56.25%;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

.yts-modal-content {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
}

.yts-modal-content iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.yts-modal-close {
    position: absolute;
    right: -50px;
    top: 0;
    background: #fff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    border: none;
    cursor: pointer;
    font-size: 24px;
    color: #333;
    transition: all 0.3s ease;
    z-index: 100000;
}

.yts-modal-close:hover {
    background: #f0f0f0;
    transform: rotate(90deg);
}

/* ==== RESPONSIVE ==== */
@media (max-width: 1024px) {
    .yts-col-5 .yts-item,
    .yts-col-4 .yts-item {
        width: calc(33.333% - 11px);
    }
    
    .yts-modal-close {
        right: 10px;
        top: -50px;
    }
    
    .yts-slider-wrapper .swiper {
        padding: 0 40px;
    }
}

@media (max-width: 768px) {
    .yts-col-3 .yts-item,
    .yts-col-4 .yts-item,
    .yts-col-5 .yts-item {
        width: calc(50% - 8px);
    }
    
    .yts-title {
        font-size: 14px;
    }
    
    .yts-play {
        width: 56px;
        height: 56px;
    }
    
    .yts-modal-inner {
        width: 95%;
    }
    
    .yts-slider-wrapper .swiper {
        padding: 0 30px;
    }
    
    :root {
        --yts-height: 300px;
    }
}

@media (max-width: 480px) {
    .yts-col-2 .yts-item,
    .yts-col-3 .yts-item,
    .yts-col-4 .yts-item,
    .yts-col-5 .yts-item {
        width: 100%;
    }
    
    .yts-grid {
        gap: 12px;
    }
    
    .yts-modal-close {
        right: 5px;
        top: -45px;
        width: 36px;
        height: 36px;
    }
    
    .yts-slider-wrapper .swiper {
        padding: 0 20px;
    }
    
    .yts-play {
        width: 48px;
        height: 48px;
    }
    
    .yts-play::before {
        border-width: 10px 0 10px 16px;
    }
    
    :root {
        --yts-height: 250px;
    }
}

/* Utilitaires */
.yts-error {
    padding: 20px;
    background: #fee;
    border: 1px solid #c33;
    border-radius: 4px;
    margin: 20px 0;
    color: #c33;
}
