/**
 * Search Results Styles
 * Horizontal card layout with 3 columns: Image, Info, Availability + Detail
 * Updated: 2026-01-14
 */

/* ==========================================
   LAYOUT & SPACING
   ========================================== */

/* Search page background - add top spacing after header */
.search-page-bg {
    padding-bottom: 2rem;
    margin-top: 1.5rem; /* Add gap between header and content */
}

/* Container for filter and results - reduce internal spacing since we added margin-top */
.flex.flex-col.lg\:flex-row.gap-6 {
    padding-top: 0;
}

/* Container for search results */
.biblioResult {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ==========================================
   FILTER SIDEBAR STYLES
   ========================================== */
.search-filter-sidebar {
    position: sticky !important;
    /* Account for fixed header: topbar (36px) + header (~100px) + spacing = ~172px */
    top: 172px !important;
    /* Consistent shadow with book cards */
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06) !important;
    margin-bottom: 1.5rem;
}

.search-filter-sidebar .filter-content {
    /* Adjust max-height to account for header and footer space */
    max-height: calc(100vh - 220px);
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 0.25rem;
    margin-right: -0.5rem; /* Push scrollbar to edge */
    padding-left: 0;
}

/* Adjust for desktop with more space */
@media (min-width: 1024px) {
    .search-filter-sidebar {
        top: 180px;
    }
    
    .search-filter-sidebar .filter-content {
        max-height: calc(100vh - 240px);
    }
}

/* Custom scrollbar for filter */
.search-filter-sidebar .filter-content::-webkit-scrollbar {
    width: 6px;
}

.search-filter-sidebar .filter-content::-webkit-scrollbar-track {
    background: #f9fafb;
    border-radius: 6px;
}

.search-filter-sidebar .filter-content::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 6px;
}

.search-filter-sidebar .filter-content::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Style the filter form from SLiMS */
.search-filter-sidebar #search-filter {
    font-size: 0.875rem;
}

/* Bootstrap-compatible list-group styles */
.search-filter-sidebar .list-group {
    display: flex;
    flex-direction: column;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 0;
}

.search-filter-sidebar .list-group-flush {
    border-radius: 0;
}

.search-filter-sidebar .list-group-item {
    position: relative;
    display: block;
    padding: 1rem 0;
    border: none;
    border-bottom: 1px solid #e5e7eb;
    background: transparent;
}

.search-filter-sidebar .list-group-item:first-child {
    padding-top: 0.25rem;
}

.search-filter-sidebar .list-group-item:last-child {
    border-bottom: none;
    padding-bottom: 0.25rem;
}

/* Filter section header - collapsible toggle */
.search-filter-sidebar .list-group-item .d-flex,
.search-filter-sidebar .list-group-item [data-toggle="collapse"] {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 0.625rem 0.75rem;
    margin: -0.625rem -0.75rem 0.625rem -0.75rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s, box-shadow 0.2s;
}

