/**
 * LVDD Programs - Frontend Styles
 * Styles pour l'affichage des programmes en liste et carousel
 */

/* ====================
   STYLES GÉNÉRAUX
   ==================== */

.lvdd-programmes-liste,
.lvdd-programmes-carousel {
    margin: 20px 0;
    padding: 0;
}

.lvdd-no-programs {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 16px;
}

/* ====================
   CARTE DE PROGRAMME - Style Épisodes
   ==================== */

.lvdd-program-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

.lvdd-program-card-link:hover {
    text-decoration: none;
    color: inherit;
}

.lvdd-program-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.lvdd-program-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* Image et overlay */
.program-image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* Ratio 16:9 */
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.program-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.lvdd-program-card:hover .program-image {
    transform: scale(1.05);
}

/* Badge heure en overlay */
.program-time-overlay {
    position: absolute;
    bottom: 10px;
    right: 10px;
    z-index: 2;
}

.program-time {
    display: inline-block;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

/* Informations du programme */
.program-info {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.program-category {
    font-size: 11px;
    font-weight: 600;
    color: #e94560;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 6px 0;
}

.program-title {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0 0 8px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.program-date {
    font-size: 13px;
    color: #666;
    margin: auto 0 0 0;
}

.program-duration {
    font-size: 12px;
    color: #999;
    margin: 4px 0 0 0;
}

/* ====================
   AFFICHAGE LISTE (HORIZONTAL SCROLL)
   ==================== */

.lvdd-programmes-liste {
    display: flex;
    gap: 20px;
    padding: 20px 0;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.lvdd-programmes-liste::-webkit-scrollbar {
    height: 8px;
}

.lvdd-programmes-liste::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.lvdd-programmes-liste::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.lvdd-programmes-liste::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.5);
}

.lvdd-programmes-liste .lvdd-program-card {
    min-width: 280px;
    max-width: 280px;
    flex-shrink: 0;
}

/* Bordure bleue sur le premier programme */
.lvdd-programmes-liste .lvdd-program-card:first-child .program-image-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 4px solid #0EA5E9;
    border-radius: 8px;
    z-index: 2;
    pointer-events: none;
    box-shadow: 0 0 20px rgba(14, 165, 233, 0.5);
}

@media (max-width: 768px) {
    .lvdd-programmes-liste .lvdd-program-card {
        min-width: 220px;
        max-width: 220px;
    }
}

@media (max-width: 480px) {
    .lvdd-programmes-liste .lvdd-program-card {
        min-width: 180px;
        max-width: 180px;
    }
}

/* ====================
   AFFICHAGE GRILLE (HORIZONTAL + VERTICAL)
   ==================== */

.lvdd-programmes-grid {
    display: grid;
    grid-template-columns: repeat(var(--grid-columns, 3), 1fr);
    gap: 20px;
    padding: 20px 0;
}

.lvdd-programmes-grid .lvdd-program-card {
    width: 100%;
}

@media (max-width: 1024px) {
    .lvdd-programmes-grid {
        grid-template-columns: repeat(min(var(--grid-columns, 3), 2), 1fr);
    }
}

@media (max-width: 640px) {
    .lvdd-programmes-grid {
        grid-template-columns: 1fr;
    }
}

/* ====================
   CAROUSEL
   ==================== */

.lvdd-programmes-carousel {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 20px auto;
    padding: 0;
}

.carousel-container {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.carousel-track-wrapper {
    flex: 1;
    overflow: hidden;
    border-radius: 8px;
    margin: 0 60px;
}

.carousel-track {
    display: flex;
    gap: 10px;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.carousel-slide {
    flex: 0 0 calc(17.5% - 8px);
    min-width: 0 !important;
}

.lvdd-programmes-carousel .carousel-slide .lvdd-program-card,
.lvdd-programmes-carousel .carousel-slide .lvdd-podcast-card,
.lvdd-programmes-carousel .carousel-slide .lvdd-category-card,
.lvdd-categories-carousel .carousel-slide .lvdd-program-card,
.lvdd-categories-carousel .carousel-slide .lvdd-category-card,
.lvdd-podcasts-carousel .carousel-slide .lvdd-podcast-card {
    width: 100% !important;
    margin: 0 !important;
    height: 100%;
}

.lvdd-episodes-carousel .carousel-slide {
    flex: 0 0 calc(33.333% - 14px) !important;
}

.lvdd-episodes-carousel .carousel-slide .lvdd-episode-card {
    width: 100% !important;
    height: 100%;
}

/* Responsive carousel */
@media (max-width: 1024px) {
    .carousel-slide {
        flex: 0 0 calc(35% - 8px) !important;
    }
    
    .lvdd-episodes-carousel .carousel-slide {
        flex: 0 0 calc(50% - 10px) !important;
    }
}

@media (max-width: 640px) {
    .carousel-slide {
        flex: 0 0 70% !important;
    }
    
    .lvdd-episodes-carousel .carousel-slide {
        flex: 0 0 100% !important;
    }
    
    .carousel-track-wrapper {
        margin: 0 45px;
    }
}

/* Boutons de navigation - Design moderne */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: #ffffff;
    color: #1a1a2e;
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.carousel-btn.carousel-prev {
    left: 0;
}

.carousel-btn.carousel-next {
    right: 0;
}

.carousel-btn:hover {
    background: var(--lvdd-accent, #e94560);
    color: #ffffff;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(233, 69, 96, 0.3);
}

.carousel-btn:active {
    transform: translateY(-50%) scale(0.95);
}

@media (max-width: 640px) {
    .carousel-btn {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
}

/* Dots de navigation */
.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    padding: 0;
}

.carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ddd;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.carousel-dot:hover {
    background: var(--lvdd-accent, #e94560);
    transform: scale(1.2);
}

.carousel-dot.active {
    background: var(--lvdd-accent, #e94560);
    width: 24px;
    border-radius: 6px;
}

/* ====================
   CARTE DE CATÉGORIE - Style Épisodes
   ==================== */

.lvdd-category-card .program-image-wrapper {
    padding-top: 75%; /* Ratio 4:3 pour les catégories */
}

.lvdd-category-card .program-info {
    text-align: center;
}

.lvdd-category-card .program-title {
    text-align: center;
}

.lvdd-category-card .program-category {
    text-align: center;
    justify-content: center;
}

/* ====================
   ANIMATIONS
   ==================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.lvdd-program-card,
.lvdd-category-card {
    animation: fadeIn 0.5s ease-out;
}

/* ====================
   CAROUSEL DES CATÉGORIES
   ==================== */

.lvdd-categories-carousel .carousel-slide {
    flex: 0 0 calc(25% - 15px);
}

@media (max-width: 1200px) {
    .lvdd-categories-carousel .carousel-slide {
        flex: 0 0 calc(33.333% - 14px);
    }
}

@media (max-width: 900px) {
    .lvdd-categories-carousel .carousel-slide {
        flex: 0 0 calc(50% - 10px);
    }
}

@media (max-width: 600px) {
    .lvdd-categories-carousel .carousel-slide {
        flex: 0 0 100%;
    }
}

/* ====================
   CAROUSEL D'ÉPISODES
   ==================== */

.lvdd-episodes-carousel {
    margin: 20px 0;
    padding: 0;
    position: relative;
}

.lvdd-episodes-carousel .carousel-container {
    position: relative;
    display: flex;
    align-items: center;
}

.lvdd-episodes-carousel .carousel-track-wrapper {
    overflow: hidden;
    width: 100%;
    margin: 0 50px;
}

.lvdd-episodes-carousel .carousel-track {
    display: flex;
    gap: 20px;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.lvdd-episodes-carousel .carousel-slide {
    flex: 0 0 calc(33.333% - 14px);
    min-width: 0;
}

.lvdd-episodes-carousel .carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #fff;
    border: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #333;
    z-index: 10;
    transition: all 0.3s ease;
}

.lvdd-episodes-carousel .carousel-btn:hover {
    background: #e94560;
    color: #fff;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(233, 69, 96, 0.3);
}

.lvdd-episodes-carousel .carousel-prev {
    left: 0;
}

.lvdd-episodes-carousel .carousel-next {
    right: 0;
}

.lvdd-episodes-carousel .carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.lvdd-episodes-carousel .carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.2);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.lvdd-episodes-carousel .carousel-dot:hover,
.lvdd-episodes-carousel .carousel-dot.active {
    background: #e94560;
}

.lvdd-episodes-carousel .carousel-dot.active {
    width: 24px;
    border-radius: 6px;
}

/* Responsive Episodes Carousel */
@media (max-width: 1024px) {
    .lvdd-episodes-carousel .carousel-slide {
        flex: 0 0 calc(50% - 10px);
    }
}

@media (max-width: 640px) {
    .lvdd-episodes-carousel .carousel-slide {
        flex: 0 0 100%;
    }
    
    .lvdd-episodes-carousel .carousel-track-wrapper {
        margin: 0 40px;
    }
    
    .lvdd-episodes-carousel .carousel-btn {
        width: 36px;
        height: 36px;
        font-size: 20px;
    }
}

/* ====================
   CARTE D'ÉPISODE
   ==================== */

.lvdd-episode-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

.lvdd-episode-card-link:hover {
    text-decoration: none;
    color: inherit;
}

.lvdd-episode-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.lvdd-episode-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.lvdd-episode-card .episode-image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* Ratio 16:9 */
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

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

.lvdd-episode-card:hover .episode-image {
    transform: scale(1.05);
}

.lvdd-episode-card .episode-duration {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.lvdd-episode-card .episode-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.lvdd-episode-card .episode-play-overlay svg {
    width: 24px;
    height: 24px;
    color: #e94560;
    margin-left: 3px;
}

.lvdd-episode-card:hover .episode-play-overlay {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.lvdd-episode-card .episode-play-overlay:hover {
    background: #fff;
    transform: translate(-50%, -50%) scale(1.1);
}

.lvdd-episode-card .episode-info {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.lvdd-episode-card .episode-meta {
    font-size: 11px;
    font-weight: 600;
    color: #e94560;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 6px 0;
}

.lvdd-episode-card .episode-title {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0 0 8px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.lvdd-episode-card .episode-podcast {
    font-size: 13px;
    color: #666;
    margin: auto 0 0 0;
}

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

@media (max-width: 768px) {
    .program-title {
        font-size: 16px;
    }

    .program-time {
        font-size: 12px;
        padding: 4px 10px;
    }

    .program-info {
        padding: 12px;
    }
}
