body {
        background-image: url('/static/back.jpg');
        background-size: cover;
        background-position: center;
        color: #E0DFCA;
        font-family: 'Roboto', sans-serif;
        display: flex;
        flex-direction: column;
        justify-content: center;
        min-height: 100vh;
        margin: 0;
    }
    
    body::before {
        content: "";
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: url('/static/back.jpg') no-repeat center center;
        background-size: cover;
        z-index: -1;
    }
    
    html, body {
        overflow: auto; 
        -ms-overflow-style: none; 
        scrollbar-width: none; 
    }
    
    .heading {
        font-size: 2.5rem;
        font-weight: bold;
        text-align: center;
        color: #f5f5f5;
        margin-bottom: 20px;
        opacity: 1;
        transition: opacity 0.5s ease-in-out;
    }
    
    .scrolled .heading {
        opacity: 0;
    }
    
    .book-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 15px;
    }
    
    @media (max-width: 576px) {
        .book-grid {
            grid-template-columns: 1fr;
            gap: 10px;
        }
    }
    
    .book-card {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 100%;
        max-width: 280px;
        height: 375px;           
        padding: 20px;
        padding-bottom: 7px;   
        background: #1E1E1E;
        color: #FFFFFF;
        border-radius: 12px;
        box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
        transition: transform 0.2s ease-in-out, box-shadow 0.3s ease-in-out;
        border: 1px solid rgba(255, 255, 255, 0.1);
        text-align: center;
        position: relative;
    }
    
    .book-card:hover {
        transform: translateY(-1px);
        box-shadow: 0px 6px 12px rgba(60, 52, 52, 0.3);
    }
    
    .book-card h5 {
        font-size: 1.1rem;
        font-weight: 600;
        margin-bottom: 15px;
        margin-top: 5px;
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    .book-card p {
        font-size: 0.9rem;
        color: #CCCCCC;
        margin: 4px 0;
        flex-grow: 1;
    }
    
    .book-card .content {
        margin-bottom: 16px;
    }
    
    .book-card form.info-form {
        margin-bottom: 8px;
    }
    
    /* remove individual auto‑margin on reserve button */
    .book-card .reserve-btn {
        margin: 0;
    }
    
    @media (max-width: 600px) {
        .book-card {
            margin: 20px auto;
            text-align: center;
        }
        .parent-container {
            display: flex;
            flex-direction: column;
            align-items: center;
        }
    }

    .hidden {
        display: none !important;
    }
    
    .book-card.show {
        opacity: 1;
        transform: scale(1);
        height: auto;
        margin: 15px;
        transition: opacity 0.3s ease, height 0.3s ease, margin 0.3s ease;
    }
    
    /* ↓ pin buttons block to bottom ↓ */
    .button-group {
        margin: 0;
        margin-top: auto;       
    }
    .button-group button {
        width: 100%; 
        max-width: 250px;
    }
    
    .button-group button + button {
        margin-top: 8px;
    }
    
    .book-info-btn {
        background-color: #0056acd8;
        color: white;
        padding: 10px 16px;
        border-radius: 6px;
        border: none;
        transition: background-color 0.2s ease-in-out;
        font-size: 0.9rem;
    }
    .book-info-btn:hover {
        background-color: #004793d7;
    }
    .reserve-btn {
        background-color: #0070e7c3;
        color: white;
        padding: 10px 16px;
        border-radius: 6px;
        border: none;
        transition: background-color 0.3s ease-in-out;
        font-size: 0.9rem;
    }
    .reserve-btn:hover {
        background-color: #0061c9c2;
    }

    .navbar a {
        color: #000000;
        text-decoration: none;
        font-size: 16px;
        padding: 8px 16px;
        background-color: rgba(0, 0, 139, 0.6);
        border-radius: 6px;
        transition: background-color 0.3s, transform 0.3s;
    }
    .navbar a:hover {
        background-color: rgba(0, 0, 139, 0.8);
        transform: scale(1.05);
    }
    
    .modal-body {
        color: black;
    }
    .modal-title {
        color: #000 !important;
    }
    
    #search-box {
        width: 100%;
        max-width: 800px;
        padding: 12px 16px;
        font-size: 18px;
        background: rgba(255, 255, 255, 0.1);
        color: #ffffff;
        border: 1px solid rgba(255, 255, 255, 0.3);
        border-radius: 12px;
        backdrop-filter: blur(10px);
        transition: all 0.3s ease-in-out;
        outline: none;
        display: block;
        margin: 0 auto;
    }
    #search-box::placeholder {
        color: rgba(255, 255, 255, 0.6);
    }
    #search-box:focus {
        border-color: rgba(0, 123, 255, 0.6);
        box-shadow: 0px 6px 12px rgba(0, 123, 255, 0.4);
        background: rgba(255, 255, 255, 0.15);
    }
    @media (max-width: 768px) {
        #search-box {
            max-width: 90%;
            font-size: 16px;
        }
    }
    
    .back-btn {
        position: absolute;
        font-weight: 600;
        top: 20px;
        left: 25px;
        background-color: rgba(0, 0, 145, 0.7);
        color: #ffffff;
        padding: 10px 16px;
        border-radius: 6px;
        text-decoration: none;
        transition: background-color 0.3s, transform 0.3s;
    }
    .back-btn:hover {
        background-color: rgba(0, 0, 145, 0.8);
        transform: scale(1.05);
    }
    
    .floating-scrollbar {
        position: fixed;
        right: 50px;
        top: 50%;
        transform: translateY(-50%);
        width: 16px;
        height: 85vh;
        background: rgba(179, 179, 179, 0.563);
        border-radius: 12px;
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
        z-index: 9999;
        overflow: hidden;
    }
    .floating-thumb {
        width: 100%;
        overflow-y: auto;
        height: 100%;
        background: rgba(0, 0, 139, 0.6);
        border-radius: 12px;
        position: absolute;
        top: 0;
        cursor: grab;
        transition: background 0.3s ease-in-out;
    }
    .floating-thumb:hover {
        background: rgba(0, 0, 139, 0.8);
    }
    @media (max-width: 768px) {
        .floating-scrollbar {
            display: none;
        }
    }
    
    .contributed {
        position: relative;
    }
    .star-badge {
        font-size: 1.4rem;
        color: gold;
        position: absolute;
        bottom: 95x;
        right: 50%;
        transform: translateX(50%);
        cursor: pointer;
        transition: transform 0.2s ease-in-out, color 0.2s ease-in-out;
    }
    .star-badge:hover {
        transform: translateX(50%) scale(1.2);
        color: #ffd700;
    }
    .star-badge::after {
        content: "Contributed by " attr(data-contributor);
        position: absolute;
        bottom: 120%;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(0, 0, 0, 0.8);
        color: #fff;
        padding: 6px 10px;
        font-size: 0.85rem;
        white-space: nowrap;
        border-radius: 6px;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out;
    }
    .star-badge:hover::after {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(-3px);
    }

    .container h2 {
        margin-top: 60px;
    }
    
    .popup-message {
        background-color: #f9f9f9;
        border-radius: 4px;
        font-size: 14px;
    }
    #pagination[style*="display: none"] {
        display: none !important;
    }
    .btn-custom {
        display: inline-block;
        padding: 10px 16px;
        background-color: rgba(0, 0, 145, 0.7);
        border-radius: 6px;
        color: #ffffff;
        text-align: center;
        font-size: 16px;
        text-decoration: none;
        transition: background-color 0.3s, transform 0.3s;
        border: none;
        cursor: pointer;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    }

    .btn-custom:hover {
        background-color: rgba(0, 0, 145, 0.8);
        transform: scale(1.05);
        color: #ffffff;
        text-decoration: none;
    }
    .nav-buttons {
        display: flex;
        justify-content: space-between;
        position: absolute;
        top: 15px;
        left: 0;
        right: 0;
        padding: 0 20px;
    }

.search-header {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    z-index: 10;
    padding: 10px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1); /* Optional for visibility */
}

.book-grid {
    margin-top: 150px; /* Adjust based on height of .search-header */
}
