/**
 * Carrousel de documentations - Page d'accueil
 */

/* Filtres par catégorie */
.category-filters {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-bottom: var(--space-xl);
}

.filter-label {
    font-weight: 600;
    color: var(--text-secondary);
    margin-right: var(--space-xs);
}

.category-filter {
    padding: var(--space-sm) var(--space-lg);
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-full);
    background: var(--white);
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-size: var(--text-sm);
}

.category-filter:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.category-filter.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
}

[data-theme="dark"] .category-filter {
    background: var(--bg-secondary);
    border-color: var(--gray-600);
    color: var(--text-secondary);
}

[data-theme="dark"] .category-filter:hover {
    border-color: #3b82f6;
    color: #60a5fa;
}

[data-theme="dark"] .category-filter.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: var(--white);
}

.docs-carousel-wrapper {
    position: relative;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 60px; /* Espace pour les flèches */
}

.docs-carousel-container {
    overflow: hidden;
    position: relative;
}

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

.docs-carousel-slide {
    flex: 0 0 calc(25% - (var(--space-lg) * 3 / 4)); /* 4 cartes sur desktop */
    min-width: 0; /* Pour éviter le débordement */
}

/* Cartes plus compactes */
.carousel-doc-card {
    transition: all 0.3s;
    text-align: center;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: var(--space-lg);
}

.carousel-doc-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.carousel-doc-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin: 0 auto 1rem;
    background: var(--primary);
    color: var(--white);
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

[data-theme="dark"] .carousel-doc-icon {
    background: #3b82f6;
}

.carousel-doc-title {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.carousel-doc-description {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    flex: 1;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.carousel-doc-link {
    color: var(--primary);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-sm);
}

[data-theme="dark"] .carousel-doc-link {
    color: #60a5fa;
}

/* Flèches de navigation */
.carousel-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--white);
    border: 2px solid var(--gray-200);
    color: var(--gray-700);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.2s;
    box-shadow: var(--shadow-md);
}

.carousel-nav-btn:hover {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
    transform: translateY(-50%) scale(1.1);
}

[data-theme="dark"] .carousel-nav-btn {
    background: var(--bg-secondary);
    border-color: var(--gray-600);
    color: var(--text-primary);
}

[data-theme="dark"] .carousel-nav-btn:hover {
    background: #3b82f6;
    border-color: #3b82f6;
}

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

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

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

/* Indicateurs (dots) */
.carousel-indicators {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.carousel-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--gray-300);
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    padding: 0;
}

.carousel-indicator:hover {
    background: var(--gray-500);
    transform: scale(1.2);
}

.carousel-indicator.active {
    background: var(--primary);
    width: 30px;
    border-radius: 5px;
}

[data-theme="dark"] .carousel-indicator {
    background: var(--gray-600);
}

[data-theme="dark"] .carousel-indicator:hover {
    background: var(--gray-500);
}

[data-theme="dark"] .carousel-indicator.active {
    background: #3b82f6;
}

/* Responsive */
@media (max-width: 1200px) {
    .docs-carousel-slide {
        flex: 0 0 calc(33.333% - (var(--space-lg) * 2 / 3)); /* 3 cartes sur écrans moyens */
    }
}

@media (max-width: 900px) {
    .docs-carousel-slide {
        flex: 0 0 calc(50% - (var(--space-lg) / 2)); /* 2 cartes sur tablette */
    }

    .docs-carousel-wrapper {
        padding: 0 50px;
    }

    .carousel-nav-btn {
        width: 40px;
        height: 40px;
    }

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

@media (max-width: 600px) {
    .docs-carousel-slide {
        flex: 0 0 100%; /* 1 carte sur mobile */
    }

    .docs-carousel-wrapper {
        padding: 0 40px;
    }

    .carousel-nav-btn {
        width: 36px;
        height: 36px;
    }

    .carousel-doc-icon {
        width: 50px;
        height: 50px;
        font-size: 1.75rem;
    }

    .carousel-doc-title {
        font-size: var(--text-lg);
    }
}

/* Animation de chargement */
.docs-carousel-wrapper.loading .docs-carousel-track {
    opacity: 0.5;
}

/* Support du touch/swipe */
.docs-carousel-container {
    touch-action: pan-y;
    user-select: none;
}

.docs-carousel-track.dragging {
    transition: none;
    cursor: grabbing;
}

/* Badges produit/version */
.carousel-doc-badges {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.doc-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.doc-badge-product {
    background: var(--gray-100);
    color: var(--gray-600);
    border: 1px solid var(--gray-200);
}

[data-theme="dark"] .doc-badge-product {
    background: var(--bg-tertiary);
    color: var(--gray-400);
    border-color: var(--gray-600);
}

.doc-badge-version {
    background: var(--primary);
    color: white;
}

[data-theme="dark"] .doc-badge-version {
    background: #3b82f6;
}

.doc-badge-latest {
    padding: 0.0625rem 0.25rem;
    margin-left: 0.25rem;
    background: var(--success);
    color: white;
    font-size: 0.5rem;
    font-weight: 700;
    border-radius: 2px;
}
