/**
 * recherche.css — Filtres avancés recherche globale
 * Task #144
 */

body { background-color: #f5f5f5; }

.search-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* ==============================
   HEADER
   ============================== */
.search-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2.5rem 2rem;
    border-radius: 15px;
    margin-bottom: 1.5rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.search-header h1 {
    margin: 0 0 0.5rem;
    font-size: 2rem;
    font-weight: bold;
}
.search-subtitle {
    margin: 0 0 1.5rem;
    opacity: 0.85;
    font-size: 1rem;
}
.main-search-bar {
    display: flex;
    gap: 0.75rem;
    background: white;
    padding: 0.4rem;
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}
.main-search-input {
    flex: 1;
    padding: 0.9rem 1.5rem;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
}
.main-search-input:focus { outline: none; }
.main-search-btn {
    padding: 0.9rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: transform 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.main-search-btn:hover { transform: scale(1.03); }

/* ==============================
   TYPE CHIPS
   ============================== */
.search-types {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.type-chip {
    padding: 0.6rem 1.2rem;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: #374151;
}
.type-chip:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.type-chip.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

/* ==============================
   FILTERS PANEL
   ============================== */
.filters-panel {
    background: white;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
}
.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    cursor: pointer;
    user-select: none;
}
.filters-title {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #374151;
}
.active-filters-count {
    background: #667eea;
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}
.btn-toggle-filters {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    font-size: 1rem;
    transition: transform 0.3s;
}
.filters-body {
    padding: 0 1.5rem 1.5rem;
    display: none;
}
.filters-body.open { display: block; }
.filters-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.filter-group {
    flex: 1;
    min-width: 200px;
}
.filter-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #4b5563;
    margin-bottom: 0.4rem;
}
.filter-label i { width: 16px; text-align: center; }
.filter-select, .filter-input {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.9rem;
    background: white;
    transition: border-color 0.2s;
}
.filter-select:focus, .filter-input:focus {
    outline: none;
    border-color: #667eea;
}

/* Cercle badges */
.circle-badges {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}
.circle-badge {
    padding: 0.4rem 0.8rem;
    border: 2px solid var(--badge-color, #e5e7eb);
    border-radius: 20px;
    background: white;
    color: var(--badge-color, #374151);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.circle-badge:hover {
    background: var(--badge-color);
    color: white;
}
.circle-badge.active {
    background: var(--badge-color);
    color: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* Actions filtres */
.filters-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.75rem;
    border-top: 1px solid #f3f4f6;
}
.btn-reset {
    padding: 0.5rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    color: #6b7280;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}
.btn-reset:hover { background: #f3f4f6; }
.btn-save-search {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 8px;
    background: #667eea;
    color: white;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
}
.btn-save-search:hover { background: #5a6fd6; }

/* ==============================
   SAVED SEARCHES
   ============================== */
.saved-searches {
    background: white;
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.saved-searches-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: #374151;
}
.btn-clear-saved {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 0.85rem;
}
.saved-searches-list {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.saved-search-chip {
    padding: 0.4rem 0.8rem;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s;
}
.saved-search-chip:hover { background: #e5e7eb; }
.saved-search-chip .remove-saved {
    color: #ef4444;
    font-size: 0.7rem;
    cursor: pointer;
    margin-left: 0.2rem;
}

/* ==============================
   BNF BANNER
   ============================== */
.bnf-isbn-banner {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border: 2px solid #93c5fd;
    border-left: 5px solid #1e40af;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.bnf-isbn-banner .bnf-banner-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    color: #1e40af;
    font-weight: bold;
    font-size: 0.9rem;
}

/* ==============================
   RESULTS
   ============================== */
.results-section {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #f3f4f6;
}
.results-count {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
}
.results-grid {
    display: grid;
    gap: 1rem;
}

/* User card */
.user-card {
    display: flex;
    gap: 1.25rem;
    padding: 1.25rem;
    background: #f9fafb;
    border-radius: 10px;
    transition: all 0.3s;
    cursor: pointer;
    border-left: 4px solid transparent;
}
.user-card:hover {
    background: #f3f4f6;
    transform: translateX(4px);
}
.user-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    flex-shrink: 0;
    overflow: hidden;
}
.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.user-info { flex: 1; min-width: 0; }
.user-name-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
    flex-wrap: wrap;
}
.user-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
}
.user-circle-badge {
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    color: white;
    font-weight: 500;
}
.user-role {
    font-weight: 500;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
}
.user-bio {
    color: #6b7280;
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: 0.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.user-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: #9ca3af;
    flex-wrap: wrap;
}
.user-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Publication card */
.publication-card {
    padding: 1.25rem;
    background: #f9fafb;
    border-radius: 10px;
    border-left: 4px solid #8b5cf6;
    transition: all 0.3s;
    cursor: pointer;
}
.publication-card:hover {
    background: #f3f4f6;
    transform: translateX(4px);
}
.pub-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.25rem;
}
.pub-author {
    color: #667eea;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}
.pub-excerpt {
    color: #6b7280;
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: 0.5rem;
}
.pub-footer {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: #9ca3af;
}

/* Manuscript card */
.manuscript-card {
    padding: 1.25rem;
    background: #f9fafb;
    border-radius: 10px;
    border-left: 4px solid #ec4899;
    transition: all 0.3s;
    cursor: pointer;
}
.manuscript-card:hover {
    background: #f3f4f6;
    transform: translateX(4px);
}

/* Event card */
.event-card {
    display: flex;
    gap: 1.25rem;
    padding: 1.25rem;
    background: #f9fafb;
    border-radius: 10px;
    border-left: 4px solid #f59e0b;
    transition: all 0.3s;
    cursor: pointer;
}
.event-card:hover {
    background: #f3f4f6;
    transform: translateX(4px);
}
.event-date-box {
    width: 64px;
    text-align: center;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    padding: 0.75rem;
    border-radius: 10px;
    flex-shrink: 0;
}
.event-day {
    font-size: 1.75rem;
    font-weight: bold;
    line-height: 1;
}
.event-month {
    font-size: 0.75rem;
    text-transform: uppercase;
}

/* ==============================
   SKELETON LOADER
   ============================== */
.skeleton-loader { display: grid; gap: 1rem; }
.skeleton-card {
    display: flex;
    gap: 1rem;
    padding: 1.25rem;
    background: #f9fafb;
    border-radius: 10px;
}
.skeleton-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    flex-shrink: 0;
}
.skeleton-lines { flex: 1; }
.skeleton-line {
    height: 14px;
    border-radius: 4px;
    background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    margin-bottom: 0.6rem;
}
.skeleton-line.w-30 { width: 30%; }
.skeleton-line.w-40 { width: 40%; }
.skeleton-line.w-50 { width: 50%; }
.skeleton-line.w-60 { width: 60%; }
.skeleton-line.w-70 { width: 70%; }
.skeleton-line.w-80 { width: 80%; }
@keyframes shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* ==============================
   LOAD MORE
   ============================== */
.load-more-container {
    text-align: center;
    margin-top: 1.5rem;
}
.btn-load-more {
    padding: 0.75rem 2rem;
    border: 2px solid #667eea;
    border-radius: 25px;
    background: white;
    color: #667eea;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-load-more:hover {
    background: #667eea;
    color: white;
}

/* ==============================
   EMPTY STATE
   ============================== */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
}
.empty-state i {
    font-size: 3.5rem;
    color: #d1d5db;
    margin-bottom: 1rem;
    display: block;
}
.empty-state h3 {
    color: #6b7280;
    margin-bottom: 0.5rem;
}
.empty-state p { color: #9ca3af; }

/* ==============================
   SUGGESTIONS
   ============================== */
.suggestions-section {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-top: 1.5rem;
}
.suggestions-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.suggestions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}
.suggestion-card {
    padding: 1rem;
    background: #f9fafb;
    border-radius: 8px;
    transition: all 0.3s;
    cursor: pointer;
}
.suggestion-card:hover {
    background: #f3f4f6;
    transform: translateY(-2px);
}

/* ==============================
   RESPONSIVE
   ============================== */
@media (max-width: 768px) {
    .search-header h1 { font-size: 1.5rem; }
    .main-search-bar {
        flex-direction: column;
        border-radius: 15px;
    }
    .main-search-input { border-radius: 10px; }
    .main-search-btn {
        border-radius: 10px;
        justify-content: center;
    }
    .search-types {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    .type-chip { white-space: nowrap; }
    .filters-row { flex-direction: column; }
    .filter-group { min-width: 100%; }
    .circle-badges {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    .user-card { flex-direction: column; }
    .event-card { flex-direction: column; }
    .suggestions-grid { grid-template-columns: 1fr; }
    .filters-actions { flex-direction: column; gap: 0.5rem; }
    .btn-save-search, .btn-reset { width: 100%; text-align: center; }
}
