/* ===================== */
/* TikSwipe User Filters  */
/* ===================== */

/* Structure principale */
.tikswipe-user-filters-wrapper {
    max-width: 820px;
    margin: 38px auto 90px auto;
    padding: 32px 36px 28px 36px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 2px 18px #0002;
    position: relative;
    overflow: visible;
}

/* === WRAPPER grille lettres + filtres === */
.tikswipe-filters-alphabet-wrap {
    display: flex;
    flex-direction: column;
    gap: 18px;
    align-items: stretch;
    margin-bottom: 22px;
}
@media (min-width: 701px) {
    .tikswipe-filters-alphabet-wrap {
        flex-direction: column;
        gap: 18px;
        align-items: stretch;
        margin-bottom: 22px;
    }
}
@media (max-width: 900px) {
    .tikswipe-filters-alphabet-wrap {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
        margin-bottom: 16px;
    }
}

/* === Alphabet horizontal (desktop) ou wrap (mobile) === */
.tikswipe-filter-alphabet {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px 5px;
    justify-content: flex-start;
    user-select: none;
    margin-bottom: 10px;
    width: 100%;
}
@media (max-width: 900px) {
    .tikswipe-filter-alphabet {
        justify-content: center;
    }
}
.tikswipe-filter-letter {
    border: none;
    background: #f4f4f8;
    border: 1px solid #e1e1e1;
    font-size: 17px;
    padding: 2px 11px;
    color: #888;
    cursor: pointer;
    border-radius: 4px;
    transition: background .12s, color .12s, border .12s;
    min-width: 30px;
    text-align: center;
    margin-bottom: 0;
}
.tikswipe-filter-letter.active,
.tikswipe-filter-letter:focus {
    background: #2a2545;
    color: #fff;
    border-color: #2a2545;
    font-weight: 600;
    z-index: 2;
}
.tikswipe-filter-letter:hover:not(.active) {
    background: #eceffe;
    color: #1a3874;
}

/* === Recherche === */
.tikswipe-filter-search {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
    gap: 7px;
}
.tikswipe-filter-search-input {
    flex: 1 1 0;
    border: 1px solid #ececec;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 1em;
    transition: border .14s;
}
.tikswipe-filter-search-input:focus {
    outline: none;
    border-color: #bbd4fc;
}
.tikswipe-filter-clear {
    background: none;
    border: none;
    color: #cc2b2b;
    font-size: 1.15em;
    cursor: pointer;
    border-radius: 50%;
    width: 32px; height: 32px;
    transition: background .14s;
    display: flex; align-items: center; justify-content: center;
}
.tikswipe-filter-clear:hover {
    background: #ffeaea;
}

/* === Liste des groupes de filtres === */
.tikswipe-filters-list {
    display: block;
    max-height: 420px;
    overflow-y: auto;
    min-height: 120px;
    background: none;
    padding-right: 2px;
}

/* Groupe de filtres par lettre */
.tikswipe-filter-group {
    margin-bottom: 28px;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}
.tikswipe-filter-group:last-child {
    border-bottom: none;
}
.tikswipe-filter-group-title {
    font-weight: 700;
    font-size: 1.13em;
    letter-spacing: .02em;
    color: #3b3a66;
    background: #f4f4fb;
    border-radius: 6px 6px 0 0;
    padding: 7px 12px 3px 0;
    margin-bottom: 6px;
}

/* Liste interne : grille 3 colonnes desktop, 1 colonne mobile */
.tikswipe-filter-group-items {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px 18px;
}
@media (max-width: 700px) {
    .tikswipe-filter-group-items {
        grid-template-columns: 1fr;
        gap: 8px 0;
    }
}
.tikswipe-filter-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.03em;
    padding: 6px 9px 6px 4px;
    border-radius: 7px;
    cursor: pointer;
    background: #f7f7fc;
    transition: background .13s, border .12s;
    border: 1.2px solid transparent;
    min-width: 0;
}
.tikswipe-filter-item.selected {
    background: #c6dbf7;
    border-color: #aacff7;
}
.tikswipe-filter-item:hover:not(.selected) {
    background: #e7eaff;
}
.tikswipe-filter-item input[type="checkbox"] {
    accent-color: #2a2545;
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
    margin: 0 7px 0 2px;
    cursor: pointer;
    flex-shrink: 0;
    transition: box-shadow .13s;
}
.tikswipe-filter-name {
    flex: 1 1 0;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 1em;
    color: #222;
}

/* === Actions boutons (Reset, Save) === */
.tikswipe-filter-actions {
    display: flex;
    justify-content: flex-end;
    gap: 11px;
    margin-top: 14px;
}
.tikswipe-filter-actions button {
    font-size: 1.07em;
    border-radius: 7px;
    border: none;
    padding: 8px 23px;
    cursor: pointer;
    background: #e7e7e7;
    color: #242424;
    font-weight: 500;
    transition: background .15s, color .15s;
}
.tikswipe-filter-actions button.tikswipe-filters-save,
.tikswipe-filter-actions button.button-primary {
    background: #2a2545;
    color: #fff;
}
.tikswipe-filter-actions button:hover {
    background: #d8d8d8;
}
.tikswipe-filter-actions .tikswipe-filters-save:hover,
.tikswipe-filter-actions .button-primary:hover {
    background: #1e68ff;
    color: #fff;
}

