/**
 * Styles pour le système de filtrage des articles (design identique au models-slider)
 * @package GrimTheme
 */

/* ================================
   CONTAINER DES FILTRES
================================ */
.blog-filters-container {
    margin-bottom: 2rem;
}

.blog-filter-container {
    width: 100%;
}

/* ================================
   STYLE BOUTONS/PILLS
================================ */
.blog-filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    padding: 1.5rem;
}

.blog-filter-buttons .filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.875rem 1.75rem;
    background: white;
    border: 2px solid;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    user-select: none;
    color: #374151;
}

.blog-filter-buttons .filter-btn i {
    font-size: 1rem;
    transition: transform 0.3s ease;
}

.blog-filter-buttons .filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    background-color: white;
}

.blog-filter-buttons .filter-btn:hover i {
    transform: scale(1.1);
}

.blog-filter-buttons .filter-btn.active {
    background: linear-gradient(135deg, var(--theme-primary, #6646ff) 0%, var(--theme-primary-dark, #5535dd) 100%);
    color: white;
    box-shadow: 0 6px 24px rgba(102, 70, 255, 0.3);
}

.blog-filter-buttons .filter-btn.active:hover {
    background: linear-gradient(135deg, var(--theme-primary, #6646ff) 0%, var(--theme-primary-dark, #5535dd) 100%);
    color: white;
}

.blog-filter-buttons .filter-btn:active {
    transform: translateY(0) scale(0.98);
}

/* ================================
   STYLE TABS (identique au models-slider)
================================ */
.blog-filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 1rem;
}

.blog-filter-tabs .filter-tab {
    padding: 1rem 2rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    position: relative;
    bottom: -2px;
    background: transparent;
    border-left: none;
    border-right: none;
    border-top: none;
}

.blog-filter-tabs .filter-tab:hover {
    color: #374151;
    background: #f9fafb;
}

.blog-filter-tabs .filter-tab.active {
    color: var(--theme-primary, #6646ff);
    border-bottom-color: var(--theme-primary, #6646ff) !important;
    background: white;
}

/* ================================
   DROPDOWN (MOBILE ET DESKTOP)
================================ */
.blog-filter-dropdown {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    justify-content: center;
    padding: 1rem;
    background: linear-gradient(135deg, #f9fafb 0%, #ffffff 100%);
    border-radius: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.blog-filter-dropdown label {
    font-size: 1rem;
    font-weight: 700;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.blog-filter-dropdown label::before {
    content: "\f0b0";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    color: var(--theme-primary, #6646ff);
    font-size: 1.125rem;
}

/* Custom Select Moderne */
.custom-select-wrapper {
    position: relative;
    min-width: 300px;
}

.custom-select {
    position: relative;
}

.custom-select-trigger {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    user-select: none;
}

.custom-select-trigger:hover {
    border-color: var(--theme-primary, #6646ff);
    box-shadow: 0 4px 16px rgba(102, 70, 255, 0.15);
    transform: translateY(-1px);
    background-color: white;
}

.custom-select.open .custom-select-trigger {
    border-color: var(--theme-primary, #6646ff);
    box-shadow: 0 0 0 4px rgba(102, 70, 255, 0.1), 0 4px 16px rgba(102, 70, 255, 0.15);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.custom-select-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    background: linear-gradient(135deg, var(--theme-primary, #6646ff) 0%, var(--theme-primary-dark, #5535dd) 100%);
    border-radius: 0.5rem;
    color: white;
    font-size: 1rem;
    flex-shrink: 0;
}

.custom-select-icon i {
    font-style: normal;
}

.custom-select-text {
    flex: 1;
    font-size: 0.875rem;
    font-weight: 600;
    color: #1f2937;
}

.custom-select-text .article-count {
    font-weight: 400;
    color: #6b7280;
    font-size: 0.8125rem;
}

.custom-select-arrow {
    display: flex;
    align-items: center;
    color: var(--theme-primary, #6646ff);
    font-size: 0.875rem;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.custom-select-arrow i {
    font-style: normal;
}

.custom-select.open .custom-select-arrow {
    transform: rotate(180deg);
}

/* Dropdown Menu */
.custom-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid var(--theme-primary, #6646ff);
    border-top: none;
    border-bottom-left-radius: 0.75rem;
    border-bottom-right-radius: 0.75rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 100;
}

.custom-select.open .custom-select-dropdown {
    max-height: 400px;
    opacity: 1;
    overflow-y: auto;
}

.custom-select-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.custom-select-option i {
    width: 1.25rem;
    height: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    font-size: 1rem;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.custom-select-option span {
    flex: 1;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    transition: color 0.2s ease;
}

.custom-select-option span .article-count {
    font-weight: 400;
    color: #9ca3af;
    font-size: 0.8125rem;
}

.custom-select-option.active span .article-count {
    color: rgba(102, 70, 255, 0.7);
}

.custom-select-option:hover {
    background: linear-gradient(90deg, rgba(102, 70, 255, 0.05) 0%, transparent 100%);
    border-left-color: var(--theme-primary, #6646ff);
}

.custom-select-option:hover i {
    color: var(--theme-primary, #6646ff);
    transform: scale(1.1);
}

.custom-select-option.active {
    background: linear-gradient(90deg, rgba(102, 70, 255, 0.1) 0%, transparent 100%);
    border-left-color: var(--theme-primary, #6646ff);
}

.custom-select-option.active i {
    color: var(--theme-primary, #6646ff);
}

.custom-select-option.active span {
    color: var(--theme-primary, #6646ff);
    font-weight: 600;
}

/* Scrollbar personnalisé pour le dropdown */
.custom-select-dropdown::-webkit-scrollbar {
    width: 6px;
}

.custom-select-dropdown::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 3px;
}

.custom-select-dropdown::-webkit-scrollbar-thumb {
    background: var(--theme-primary, #6646ff);
    border-radius: 3px;
}

.custom-select-dropdown::-webkit-scrollbar-thumb:hover {
    background: var(--theme-primary-dark, #5535dd);
}

/* ================================
   PAGINATION
================================ */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 3rem;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    padding: 0.625rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
    color: #374151;
    font-weight: 500;
    min-width: 2.75rem;
    text-align: center;
    font-size: 0.9375rem;
}

.pagination a:hover {
    background-color: #f9fafb;
    border-color: var(--theme-primary, #6646ff);
    color: var(--theme-primary, #6646ff);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 70, 255, 0.15);
}

.pagination-current {
    background: linear-gradient(135deg, var(--theme-primary, #6646ff) 0%, var(--theme-primary-dark, #5535dd) 100%);
    color: white;
    border-color: var(--theme-primary, #6646ff);
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(102, 70, 255, 0.3);
}

.pagination-prev,
.pagination-next {
    font-weight: 600;
}

/* ================================
   RESPONSIVE
================================ */
@media (max-width: 767px) {
    /* Sur mobile, forcer le dropdown */
    .blog-filter-buttons,
    .blog-filter-tabs {
        display: none;
    }

    /* Si les tabs sont affichés sur mobile (cas rare), les rendre scrollables */
    .blog-filter-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .blog-filter-tabs::-webkit-scrollbar {
        display: none;
    }

    .blog-filter-tabs .filter-tab {
        flex-shrink: 0;
        padding: 0.75rem 1.5rem;
        white-space: nowrap;
    }

    .blog-filter-dropdown {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .blog-filter-dropdown label {
        width: 100%;
        font-size: 0.9375rem;
    }

    .custom-select-wrapper {
        min-width: 100%;
        width: 100%;
    }

    .custom-select-trigger {
        padding: 0.875rem 1.25rem;
    }

    .custom-select-icon {
        width: 2rem;
        height: 2rem;
        font-size: 0.9375rem;
    }

    .custom-select-text {
        font-size: 0.8125rem;
    }

    .custom-select-option {
        padding: 0.75rem 1.25rem;
    }

    .custom-select-option span {
        font-size: 0.8125rem;
    }
}

@media (min-width: 768px) {
    /* Sur desktop, afficher le style choisi */
    .blog-filters-container[data-desktop-style="buttons"] .blog-filter-dropdown {
        display: none;
    }

    .blog-filters-container[data-desktop-style="tabs"] .blog-filter-dropdown {
        display: none;
    }

    .blog-filters-container[data-desktop-style="dropdown"] .blog-filter-buttons,
    .blog-filters-container[data-desktop-style="dropdown"] .blog-filter-tabs {
        display: none;
    }
}

/* ================================
   VARIABLES CSS
================================ */
:root {
    --theme-primary: #6646ff;
    --theme-primary-dark: #5535dd;
}
