/* Style du slider de vidéos YouTube CTAB - Version Verte */
.ctab-youtube-slider {
    max-width: 1400px;
    margin: 60px auto;
    padding: 0 20px;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

.ctab-yt-container {
    background: linear-gradient(135deg, #56ab2f 0%, #a8e063 100%);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(86, 171, 47, 0.3);
    overflow: hidden;
    position: relative;
}

/* En-tête avec icône YouTube */
.ctab-yt-header {
    text-align: center;
    margin-bottom: 40px;
}

.ctab-yt-header-content {
    display: inline-flex;
    align-items: center;
    gap: 20px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 20px 40px;
    border-radius: 60px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.ctab-yt-icon {
    background: white;
    border-radius: 50%;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.ctab-yt-header-text {
    text-align: left;
}

.ctab-yt-title {
    color: white;
    margin: 0;
    font-size: 32px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.ctab-yt-subtitle {
    color: rgba(255, 255, 255, 0.9);
    margin: 5px 0 0 0;
    font-size: 16px;
    font-weight: 400;
}

/* Wrapper du slider */
.ctab-yt-slider-wrapper {
    position: relative;
    overflow: hidden;
    padding: 10px 60px 50px;
    margin: 0 -20px;
}

.ctab-yt-slider-track {
    display: flex;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Configuration pour 3 vidéos par vue */
.ctab-yt-slide {
    flex: 0 0 33.333%;
    min-width: 33.333%;
    padding: 15px;
    box-sizing: border-box;
}

/* Carte vidéo */
.ctab-yt-video-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    height: 100%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.ctab-yt-video-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

/* Miniature de la vidéo */
.ctab-yt-thumbnail-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* Ratio 16:9 */
    overflow: hidden;
    background: #f3f4f6;
}

.ctab-yt-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.6s ease, opacity 0.4s ease;
    display: block;
}

.ctab-yt-video-card:hover .ctab-yt-thumbnail {
    transform: scale(1.1);
    opacity: 0.8;
}

/* Overlay de lecture */
.ctab-yt-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ctab-yt-video-card:hover .ctab-yt-play-overlay {
    opacity: 1;
}

.ctab-yt-play-button {
    background: rgba(110, 159, 51, 0.95);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    box-shadow: 0 8px 24px rgba(110, 159, 51, 0.5);
}

.ctab-yt-video-card:hover .ctab-yt-play-button {
    transform: scale(1);
}

.ctab-yt-play-button svg {
    margin-left: 4px;
}

/* Badge de durée */
.ctab-yt-duration-badge {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Informations de la vidéo */
.ctab-yt-video-info {
    padding: 20px;
}

.ctab-yt-video-title {
    color: #2c3e50;
    font-size: 17px;
    font-weight: 700;
    margin: 0 0 12px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 48px;
}

.ctab-yt-video-description {
    color: #6b7280;
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Flèches de navigation */
.ctab-yt-slider-prev,
.ctab-yt-slider-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: white;
    border: none;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    padding: 0;
    outline: none;
}

.ctab-yt-slider-prev {
    left: 10px;
}

.ctab-yt-slider-next {
    right: 10px;
}

/* Support RTL */
[dir="rtl"] .ctab-yt-slider-prev {
    left: auto;
    right: 10px;
}

[dir="rtl"] .ctab-yt-slider-next {
    right: auto;
    left: 10px;
}

[dir="rtl"] .ctab-yt-arrow-icon {
    transform: scaleX(-1);
}

.ctab-yt-slider-prev svg,
.ctab-yt-slider-next svg {
    width: 28px;
    height: 28px;
    fill: #6e9f33;
}

.ctab-yt-slider-prev:hover,
.ctab-yt-slider-next:hover {
    background: #6e9f33;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(110, 159, 51, 0.4);
}

.ctab-yt-slider-prev:hover svg,
.ctab-yt-slider-next:hover svg {
    fill: white;
}

/* Points de navigation */
.ctab-yt-dots-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    padding: 15px 0;
}

.ctab-yt-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
}

.ctab-yt-dot {
    width: 12px;
    height: 12px;
    background: rgba(255, 255, 255, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    margin: 0;
    padding: 0;
    cursor: pointer;
    transition: all 0.3s ease;
    display: block;
}

.ctab-yt-dot.active {
    background: white;
    border-color: white;
    transform: scale(1.4);
}

.ctab-yt-dot:hover {
    background: rgba(255, 255, 255, 0.8);
}

/* Modal de lecture vidéo */
.ctab-yt-modal {
    display: none;
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.95);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.ctab-yt-modal-content {
    position: relative;
    margin: 3% auto;
    width: 90%;
    max-width: 1200px;
    animation: slideDown 0.4s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.ctab-yt-modal-close {
    position: absolute;
    top: -50px;
    right: 0;
    color: white;
    background: rgba(110, 159, 51, 0.9);
    backdrop-filter: blur(10px);
    border: 2px solid white;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 999999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.ctab-yt-modal-close:hover {
    background: rgba(110, 159, 51, 1);
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

/* Conteneur de la vidéo YouTube */
.ctab-yt-video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.ctab-yt-video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Responsive design */
@media (max-width: 1200px) {
    .ctab-yt-slide {
        flex: 0 0 50%;
        min-width: 50%;
    }
}

@media (max-width: 768px) {
    .ctab-yt-container {
        padding: 30px 20px;
        border-radius: 16px;
    }
    
    .ctab-yt-header-content {
        flex-direction: column;
        padding: 20px;
        gap: 15px;
    }
    
    .ctab-yt-header-text {
        text-align: center;
    }
    
    .ctab-yt-title {
        font-size: 24px;
    }
    
    .ctab-yt-subtitle {
        font-size: 14px;
    }
    
    .ctab-yt-slide {
        flex: 0 0 100%;
        min-width: 100%;
    }
    
    .ctab-yt-slider-wrapper {
        padding: 10px 50px 50px;
    }
    
    .ctab-yt-slider-prev,
    .ctab-yt-slider-next {
        width: 44px;
        height: 44px;
        background: rgba(255, 255, 255, 0.95);
    }
    
    .ctab-yt-slider-prev {
        left: 5px;
    }
    
    .ctab-yt-slider-next {
        right: 5px;
    }
    
    [dir="rtl"] .ctab-yt-slider-prev {
        left: auto;
        right: 5px;
    }
    
    [dir="rtl"] .ctab-yt-slider-next {
        right: auto;
        left: 5px;
    }
    
    .ctab-yt-modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .ctab-yt-modal-close {
        top: -40px;
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .ctab-yt-title {
        font-size: 20px;
    }
    
    .ctab-yt-video-title {
        font-size: 15px;
    }
    
    .ctab-yt-video-description {
        font-size: 13px;
    }
    
    .ctab-yt-icon {
        width: 60px;
        height: 60px;
    }
    
    .ctab-yt-icon svg {
        width: 35px;
        height: 35px;
    }
}

/* Animation de chargement */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.ctab-yt-loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Amélioration de l'accessibilité */
.ctab-yt-slider-prev:focus,
.ctab-yt-slider-next:focus,
.ctab-yt-modal-close:focus {
    outline: 3px solid rgba(110, 159, 51, 0.5);
    outline-offset: 2px;
}
