/* ================================================
   Quran Library - Library Grid Styles
   Matching reference UI: book grid with covers,
   category sections, green open buttons
   ================================================ */

/* Library wrapper */
.ql-library {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px;
    direction: rtl;
}

.ql-library * {
    box-sizing: border-box;
}

/* Library header */
.ql-library-header {
    text-align: center;
    margin-bottom: 40px;
}

.ql-library-header h1 {
    font-size: 2.2em;
    color: var(--ql-text-color, #222);
    margin: 0 0 8px;
    font-weight: 700;
}

/* Category section */
.ql-category-section {
    margin-bottom: 40px;
}

.ql-category-title {
    font-size: 1.5em;
    color: var(--ql-text-color, #222);
    margin: 0 0 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--ql-accent-color, #1fa87e);
    display: inline-block;
}

/* Books grid */
.ql-books-grid {
    display: grid;
    grid-template-columns: repeat(var(--ql-columns, 4), 1fr);
    gap: 25px;
}

/* Book card */
.ql-book-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.ql-book-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Cover image */
.ql-book-cover {
    position: relative;
    width: 100%;
    padding-top: 140%;
    overflow: hidden;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.ql-book-cover img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.ql-book-card:hover .ql-book-cover img {
    transform: scale(1.03);
}

/* Book info */
.ql-book-info {
    padding: 15px;
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.ql-book-title {
    font-size: 1em;
    font-weight: 600;
    color: #333;
    margin: 0 0 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ql-book-pages {
    font-size: 0.8em;
    color: #888;
    margin-bottom: 10px;
}

/* Open button */
.ql-open-btn {
    display: inline-block;
    background: linear-gradient(135deg, #1fa87e 0%, #16a085 100%);
    color: #fff !important;
    border: none;
    padding: 8px 24px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
    text-decoration: none;
}

.ql-open-btn:hover {
    background: linear-gradient(135deg, #16a085 0%, #138d6e 100%);
    transform: scale(1.05);
    color: #fff !important;
}

/* No cover placeholder */
.ql-no-cover {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3em;
    color: #bbb;
}

/* Responsive */
@media (max-width: 1200px) {
    .ql-books-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .ql-books-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 500px) {
    .ql-books-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .ql-library {
        padding: 15px 10px;
    }

    .ql-library-header h1 {
        font-size: 1.6em;
    }
}
