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

.recherche-sidebar {
    flex: 0 0 280px;
    background: #f5f5f5;
    padding: 25px;
    border-radius: 8px;
    position: sticky;
    top: 150px;
}

.sidebar-title {
    margin: 0 0 20px 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
    padding-bottom: 15px;
    border-bottom: 2px solid #ddd;
}

.recherche-content {
    flex: 1;
    min-width: 0;
    background: white;
}

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

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

.range-values {
    font-size: 14px;
    color: #333;
    margin-bottom: 12px;
    text-align: center;
    font-weight: 600;
}

.range-slider {
    height: 6px;
    margin: 15px 5px 20px 5px;
}

/* Style pour noUiSlider */
.noUi-target {
    background: #ddd;
    border-radius: 3px;
    border: none;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
    height: 6px;
}

.noUi-connects {
    border-radius: 3px;
}

.noUi-connect {
    background: linear-gradient(to right, #94150D, #b51a11);
}

.noUi-horizontal {
    height: 6px;
}

.noUi-horizontal .noUi-handle {
    width: 18px;
    height: 18px;
    right: -9px;
    top: -6px;
}

.noUi-handle {
    border-radius: 50%;
    border: 2px solid #94150D;
    background: white;
    box-shadow: 0 1px 4px rgba(148, 21, 13, 0.3);
    cursor: grab;
    transition: all 0.2s ease;
}

.noUi-handle:before,
.noUi-handle:after {
    display: none;
}

.noUi-handle:hover {
    border-color: #b51a11;
    transform: scale(1.15);
    box-shadow: 0 2px 6px rgba(148, 21, 13, 0.4);
}

.noUi-handle:active {
    cursor: grabbing;
    transform: scale(1.05);
    box-shadow: 0 1px 3px rgba(148, 21, 13, 0.3);
}

.noUi-touch-area {
    cursor: grab;
}

.noUi-active .noUi-touch-area {
    cursor: grabbing;
}

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

.filter-group input[type="text"]:focus,
.filter-group select:focus {
    outline: none;
    border-color: #94150D;
    box-shadow: 0 0 0 3px rgba(148, 21, 13, 0.1);
}

.filter-actions {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

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

.btn-reset:hover {
    background: #94150D;
    border-color: #94150D;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(148, 21, 13, 0.3);
}

#recherche-resultats-info {
    margin-bottom: 20px;
    padding: 10px 0;
    font-weight: 600;
    color: #555;
    background: white;
    position: sticky;
    top: 150px;
    z-index: 11;
}

.recherche-options-tri {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 4px;
    display: none;
}

.recherche-options-tri.visible {
    display: flex;
}

.recherche-options-tri .tri-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.recherche-options-tri label {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin: 0;
    white-space: nowrap;
}

.recherche-options-tri select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: white;
}

.recherche-options-tri select:focus {
    outline: none;
    border-color: #94150D;
    box-shadow: 0 0 0 3px rgba(148, 21, 13, 0.1);
}

#recherche-loader {
    text-align: center;
    padding: 40px 20px;
    font-size: 14px;
    color: #666;
}

#recherche-loader p {
    margin-top: 15px;
    font-style: italic;
}

.loader-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #94150D;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

.livres-tableau thead {
    background: white;
    border-bottom: 2px solid #94150D;
    position: sticky;
    top: 200px;
    z-index: 10;
    box-shadow: 0 2px 0 0 #94150D;
}

.livres-tableau thead::before {
    content: '';
    position: absolute;
    top: -80px;
    left: -10px;
    right: -10px;
    height: 81px;
    background: white;
    z-index: 1;
}

.livres-tableau th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: #94150D;
    white-space: nowrap;
    font-size: 13px;
    border-bottom: 2px solid #94150D;
    background: white;
}

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

.livres-tableau th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: background 0.2s ease;
}

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

.livres-tableau th.sortable .sort-icons {
    display: inline-flex;
    flex-direction: column;
    margin-left: 8px;
    vertical-align: middle;
    line-height: 1;
    gap: 2px;
}

.livres-tableau th.sortable .sort-asc,
.livres-tableau th.sortable .sort-desc {
    font-size: 12px;
    color: #ccc;
    transition: color 0.2s ease;
    line-height: 1;
    cursor: pointer;
}

.livres-tableau th.sortable.active-asc .sort-asc {
    color: #94150D;
    font-weight: bold;
}

.livres-tableau th.sortable.active-desc .sort-desc {
    color: #94150D;
    font-weight: bold;
}

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

.livres-tableau th.sortable:hover .sort-asc,
.livres-tableau th.sortable:hover .sort-desc {
    color: #94150D;
    opacity: 0.5;
}

.livres-tableau tbody tr {
    border-bottom: 1px solid #e8e8e8;
    transition: background 0.15s ease;
}

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

.livres-tableau tbody tr:last-child {
    border-bottom: 1px solid #e8e8e8;
}

.livres-tableau td {
    padding: 12px 15px;
    vertical-align: middle;
    color: #444;
}

.livres-tableau .livre-image-cell {
    padding: 8px;
    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: opacity 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.livres-tableau .livre-thumbnail:hover {
    opacity: 0.85;
}

.livres-tableau .livre-no-thumbnail {
    width: 60px;
    height: 80px;
    background: #f9f9f9;
    border-radius: 2px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ddd;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512" fill="%2394150D" opacity="0.25"><path d="M542.22 32.05c-54.8 3.11-163.72 14.43-230.96 55.59-4.64 2.84-7.27 7.89-7.27 13.17v363.87c0 11.55 12.63 18.85 23.28 13.49 69.18-34.82 169.23-44.32 218.7-46.92 16.89-.89 30.02-14.43 30.02-30.66V62.75c.01-17.71-15.35-31.74-33.77-30.7zM264.73 87.64C197.5 46.48 88.58 35.17 33.78 32.05 15.36 31.01 0 45.04 0 62.75V400.6c0 16.24 13.13 29.78 30.02 30.66 49.49 2.6 149.59 12.11 218.77 46.95 10.62 5.35 23.21-1.94 23.21-13.46V100.63c0-5.29-2.62-10.14-7.27-12.99z"/></svg>');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 65%;
}

.livres-tableau .livre-titre a {
    color: #94150D;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

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

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

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

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

    .recherche-sidebar {
        flex: 1 1 auto;
        width: 100%;
        position: static;
        margin-bottom: 20px;
    }

    .recherche-content {
        width: 100%;
    }

    .recherche-options-tri {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }

    .recherche-options-tri .tri-group {
        flex-direction: column;
        align-items: stretch;
        gap: 5px;
    }

    .recherche-options-tri select {
        width: 100%;
    }

    #recherche-resultats {
        overflow-x: auto;
    }

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

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