/* =====================================================
   search.css — Page de recherche avancée
   ===================================================== */

/* ── Page wrapper ── */
.search-page {
    min-height: 80vh;
    padding-bottom: 4rem;
}

/* ── En-tête ── */
.search-header {
    background: var(--color-surface, #fff);
    border-bottom: 1px solid var(--color-border, #e5e7eb);
    padding: 1.25rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.search-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.search-header__title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--color-primary, #0A1628);
    margin: 0 0 .2rem;
}

.search-header__count {
    font-size: .88rem;
    color: var(--color-text-light, #666);
    margin: 0;
}

.filter-count {
    color: var(--color-primary, #0A1628);
    font-weight: 600;
}

/* Bouton filtre mobile */
.search-filter-toggle {
    display: none;
    align-items: center;
    gap: .4rem;
    position: relative;
}

.filter-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--color-primary, #0A1628);
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
}

/* ── Layout principal ── */
.search-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 1.5rem;
    padding-top: 1.5rem;
    align-items: start;
}

/* ── Sidebar filtres ── */
.search-sidebar {
    background: var(--color-surface, #fff);
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 16px;
    padding: 1.25rem;
    position: sticky;
    top: 80px;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: .75rem;
    border-bottom: 1px solid var(--color-border, #e5e7eb);
}

.sidebar-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    color: var(--color-heading, #1a1a1a);
}

.sidebar-reset {
    font-size: .78rem;
    color: var(--color-danger, #e74c3c);
    text-decoration: none;
    font-weight: 600;
}
.sidebar-reset:hover { text-decoration: underline; }

/* ── Groupes de filtres ── */
.filter-group {
    margin-bottom: 1.1rem;
}

.filter-label {
    display: block;
    font-size: .82rem;
    font-weight: 600;
    color: var(--color-text, #333);
    margin-bottom: .4rem;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.filter-hint {
    display: block;
    font-size: .72rem;
    color: #999;
    margin-top: .25rem;
}

/* Input recherche avec bouton */
.search-input-wrap {
    position: relative;
}

.search-input-wrap .nournikah-input {
    padding-right: 2.5rem;
    width: 100%;
}

.search-input-btn {
    position: absolute;
    right: .6rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-primary, #0A1628);
    padding: 0;
    display: flex;
    align-items: center;
}

/* Âge */
.age-range {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.age-range .nournikah-input {
    flex: 1;
    min-width: 0;
}

.age-sep {
    color: #999;
    font-weight: 600;
    flex-shrink: 0;
}

/* Radios */
.filter-radios {
    display: flex;
    flex-direction: column;
    gap: .4rem;
}

.radio-item {
    display: flex;
    align-items: center;
    gap: .5rem;
    cursor: pointer;
    font-size: .85rem;
    color: var(--color-text, #333);
}

.radio-item input[type="radio"] {
    accent-color: var(--color-primary, #0A1628);
    width: 15px;
    height: 15px;
    cursor: pointer;
}

/* Cases à cocher */
.filter-checks {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.check-item {
    display: flex;
    align-items: center;
    gap: .5rem;
    cursor: pointer;
    font-size: .85rem;
    color: var(--color-text, #333);
}

.check-item input[type="checkbox"] {
    accent-color: var(--color-primary, #0A1628);
    width: 15px;
    height: 15px;
    cursor: pointer;
}

/* ── Barre de tri ── */
.results-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
}

.sort-bar {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.sort-label {
    font-size: .82rem;
    color: #666;
    white-space: nowrap;
}

.nournikah-select--sm {
    padding: .35rem .7rem;
    font-size: .82rem;
}

/* ── Grille de résultats ── */
.search-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.25rem;
}

/* ── Carte résultat ── */
.search-card {
    background: var(--color-surface, #fff);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,.07);
    transition: transform .2s ease, box-shadow .2s ease;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--color-border, #e5e7eb);
}

.search-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 24px rgba(0,0,0,.11);
}

/* Photo */
.search-card__photo-link {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    background: var(--nournikah-avatar-bg, #0A1628);
    text-decoration: none;
    font-size: 5rem;
    font-weight: 800;
    color: #fff;
    font-family: Georgia, serif;
    line-height: 1;
    letter-spacing: -0.02em;
}

/* Masquer tout ce que WordPress pourrait injecter comme avatar */
.search-card__photo-link img,
.search-card__photo-link .avatar {
    display: none !important;
}

.search-card__photo,
.search-card__photo--blurred {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s ease;
}

.search-card:hover .search-card__photo {
    transform: scale(1.04);
}

.search-card__photo--blurred {
    filter: blur(8px) brightness(.85);
}

.search-card__photo-wrap {
    position: relative;
    width: 100%;
    height: 100%;
}

.photo-lock {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.8rem;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,.4));
}

.search-card__photo-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    background: linear-gradient(135deg, #e8f5e9, #f1f8e9);
}

/* Badges photo */
.photo-badge {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    padding: .25rem .7rem;
    border-radius: 50px;
    font-size: .72rem;
    font-weight: 700;
    white-space: nowrap;
}

.photo-badge--match   { background: #D4AF37; color: #0A1628; }
.photo-badge--premium {
    bottom: auto;
    top: 8px;
    left: auto;
    right: 8px;
    transform: none;
    background: rgba(0,0,0,.55);
    font-size: .85rem;
}

/* Corps carte */
.search-card__body {
    padding: .9rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    gap: .45rem;
    flex: 1;
}

.search-card__top {
    display: flex;
    align-items: baseline;
    gap: .3rem;
}

.search-card__name {
    font-size: .95rem;
    font-weight: 700;
    margin: 0;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-card__name a {
    color: inherit;
    text-decoration: none;
}

.search-card__name a:hover { color: var(--color-primary, #0A1628); }

.search-card__age { font-weight: 400; color: #666; }

.verified-badge {
    flex-shrink: 0;
    color: var(--color-primary, #0A1628);
    font-size: .85rem;
    font-weight: 700;
}

.search-card__location {
    font-size: .78rem;
    color: #777;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Tags islamiques */
.search-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem;
}

.tag {
    display: inline-block;
    padding: .2rem .55rem;
    border-radius: 50px;
    font-size: .7rem;
    font-weight: 600;
}

.tag--green { background: #E8EEF5; color: #0A1628; }
.tag--gold  { background: #fef9e7; color: #7d6608; }
.tag--gray  { background: #f0f0f0; color: #555; }
.tag--blue  { background: #e8f4fd; color: #1a5276; }

/* Actions carte */
.search-card__actions {
    display: flex;
    gap: .4rem;
    margin-top: auto;
    flex-wrap: wrap;
}

.btn--sent {
    background: #e8f5e9;
    color: var(--color-primary, #0A1628);
    border-color: transparent;
    cursor: default;
}

/* ── État vide ── */
.search-empty {
    text-align: center;
    padding: 5rem 1rem;
    color: #888;
}

.search-empty .empty-icon { font-size: 3.5rem; margin-bottom: 1rem; }
.search-empty h3 { font-size: 1.2rem; color: #444; margin-bottom: .5rem; }
.search-empty p  { margin-bottom: 1.5rem; font-size: .92rem; line-height: 1.6; }

/* ── Pagination ── */
.search-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.pagination-btn {
    padding: .5rem 1rem;
    border-radius: 8px;
    background: var(--color-surface, #fff);
    border: 1px solid var(--color-border, #e5e7eb);
    color: var(--color-primary, #0A1628);
    font-weight: 600;
    font-size: .85rem;
    text-decoration: none;
    transition: all .18s ease;
}
.pagination-btn:hover { background: var(--color-primary, #0A1628); color: #fff; }

.pagination-pages {
    display: flex;
    align-items: center;
    gap: .3rem;
}

.pagination-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--color-border, #e5e7eb);
    font-size: .85rem;
    font-weight: 600;
    color: #555;
    text-decoration: none;
    transition: all .18s ease;
}

.pagination-num:hover                    { border-color: var(--color-primary, #0A1628); color: var(--color-primary, #0A1628); }
.pagination-num--active                  { background: var(--color-primary, #0A1628); color: #fff; border-color: var(--color-primary, #0A1628); }
.pagination-dots                         { font-size: .85rem; color: #999; padding: 0 .2rem; }

/* ── Responsive ── */
@media (max-width: 900px) {
    .search-layout {
        grid-template-columns: 1fr;
    }

    .search-sidebar {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1000;
        border-radius: 0;
        overflow-y: auto;
        padding: 1.5rem;
    }

    .search-sidebar--open {
        display: block;
    }

    .search-filter-toggle {
        display: inline-flex;
    }

    .search-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 1rem;
    }

    .search-card__body {
        padding: .7rem .8rem .9rem;
    }
}

@media (max-width: 480px) {
    .search-grid {
        grid-template-columns: 1fr 1fr;
        gap: .75rem;
    }
}
