/* Recherche Catalogue Livres - Styles */
#recherche-catalogue-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

/* Sidebar */
.recherche-sidebar {
    width: 280px;
    min-width: 280px;
    background: #f5f5f5;
    padding: 20px;
    border-radius: 8px;
    position: sticky;
    top: 150px;
}

.recherche-sidebar .sidebar-title {
    margin: 0 0 20px 0;
    font-size: 18px;
    color: #333;
}

/* Content principal */
.recherche-content {
    flex: 1;
    min-width: 0;
    overflow-x: auto;
}

.filter-group {
    margin-bottom: 15px;
}

.filter-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #333;
    font-size: 13px;
}

.filter-group input[type="text"],
.filter-group select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.filter-group input[type="text"]:focus,
.filter-group select:focus {
    outline: none;
    border-color: #94150D;
}

/* Range values display */
.range-values {
    text-align: center;
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
}

/* noUiSlider customization */
#slider-annee-edition {
    margin: 10px 5px;
}

.noUi-connect {
    background: #94150D !important;
}

.noUi-handle {
    border-color: #94150D !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2) !important;
}

.noUi-handle:before,
.noUi-handle:after {
    background: #94150D !important;
}

/* Filter actions */
.filter-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn-reset {
    width: 100%;
    padding: 10px 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    background: white;
    color: #666;
}

.btn-reset:hover {
    background: #f5f5f5;
    border-color: #999;
    color: #333;
}

/* Options de tri (hidden) */
.recherche-options-tri {
    display: none;
}

/* Loader */
#recherche-loader {
    text-align: center;
    padding: 40px 20px;
    font-size: 14px;
    color: #999;
    font-style: italic;
}

.loader-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #ddd;
    border-top-color: #94150D;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Tableau des livres */
.livres-tableau {
    width: 100%;
    border-collapse: collapse;
    background: white;
    margin-bottom: 30px;
    font-size: 14px;
}

.livres-tableau thead {
    background: #f5f5f5;
    border-bottom: 2px solid #94150D;
}

.livres-tableau th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    position: relative;
}

.livres-tableau th.col-image {
    width: 80px;
}

/* Sortable columns */
.livres-tableau th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.livres-tableau th.sortable:hover {
    background: #e8e8e8;
}

.livres-tableau th.sortable .sort-icons {
    display: inline-block;
    margin-left: 5px;
    font-size: 10px;
    vertical-align: middle;
    opacity: 0.3;
}

.livres-tableau th.sortable .sort-icons .sort-asc,
.livres-tableau th.sortable .sort-icons .sort-desc {
    display: inline;
}

/* Active sort states */
.livres-tableau th.sortable.active-asc .sort-icons .sort-asc {
    color: #94150D;
    opacity: 1;
}

.livres-tableau th.sortable.active-asc .sort-icons .sort-desc {
    opacity: 0.2;
}

.livres-tableau th.sortable.active-asc .sort-icons {
    opacity: 1;
}

.livres-tableau th.sortable.active-desc .sort-icons .sort-desc {
    color: #94150D;
    opacity: 1;
}

.livres-tableau th.sortable.active-desc .sort-icons .sort-asc {
    opacity: 0.2;
}

.livres-tableau th.sortable.active-desc .sort-icons {
    opacity: 1;
}

.livres-tableau th.sortable.active-asc,
.livres-tableau th.sortable.active-desc {
    background: #fdf0ef;
}

/* Table body */
.livres-tableau tbody tr {
    border-bottom: 1px solid #e0e0e0;
    transition: background 0.2s;
}

.livres-tableau tbody tr:hover {
    background: #f9f9f9;
}

.livres-tableau td {
    padding: 10px 15px;
    vertical-align: middle;
}

/* Image cell */
.livres-tableau .livre-image-cell {
    padding: 5px;
    text-align: center;
    width: 80px;
}

.livres-tableau .livre-thumbnail {
    width: 60px;
    height: 80px;
    object-fit: cover;
    border-radius: 2px;
    display: block;
    margin: 0 auto;
    transition: transform 0.2s;
}

.livres-tableau .livre-thumbnail:hover {
    transform: scale(1.05);
}

.livres-tableau .livre-no-thumbnail {
    width: 60px;
    height: 80px;
    background: #f0f0f0;
    border-radius: 2px;
    margin: 0 auto;
}

/* Cote column */
.livres-tableau .livre-cote {
    font-family: 'Courier New', Courier, monospace;
    font-weight: 600;
    color: #94150D;
    white-space: nowrap;
    font-size: 12px;
}

/* Title column */
.livres-tableau .livre-titre a {
    color: #94150D;
    text-decoration: none;
    font-weight: 500;
}

.livres-tableau .livre-titre a:hover {
    text-decoration: underline;
}

.livres-tableau .livre-titre em {
    font-style: italic;
}

/* No results */
.aucun-resultat {
    text-align: center;
    padding: 60px 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

.aucun-resultat p {
    font-size: 18px;
    color: #666;
}

/* Responsive */
@media (max-width: 968px) {
    #recherche-catalogue-wrapper {
        flex-direction: column;
    }

    .recherche-sidebar {
        width: 100%;
        min-width: auto;
        position: static;
    }

    .recherche-content {
        overflow-x: auto;
    }

    .livres-tableau {
        font-size: 12px;
        min-width: 700px;
    }

    .livres-tableau th,
    .livres-tableau td {
        padding: 8px 10px;
    }

    .livres-tableau thead {
        position: static;
    }

    .livres-tableau thead::before {
        display: none;
    }
}
