/**
 * TechVibes Dynamic Carousel Styles
 */

 .tvb-dynamic-carousel-container {
    position: relative;
    width: 100%;
}

/* Controls Layout - Two Columns */
.tvb-carousel-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
    width: 100%;
}

.tvb-carousel-progress-column {
    flex: 3; /* 3/4 de l'espace */
    display: flex;
    align-items: center;
}

.tvb-carousel-arrows-column {
    flex: 1; /* 1/4 de l'espace */
    display: flex;
}

/* Progress Bar */
.tvb-carousel-progress {
    width: 100%;
    height: 4px;
    background-color: #e0e0e0;
    border-radius: 2px;
    overflow: hidden;
}

.tvb-carousel-progress-fill {
    height: 100%;
    background-color: #FE4711;
    border-radius: 2px;
    transition: width 0.3s ease;
    width: 0;
}

/* Carousel Wrapper */
.tvb-carousel-wrapper {
    position: relative;
    overflow: hidden;
}

/* Navigation Arrows */
.tvb-carousel-navigation {
    display: flex;
    gap: 10px;
    align-items: center;
}

.tvb-carousel-arrow {
    width: 40px;
    height: 40px;
    background-color: transparent;
    border: 1px solid var(--e-global-color-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 18px;
    color: var(--e-global-color-primary);
    box-shadow: none;
}

.tvb-carousel-arrow:hover {
    background-color: var(--e-global-color-primary);
    border-color: var(--e-global-color-primary);
    color: #ffffff;
    transform: scale(1.1);
}

.tvb-carousel-arrow:active {
    transform: scale(0.95);
}

/* Icônes de navigation - SVG personnalisées */
.tvb-carousel-arrow svg {
    width: 18px;
    height: 18px;
    display: block;
    stroke: currentColor;
    fill: none;
    pointer-events: none;
}

/* Conteneur pour les icônes SVG */
.tvb-carousel-arrow .tvb-arrow-left,
.tvb-carousel-arrow .tvb-arrow-right {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

/* Assurer que les boutons sont visibles */
.tvb-carousel-arrow {
    position: relative;
    z-index: 10;
}

/* Swiper Container */
.tvb-dynamic-carousel-container .swiper {
    width: 100%;
    padding: 0 30px;
    overflow: visible;
}

.tvb-dynamic-carousel-container .swiper-wrapper {
    align-items: stretch;
}

.tvb-dynamic-carousel-container .swiper-slide {
    height: auto;
    display: flex;
}

/* Carousel Item */
.tvb-carousel-item {
    background: #ffffff;
    overflow: hidden;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
}

/* Image */
.tvb-carousel-image {
    position: relative;
    overflow: hidden;
}

.tvb-carousel-image img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.tvb-carousel-image:hover img {
    transform: scale(1.05);
}

.tvb-carousel-image a {
    display: block;
    text-decoration: none;
}

/* Content */
.tvb-carousel-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Espace pour le lien "Lire la suite" uniquement si présent */
.tvb-carousel-content:has(.tvb-carousel-read-more-wrapper) {
    padding-bottom: 50px;
}

/* Custom Field */
.tvb-carousel-custom-field {
    margin-bottom: 10px;
    font-size: 12px;
    font-weight: 500;
    color: #888888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tvb-carousel-title {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
}

.tvb-carousel-title a {
    text-decoration: none;
    color: #333333;
    transition: color 0.3s ease;
}

.tvb-carousel-title a:hover {
    color: #FE4711;
}

.tvb-carousel-meta {
    margin-bottom: 5px;
    font-size: 14px;
    color: #666666;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.tvb-carousel-date,
.tvb-carousel-author {
    display: flex;
    align-items: center;
}


.tvb-carousel-excerpt {
    color: #555555;
    line-height: 1.6;
    font-size: 14px;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Read More Link */
.tvb-carousel-read-more-wrapper {
    position: absolute;
    bottom: 15px;
    right: 15px;
}

.tvb-carousel-read-more {
    display: inline-block;
    color: var(--e-global-color-primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    padding: 4px;
    transition: color 0.3s ease;
    background-color: transparent;
    position: relative;
    overflow: hidden;
}

.tvb-carousel-read-more::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 1px;
    background-color: var(--e-global-color-primary);
    transition: width 0.3s ease;
    z-index: 1;
}

.tvb-carousel-read-more:hover::after {
    width: 100%;
}

.tvb-carousel-read-more:hover {
    color: var(--e-global-color-primary);
    text-decoration: none;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .tvb-dynamic-carousel-container .swiper {
        padding: 0 20px;
    }
    
    .tvb-carousel-controls {
        gap: 15px;
    }
    
    .tvb-carousel-arrow {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
}

@media (max-width: 768px) {
    .tvb-dynamic-carousel-container .swiper {
        padding: 0 10px;
    }
    
    .tvb-carousel-controls {
        gap: 10px;
    }
    
    .tvb-carousel-arrow {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }
    
    .tvb-carousel-content {
        padding: 15px;
    }
    
    .tvb-carousel-content:has(.tvb-carousel-read-more-wrapper) {
        padding-bottom: 45px; /* Espace réduit pour tablette */
    }
    
    .tvb-carousel-title {
        font-size: 16px;
    }
    
    .tvb-carousel-image img {
        height: 300px;
    }
    
    .tvb-carousel-read-more {
        font-size: 13px;
        padding: 6px 12px;
    }
}

@media (max-width: 480px) {
    .tvb-carousel-controls {
        flex-direction: row;
        gap: 10px;
        align-items: center;
    }
    
    .tvb-carousel-progress-column {
        flex: 2;
    }
    
    .tvb-carousel-arrows-column {
        flex: 1;
        justify-content: flex-end;
    }
    
    .tvb-dynamic-carousel-container .swiper {
        padding: 0 5px;
    }
    
    .tvb-carousel-content {
        padding: 12px;
    }
    
    .tvb-carousel-image img {
        height: 300px;
    }
    
    .tvb-carousel-read-more {
        font-size: 12px;
        padding: 5px 10px;
    }
}

/* Loading States */
.tvb-carousel-item.loading {
    opacity: 0.7;
    pointer-events: none;
}

.tvb-carousel-item.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--e-global-color-primary);
    border-radius: 50%;
    animation: tvb-carousel-spin 1s linear infinite;
}

@keyframes tvb-carousel-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .tvb-carousel-item {
        background: transparent;
        color: #ffffff;
    }
    
    .tvb-carousel-title a {
        color: #ffffff;
    }
    
    .tvb-carousel-title a:hover {
        color: #FE4711;
    }
    
    .tvb-carousel-meta {
        color: #cccccc;
    }
    
    .tvb-carousel-excerpt {
        color: #dddddd;
    }
    
    .tvb-carousel-arrow {
        background-color: transparent;
        border-color: var(--e-global-color-primary);
        color: var(--e-global-color-primary);
    }
    
    .tvb-carousel-arrow:hover {
        background-color: var(--e-global-color-primary);
        border-color: var(--e-global-color-primary);
        color: #ffffff;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .tvb-carousel-item {
        border: 2px solid #000000;
    }
    
    .tvb-carousel-arrow {
        border: 2px solid #000000;
    }
    
    .tvb-carousel-progress {
        border: 1px solid #000000;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .tvb-carousel-item,
    .tvb-carousel-arrow,
    .tvb-carousel-progress-fill,
    .tvb-carousel-image img {
        transition: none;
    }
    
    .tvb-carousel-item:hover {
        transform: none;
    }
    
    .tvb-carousel-image:hover img {
        transform: none;
    }
}