/* === Scrollbar discret pour listes longues === */
.tikswipe-user-filters-wrapper * {
    scrollbar-width: thin;
    scrollbar-color: #e6e7e8 #f6f8fb;
}
.tikswipe-user-filters-wrapper ::-webkit-scrollbar {
    height: 5px; width: 6px; background: #f7f9fb;
}
.tikswipe-user-filters-wrapper ::-webkit-scrollbar-thumb {
    background: #e2e4e8; border-radius: 9px;
}

/* Responsive ajustements finaux */
@media (max-width: 600px) {
    .tikswipe-user-filters-wrapper {
        padding: 11px 2vw 11px 2vw;
        max-width: 98vw;
    }
    .tikswipe-filter-actions button { font-size: 0.99em; padding: 7px 9vw; }
    .tikswipe-filters-list { max-height: unset; }
    .tikswipe-filter-group-items { gap: 8px 0; }
}

/* ========== TikSwipe User Filters – Affichage dynamique, Animations, Message "Aucun résultat" ========== */
.tikswipe-no-results {
    text-align: center;
    color: #999;
    font-size: 1.06em;
    font-style: italic;
    margin: 30px 0 10px 0;
    opacity: 0.85;
    transition: opacity .2s;
}

/* Animation fade/slide pour filtres */
.tikswipe-filter-item {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.19s, transform 0.18s;
    will-change: opacity, transform;
}
.tikswipe-filter-item.hide {
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translateY(12px);
    transition: opacity 0.18s, transform 0.20s;
}

@media (min-width: 900px) {
  /* Wrapper principal pour la page de filtres */
  body.page-id-317 { /* Remplace XX par l'ID WordPress de ta page de filtres ! */
    min-height: 100vh;
    /* Centrage vertical + horizontal */
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Corrige le wrapper du module filtre */
  .tikswipe-user-filters-wrapper {
    min-height: 600px;              /* Hauteur minimum visuelle */
    max-height: calc(100vh - 250px);/* Ajuste le 120px selon header+footer */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    width: 100%;
    max-width: 820px;
    margin: 0 auto;
    box-sizing: border-box;
    /* Garde le background, border-radius etc. */
  }
  .tikswipe-filters-list {
    flex: 1 1 auto;
    min-height: 0;
    max-height: 100%;
    overflow-y: auto;
  }
}

/* =========================
   Préférences filtres (switches & tooltips)
   ========================= */
.tikswipe-pref-modes {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    gap: 32px;
    justify-content: flex-end;
    margin-bottom: 22px;
    margin-top: 6px;
}
@media (max-width: 700px) {
    .tikswipe-pref-modes {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
        margin-bottom: 17px;
    }
}
.tikswipe-pref-choice {
    display: flex;
    align-items: center;
    gap: 11px;
    font-size: 1.08em;
    line-height: 1.18;
    position: relative;
}
.tikswipe-pref-choice label {
    cursor: pointer;
    font-weight: 400;
    color: #252525;
}
.tikswipe-pref-switch {
    appearance: none;
    -webkit-appearance: none;
    width: 24px; height: 24px;
    border: 2px solid #b3b8ca;
    border-radius: 50%;
    outline: none;
    margin: 0;
    cursor: pointer;
    transition: border-color .14s;
    background: #fff;
    position: relative;
}
.tikswipe-pref-switch:checked {
    border-color: #2152ed;
    background: #fff;
}
.tikswipe-pref-switch:checked::after {
    content: '';
    display: block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #2152ed;
    position: absolute;
    top: 5px; left: 5px;
    box-shadow: 0 0 1px #fff;
    transition: background .2s;
}
.tikswipe-pref-switch:not(:checked):hover {
    border-color: #7e9bce;
}

/* Info-bulle sur le "i" */
.tikswipe-pref-tooltip {
    display: inline-block;
    margin-left: 5px;
    color: #6b6e89;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.03em;
    transition: color .13s;
    vertical-align: middle;
    position: relative;
}
.tikswipe-pref-tooltip:hover {
    color: #2152ed;
}
.tikswipe-tooltip-bubble {
    position: absolute;
    z-index: 99;
    background: #fff;
    color: #222;
    border: 1px solid #e0e0ea;
    box-shadow: 0 3px 16px #0002;
    padding: 8px 13px;
    border-radius: 6px;
    font-size: 0.98em;
    line-height: 1.24;
    max-width: 250px;
    pointer-events: none;
    left: 120%;
    top: 50%;
    transform: translateY(-50%);
    white-space: normal;
}

/* Responsive : ajustement info-bulle */
@media (max-width: 700px) {
    .tikswipe-tooltip-bubble { left: 0; top: 130%; transform: none; }
}

/* Option : centre mieux l’ensemble en desktop */
.tikswipe-user-filters-wrapper {
    max-width: 680px;
    min-width: 0;
}

.tikswipe-pref-tooltip {
    background: none;
    border: none;
    color: #4266a7;
    font-size: 1em;
    cursor: pointer;
    margin-left: 5px;
    padding: 0 3px;
    vertical-align: middle;
    outline: none;
}
.tikswipe-pref-tooltip:focus { color: #163869; }

.tikswipe-tooltip-pop {
    background: #222;
    color: #fff;
    font-size: 0.97em;
    padding: 7px 16px;
    border-radius: 7px;
    box-shadow: 0 3px 16px #0002;
    opacity: 0;
    pointer-events: none;
    transition: opacity .12s;
    max-width: 250px;
    word-break: break-word;
}
.tikswipe-tooltip-pop.visible { opacity: 1; pointer-events: auto; }

/* --- Ajustements spécifiques pour la page Filtres --- */