.search-filter-sidebar .list-group-item .d-flex:hover,
.search-filter-sidebar .list-group-item [data-toggle="collapse"]:hover {
    background-color: #f9fafb;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.search-filter-sidebar .list-group-item strong,
.search-filter-sidebar .list-group-item .text-sm {
    font-size: 0.875rem;
    color: #1f2937;
    font-weight: 600;
    letter-spacing: -0.01em;
}

/* Dropdown toggle arrow */
.search-filter-sidebar .dropdown-toggle {
    cursor: pointer;
    transition: transform 0.2s;
    font-style: normal;
    color: #6b7280;
    font-size: 0.625rem;
}

.search-filter-sidebar .dropdown-toggle::after,
.search-filter-sidebar i.dropdown-toggle::before {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 0.5rem;
    vertical-align: middle;
    border-top: 0.35em solid;
    border-right: 0.35em solid transparent;
    border-bottom: 0;
    border-left: 0.35em solid transparent;
    color: #6b7280;
    transition: transform 0.2s ease;
}

.search-filter-sidebar [aria-expanded="true"] .dropdown-toggle::after,
.search-filter-sidebar [aria-expanded="true"] i.dropdown-toggle::before {
    transform: rotate(0deg);
}

.search-filter-sidebar [aria-expanded="false"] .dropdown-toggle::after,
.search-filter-sidebar [aria-expanded="false"] i.dropdown-toggle::before {
    transform: rotate(-90deg);
}

/* Collapse content */
.search-filter-sidebar .collapse {
    display: none;
    transition: all 0.3s ease;
}

.search-filter-sidebar .collapse.show {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-filter-sidebar .collapse .mt-2 {
    margin-top: 0.5rem;
}

/* Publication Year Row - flex layout fix */
.search-filter-sidebar .row {
    display: flex;
    flex-wrap: wrap;
    margin-left: -0.25rem;
    margin-right: -0.25rem;
    align-items: center;
}

.search-filter-sidebar .row .flex-1 {
    flex: 1;
    min-width: 0;
    padding-left: 0.25rem;
    padding-right: 0.25rem;
}

.search-filter-sidebar .row .px-3 {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    display: flex;
    align-items: center;
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 500;
}

.search-filter-sidebar .mb-4 {
    margin-bottom: 1rem;
}

/* Helper for inputs in range filters */
.search-filter-sidebar .js-input-from,
.search-filter-sidebar .js-input-to {
    text-align: center;
    font-weight: 500;
}

/* Form controls - inputs */
.search-filter-sidebar .form-control {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 400;
    line-height: 1.5;
    color: #374151;
    background-color: #ffffff;
    background-clip: padding-box;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.search-filter-sidebar .form-control:focus {
    color: #374151;
    background-color: #ffffff;
    border-color: #7c3aed;
    outline: 0;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.search-filter-sidebar .form-control::placeholder {
    color: #9ca3af;
}

/* Checkbox and Radio styles */
.search-filter-sidebar .form-check {
    display: flex;
    align-items: flex-start;
    padding: 0.5rem 0;
    margin: 0;
    min-height: 1.75rem;
}

.search-filter-sidebar .form-check-input {
    width: 1.125rem;
    height: 1.125rem;
    margin-top: 0.125rem;
    margin-right: 0.625rem;
    flex-shrink: 0;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-color: #ffffff;
    border: 1.5px solid #d1d5db;
    border-radius: 0.25rem;
    transition: all 0.15s ease-in-out;
}

.search-filter-sidebar .form-check-input[type="radio"] {
    border-radius: 50%;
}

.search-filter-sidebar .form-check-input:hover {
    border-color: #7c3aed;
}

.search-filter-sidebar .form-check-input:focus {
    border-color: #7c3aed;
    outline: 0;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

.search-filter-sidebar .form-check-input:checked {
    background-color: #7c3aed;
    border-color: #7c3aed;
}

.search-filter-sidebar .form-check-input:checked[type="checkbox"] {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10l3 3l6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 0.75rem;
}

.search-filter-sidebar .form-check-input:checked[type="radio"] {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='2' fill='%23fff'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: center;
}

.search-filter-sidebar .form-check-label {
    font-size: 0.8125rem;
    color: #4b5563;
    cursor: pointer;
    line-height: 1.5;
    user-select: none;
}

.search-filter-sidebar .form-check-label:hover {
    color: #7c3aed;
}

/* Range slider styling */
.search-filter-sidebar .input-slider {
    width: 100%;
    display: none !important; /* Hide the raw input, ion slider will replace it */
    visibility: hidden !important;
    height: 0 !important;
    position: absolute !important;
    left: -9999px !important;
}

/* Apply Filter button */
.search-filter-sidebar .btn-primary,
.search-filter-sidebar button[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.875rem 1.5rem;
    margin-top: 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #ffffff;
    background-color: #7c3aed;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
}

.search-filter-sidebar .btn-primary:hover,
.search-filter-sidebar button[type="submit"]:hover {
    background-color: #6d28d9;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.search-filter-sidebar .btn-primary:active,
.search-filter-sidebar button[type="submit"]:active {
    background-color: #5b21b6;
    transform: scale(0.98);
}

/* See More link */
.search-filter-sidebar a[data-toggle="collapse"],
.search-filter-sidebar a[href*="seeMore"] {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: #7c3aed;
    text-decoration: none;
    font-weight: 500;
    margin-top: 0.5rem;
    padding: 0.25rem 0;
    transition: color 0.2s;
}

.search-filter-sidebar a[data-toggle="collapse"]:hover,
.search-filter-sidebar a[href*="seeMore"]:hover {
    color: #6d28d9;
    text-decoration: underline;
}

/* Ion Range Slider customization */
.search-filter-sidebar .irs {
    font-family: inherit;
}

.search-filter-sidebar .irs--flat .irs-bar {
    background-color: #7c3aed;
}

.search-filter-sidebar .irs--flat .irs-handle > i:first-child {
    background-color: #7c3aed;
}

.search-filter-sidebar .irs--flat .irs-from,
.search-filter-sidebar .irs--flat .irs-to,
.search-filter-sidebar .irs--flat .irs-single {
    background-color: #7c3aed;
}

.search-filter-sidebar .irs--flat .irs-from::before,
.search-filter-sidebar .irs--flat .irs-to::before,
.search-filter-sidebar .irs--flat .irs-single::before {
    border-top-color: #7c3aed;
}

/* Helper classes for Bootstrap compatibility */
.search-filter-sidebar .bg-transparent {
    background-color: transparent !important;
}

.search-filter-sidebar .pl-0 {
    padding-left: 0 !important;
}

.search-filter-sidebar .border-top-0 {
    border-top: 0 !important;
}

.search-filter-sidebar .justify-content-between {
    justify-content: space-between !important;
}

.search-filter-sidebar .align-items-center {
    align-items: center !important;
}

.search-filter-sidebar .cursor-pointer {
    cursor: pointer;
}

/* Responsive - Hide sidebar on mobile, show as drawer */
@media (max-width: 1023px) {
    .search-filter-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 320px;
        max-width: 85vw;
        height: 100vh;
        z-index: 1000;
        border-radius: 0;
        border-right: 1px solid #e5e7eb;
        transition: left 0.3s ease;
        overflow-y: auto;
        padding: 1.5rem;
        background-color: #ffffff;
        box-shadow: 0 0 50px rgba(0, 0, 0, 0.15);
    }
    
    .search-filter-sidebar.active {
        left: 0;
    }
    
    .search-filter-sidebar .filter-content {
        max-height: calc(100vh - 120px);
    }
    
    /* Mobile filter overlay */
    .filter-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }
    
    .filter-overlay.active {
        opacity: 1;
        visibility: visible;
    }
    
    /* Close button for mobile filter */
    .search-filter-sidebar .filter-close-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        top: 1rem;
        right: 1rem;
        width: 2rem;
        height: 2rem;
        background-color: #f3f4f6;
        border: none;
        border-radius: 50%;
        cursor: pointer;
        transition: background-color 0.2s;
        z-index: 1;
    }
    
    .search-filter-sidebar .filter-close-btn:hover {
        background-color: #e5e7eb;
    }
    
    .search-filter-sidebar .filter-close-btn svg {
        width: 1.25rem;
        height: 1.25rem;
        color: #4b5563;
    }
}

/* Mobile Filter Toggle Button */
.mobile-filter-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #7c3aed;
    background-color: #ffffff;
    border: 2px solid #7c3aed;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.mobile-filter-toggle:hover {
    background-color: #7c3aed;
    color: #ffffff;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.mobile-filter-toggle svg {
    width: 1.25rem;
    height: 1.25rem;
}

@media (max-width: 1023px) {
    .mobile-filter-toggle {
        display: inline-flex;
    }
    
    /* Adjust search results layout */
    .search-page-bg {
        padding-top: 1rem;
    }
    
    /* Hide filter sidebar by default on mobile */
    aside.lg\:w-72.flex-shrink-0 {
        display: none;
    }
    
    aside.lg\:w-72.flex-shrink-0.active {
        display: block;
    }
}

/* ==========================================
   SEARCH PAGE LAYOUT - Sidebar + Content
   ========================================== */
/* Flex container for sidebar and results */
.flex.flex-col.lg\:flex-row.gap-6 {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

@media (min-width: 1024px) {
    .flex.flex-col.lg\:flex-row.gap-6 {
        flex-direction: row;
    }
}

/* Filter sidebar container */
aside.lg\:w-72.flex-shrink-0,
aside[class*="lg:w-72"] {
    width: 100%;
    flex-shrink: 0;
}

@media (min-width: 1024px) {
    aside.lg\:w-72.flex-shrink-0,
    aside[class*="lg:w-72"] {
        width: 18rem; /* 288px = w-72 */
        max-width: 18rem;
    }
}

/* Main content area */
.flex-1.min-w-0 {
    flex: 1 1 0%;
    min-width: 0;
}

/* ==========================================
   SEARCH RESULT INFO SECTION
   ========================================== */
/* Search result info section */
.search-found-info {
    margin-bottom: 1.5rem;
    padding: 1rem 1.25rem;
    background-color: #f9fafb;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    color: #4b5563;
    border: 1px solid #e5e7eb;
}

.search-found-info-keywords {
    color: #7c3aed;
}

.search-query-time {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-bottom: 0.5rem;
}

/* XML/JSON links */
.xmlResultLink,
.jsonResultLink {
    display: inline-block;
    margin-right: 1rem;
    font-size: 0.75rem;
    color: #7c3aed;
    text-decoration: none;
}

.xmlResultLink:hover,
.jsonResultLink:hover {
    text-decoration: underline;
}

/* ==========================================
   PAGINATION STYLES - Modern Design
   ========================================== */
.biblioPaging {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem 0;
    margin-top: 1.5rem;
}

/* Hide top pagination - only show bottom */
.biblioPagingTop {
    display: none !important;
}

/* PagingList wrapper */
.biblioPaging .pagingList {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.biblioPaging a,
.biblioPaging .pagingList > b,
.biblioPaging span.pagingList b {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #4b5563;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.biblioPaging a:hover {
    background-color: #6b0375;
    border-color: #6b0375;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(107, 3, 117, 0.25);
}

/* Current page - active state */
.biblioPaging .pagingList > b,
.biblioPaging span.pagingList b {
    background-color: #7c3aed;
    color: #ffffff;
    border-color: #7c3aed;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
}

/* Next/Prev and First/Last links */
.biblioPaging a.next_link,
.biblioPaging a.prev_link,
.biblioPaging a.first_link,
.biblioPaging a.last_link {
    padding: 0.5rem 1.25rem;
    font-weight: 600;
    gap: 0.375rem;
}

.biblioPaging a.next_link:hover,
.biblioPaging a.prev_link:hover,
.biblioPaging a.first_link:hover,
.biblioPaging a.last_link:hover {
    background-color: #7c3aed;
    color: #ffffff;
}

.biblioPagingBottom {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

/* ==========================================
   BIBLIO RESULT CONTAINER - Vertical Stack
   ========================================== */
.biblioResult {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* ==========================================
   HORIZONTAL BIBLIO CARD - 3 Columns Layout
   ========================================== */
.biblio-card {
    display: grid;
    grid-template-columns: 120px 1fr auto;
    gap: 1.5rem;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1.25rem;
    transition: all 0.2s ease;
    /* Consistent shadow with filter sidebar */
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.biblio-card:hover {
    border-color: #c4b5fd;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transform: translateY(-1px);
}

/* Column 1: Book Cover Image */
.biblio-card-image {
    flex-shrink: 0;
    width: 120px;
    height: 160px;
    border-radius: 0.5rem;
    overflow: hidden;
    background-color: #f3f4f6;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
}

.biblio-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.biblio-card:hover .biblio-card-image img {
    transform: scale(1.05);
}

/* Column 2: Book Information */
.biblio-card-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    padding: 0.25rem 0;
}

.biblio-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.5;
    margin-bottom: 0.875rem;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s ease;
}

.biblio-card-title:hover {
    color: #7c3aed;
}

.biblio-card-meta {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 0.8125rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.biblio-card-meta .meta-icon {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    color: #9ca3af;
}

.biblio-card-meta span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Column 3: Availability & Actions */
.biblio-card-action {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 1rem;
    min-width: 180px;
    padding-left: 1rem;
    border-left: 1px solid #f3f4f6;
}

/* Availability Status */
.availability-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: 0.5rem;
    width: 100%;
}

.availability-status.available {
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
}

.availability-status.available svg {
    color: #16a34a;
}

.availability-status.unavailable {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
}

.availability-status.unavailable svg {
    color: #dc2626;
}

.availability-text {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.availability-label {
    font-size: 0.875rem;
    font-weight: 600;
}

.availability-status.available .availability-label {
    color: #15803d;
}

.availability-status.unavailable .availability-label {
    color: #b91c1c;
}

.availability-copies {
    font-size: 0.75rem;
    color: #6b7280;
}

/* Detail Button */
.detail-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #ffffff;
    background-color: #7c3aed;
    border: none;
    border-radius: 0.5rem;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
}

.detail-button:hover {
    background-color: #6d28d9;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.detail-button svg {
    flex-shrink: 0;
}

/* ==========================================
   RESPONSIVE STYLES
   ========================================== */

/* Tablet View */
@media (max-width: 768px) {
    .biblio-card {
        grid-template-columns: 100px 1fr;
        grid-template-rows: auto auto;
    }
    
    .biblio-card-image {
        width: 100px;
        height: 140px;
        grid-row: span 2;
    }
    
    .biblio-card-info {
        grid-column: 2;
    }
    
    .biblio-card-action {
        grid-column: 2;
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        border-left: none;
        border-top: 1px solid #f3f4f6;
        padding-left: 0;
        padding-top: 0.75rem;
        min-width: unset;
    }
    
    .availability-status {
        flex: 1;
    }
    
    .detail-button {
        width: auto;
        padding: 0.625rem 1.25rem;
    }
}

/* Mobile View */
@media (max-width: 480px) {
    .biblio-card {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .biblio-card-image {
        width: 100%;
        height: 200px;
        grid-row: auto;
    }
    
    .biblio-card-info {
        grid-column: 1;
    }
    
    .biblio-card-action {
        grid-column: 1;
        flex-direction: column;
        align-items: stretch;
    }
    
    .availability-status {
        justify-content: center;
    }
    
    .detail-button {
        width: 100%;
    }
    
    .biblioPaging {
        gap: 0.375rem;
    }
    
    .biblioPaging a,
    .biblioPaging span:not(:empty) {
        min-width: 2rem;
        height: 2rem;
        padding: 0.375rem 0.625rem;
        font-size: 0.75rem;
    }
}

/* Debug Box */
#debugBox,
details:has(summary:first-child) {
    margin-bottom: 1rem;
}

details summary {
    cursor: pointer;
    padding: 0.5rem 1rem;
    background-color: #f3f4f6;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    color: #6b7280;
}

details[open] summary {
    margin-bottom: 0.5rem;
}

/* Legacy book-card support (if needed) */
.biblioResult .book-card {
    background-color: #ffffff;
    border-radius: 0.75rem;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.biblioResult .book-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Search keyword info */
.search-keyword-info {
    cursor: help;
}

/* Empty search results */
.no-biblio-result {
    text-align: center;
    padding: 4rem 2rem;
    color: #9ca3af;
    background-color: #f9fafb;
    border-radius: 0.75rem;
    border: 2px dashed #e5e7eb;
}

.no-biblio-result h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #6b7280;
}

/* Hide default search styling from SLiMS */
.searchBox,
#searchBox {
    display: none;
}

/* Search form in header should remain visible */
header .searchBox,
header #searchBox,
nav .searchBox,
nav #searchBox {
    display: flex;
}

/* Fix for old table-based layouts */
.biblioResult table {
    display: contents;
}

.biblioResult tr {
    display: contents;
}

.biblioResult td {
    display: block;
}

/* Loading state animation */
@keyframes shimmer {
    0% {
        opacity: 0.5;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0.5;
    }
}

.loading-card {
    background-color: #e5e7eb;
    animation: shimmer 1.5s ease-in-out infinite;
}

/* Search page background */
.search-page-bg {
    background-color: #f9fafb;
    min-height: 100vh;
}

/* ==========================================
   SORT DROPDOWN STYLES
   ========================================== */
.sort-dropdown {
    min-width: 180px;
    padding-right: 2rem;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3e%3c/path%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 1.25rem;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.sort-dropdown:focus {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%237c3aed'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3e%3c/path%3e%3c/svg%3e");
}

.sort-dropdown option {
    padding: 0.5rem 1rem;
    background-color: white;
    color: #374151;
}

/* ==========================================
   NEW TAILWIND FILTER STYLES (FilterBuilder)
   ========================================== */

/* Filter section dividers */
.search-filter-sidebar .filter-section {
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 0.75rem;
    margin-bottom: 0.75rem;
}

.search-filter-sidebar .filter-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
}

/* Filter content animation */
.search-filter-sidebar .filter-content {
    transition: all 0.2s ease;
}

.search-filter-sidebar .filter-content.hidden {
    display: none;
}

/* Filter chevron rotation */
.search-filter-sidebar .filter-chevron {
    transition: transform 0.2s ease;
}

.search-filter-sidebar .filter-chevron.rotate-180 {
    transform: rotate(180deg);
}

/* Filter checkbox/radio custom styling for Tailwind classes */
.search-filter-sidebar input[type="checkbox"],
.search-filter-sidebar input[type="radio"] {
    cursor: pointer;
    accent-color: #7c3aed;
}

/* Filter "Show more" items */
.search-filter-sidebar .filter-more-item.hidden {
    display: none !important;
}

/* Filter range slider container */
.search-filter-sidebar .irs {
    font-family: inherit;
}

.search-filter-sidebar .irs--round .irs-bar {
    background-color: #7c3aed;
}

.search-filter-sidebar .irs--round .irs-handle {
    border-color: #7c3aed;
}

.search-filter-sidebar .irs--round .irs-from,
.search-filter-sidebar .irs--round .irs-to,
.search-filter-sidebar .irs--round .irs-single {
    background-color: #7c3aed;
}

.search-filter-sidebar .irs--round .irs-from::before,
.search-filter-sidebar .irs--round .irs-to::before,
.search-filter-sidebar .irs--round .irs-single::before {
    border-top-color: #7c3aed;
}

/* Hide the grid lines on range slider */
.search-filter-sidebar .irs-grid {
    display: none !important;
}

.search-filter-sidebar .irs-grid-pol,
.search-filter-sidebar .irs-grid-text {
    display: none !important;
}

/* Range filter wrapper */
.search-filter-sidebar .range-filter-wrapper {
    padding: 1.5rem 0.25rem 0.5rem 0.25rem; /* Top padding for tooltip */
    position: relative;
}

/* Hide ALL inputs inside range filter wrapper */
.search-filter-sidebar .range-filter-wrapper > input,
.search-filter-sidebar .range-filter-wrapper input.input-slider,
.search-filter-sidebar .filter-content input.input-slider {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    width: 0 !important;
    position: absolute !important;
    left: -9999px !important;
}

/* ionRangeSlider container - ensure proper display */
.search-filter-sidebar .irs {
    display: block !important;
    max-width: 100% !important;
}

.search-filter-sidebar .irs-line {
    max-width: 100% !important;
}

/* Make sure tooltips are visible */
.search-filter-sidebar .irs-from,
.search-filter-sidebar .irs-to {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Hide the middle combined tooltip */
.search-filter-sidebar .irs-single {
    display: none !important;
}

/* Ensure the slider min/max values are visible */
.search-filter-sidebar .irs--round .irs-min,
.search-filter-sidebar .irs--round .irs-max {
    color: #6b7280;
    font-size: 0.75rem;
}
