.books-grid ul {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.modern-grid-item {
    display: block;
}

.book-card-grid {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

.book-card-grid:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    /* transform: translateY(-4px); */
}

/* .grid-card-top {
background: linear-gradient(135deg, #33d6b5 0%, #4ca1af 100%);
padding: 25px;
text-align: center;
position: relative;
min-height: 100px;
} */

.grid-icon-wrapper {
    width: 50px;
    height: 50px;
    background: white;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
}

.grid-icon-wrapper img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.grid-digital-tag {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #28a745;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    box-shadow: 0 2px 6px rgba(40, 167, 69, 0.4);
}

.grid-card-content {
    padding: 15px;
    flex: 1;
}

.grid-title {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 8px 0;
    line-height: 1.3;
    height: 36px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.grid-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.2s;
}

.grid-title a:hover {
    color: #4ca1af;
}

.grid-arabic {
    font-size: 12px;
    color: #666;
    margin: 0 0 10px 0;
    text-align: right;
    line-height: 1.6;
    height: 20px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.grid-info {
    margin-top: 10px;
}

.grid-info p {
    font-size: 12px;
    color: #666;
    margin: 0 0 6px 0;
    display: flex;
    align-items: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.grid-info i {
    color: #4ca1af;
    margin-right: 6px;
    font-size: 11px;
    min-width: 14px;
}

.grid-card-footer {
    padding: 12px 15px;
    border-top: 1px solid #f0f0f0;
}

.grid-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #4ca1af;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.grid-btn:hover {
    color: #4ca1af;
    gap: 10px;
}

.grid-btn i {
    font-size: 11px;
    transition: transform 0.2s;
}

.grid-btn:hover i {
    transform: translateX(3px);
}

.grid-library-logo {
    position: absolute;
    bottom: 50px;
    right: 10px;
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 6px;
    padding: 5px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.grid-library-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Highlight style */
.book-card-grid span[style*="background-color: yellow"] {
    background-color: #fff3cd !important;
    padding: 1px 3px;
    border-radius: 2px;
}

@media (max-width: 1200px) {
    .books-grid ul {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .books-grid ul {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 15px;
    }

    .grid-card-top {
        padding: 20px;
        min-height: 90px;
    }

    .grid-icon-wrapper {
        width: 45px;
        height: 45px;
    }

    .grid-icon-wrapper img {
        width: 25px;
        height: 25px;
    }
}

@media (max-width: 576px) {
    .books-grid ul {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 12px;
    }

    .grid-card-content {
        padding: 12px;
    }

    .grid-title {
        font-size: 13px;
        height: 34px;
    }

    .grid-info p {
        font-size: 11px;
    }

    .grid-library-logo {
        width: 35px;
        height: 35px;
        bottom: 45px;
    }
}
