/* =========================================================
   PERSONAL LIBRARY
   Dashboard Styles
   ========================================================= */


/* =========================================================
   1. STATISTICS
   ========================================================= */

.stats-grid {

    display: grid;

    grid-template-columns: repeat(3, minmax(0, 1fr));

    gap: 18px;

    margin-bottom: 38px;

}


.stat-card {

    min-height: 120px;

    padding: 22px;

    background-color: var(--white);

    border: 1px solid var(--border-color);

    border-radius: var(--radius-md);

    box-shadow: var(--shadow-sm);

    display: flex;

    align-items: center;

    gap: 17px;

}


.stat-icon {

    width: 52px;

    height: 52px;

    flex: 0 0 52px;

    display: flex;

    align-items: center;

    justify-content: center;

    background-color: var(--gray-100);

    border-radius: 11px;

    color: var(--black);

    font-size: 23px;

}


.stat-label {

    margin: 0 0 6px;

    color: var(--gray-500);

    font-size: 13px;

    font-weight: 500;

}


.stat-value {

    margin: 0;

    color: var(--black);

    font-size: 29px;

    font-weight: 700;

    line-height: 1;

}


/* =========================================================
   2. BOOK SECTION ACTIONS
   ========================================================= */

.books-section-actions {

    display: flex;

    align-items: center;

    gap: 10px;

    flex-shrink: 0;

}


.books-sort-control {

    display: flex;

    align-items: center;

    gap: 8px;

}


.books-sort-label {

    margin: 0;

    color: var(--gray-500);

    font-size: 12px;

    font-weight: 600;

    white-space: nowrap;

}


.books-sort-select {

    width: auto;

    min-width: 165px;

    min-height: 38px;

    padding: 7px 34px 7px 11px;

    color: var(--black);

    background-color: var(--white);

    border: 1px solid var(--border-color);

    border-radius: var(--radius-sm);

    font-size: 12px;

    font-weight: 500;

    box-shadow: none;

}


.books-sort-select:focus {

    color: var(--black);

    background-color: var(--white);

    border-color: var(--gray-500);

    box-shadow: none;

}


/* =========================================================
   3. BOOK GRID
   ========================================================= */

.books-grid {

    display: grid;

    grid-template-columns: repeat(4, minmax(0, 1fr));

    gap: 20px;

}


/* =========================================================
   4. BOOK CARD
   ========================================================= */

.book-card {

    overflow: hidden;

    background-color: var(--white);

    border: 1px solid var(--border-color);

    border-radius: var(--radius-md);

    box-shadow: var(--shadow-sm);

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease;

}


.book-card:hover {

    transform: translateY(-3px);

    border-color: #cccccc;

    box-shadow: var(--shadow-md);

}


/* =========================================================
   BOOK COVER
   ========================================================= */

.book-cover {

    width: 100%;

    aspect-ratio: 3 / 4;

    overflow: hidden;

    background-color: var(--gray-100);

}


.book-cover-placeholder {

    width: 100%;

    height: 100%;

    display: flex;

    align-items: center;

    justify-content: center;

    background-color: var(--gray-200);

    color: var(--gray-500);

    font-size: 42px;

}


/* Actual cover image */

.book-cover img {

    width: 100%;

    height: 100%;

    display: block;

    object-fit: cover;

}


/* =========================================================
   5. BOOK INFORMATION
   ========================================================= */

.book-card-body {

    padding: 18px;

}


.book-title {

    margin: 0 0 7px;

    min-height: 48px;

    color: var(--black);

    font-size: 16px;

    font-weight: 700;

    line-height: 1.5;

    display: -webkit-box;

    -webkit-box-orient: vertical;

    -webkit-line-clamp: 2;

    overflow: hidden;

}


.book-author {

    margin: 0 0 14px;

    color: var(--gray-500);

    font-size: 13px;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;

}


.book-meta {

    padding-top: 12px;

    border-top: 1px solid var(--border-color);

    color: var(--gray-500);

    font-size: 12px;

}


.book-meta span {

    display: inline-flex;

    align-items: center;

    gap: 6px;

}


.book-meta i {

    font-size: 14px;

}


/* =========================================================
   6. RESPONSIVE — TABLET
   ========================================================= */

@media (max-width: 1200px) {

    .books-grid {

        grid-template-columns:
            repeat(3, minmax(0, 1fr));

    }

}


/* =========================================================
   7. RESPONSIVE — SMALL TABLET
   ========================================================= */

@media (max-width: 992px) {

    .stats-grid {

        grid-template-columns:
            repeat(2, minmax(0, 1fr));

    }


    .books-grid {

        grid-template-columns:
            repeat(3, minmax(0, 1fr));

    }


    .books-section-actions {

        gap: 8px;

    }


    .books-sort-label {

        display: none;

    }


    .books-sort-select {

        min-width: 145px;

    }

}


/* =========================================================
   8. RESPONSIVE — MOBILE
   ========================================================= */

@media (max-width: 768px) {

    .stats-grid {

        grid-template-columns: 1fr;

        gap: 12px;

        margin-bottom: 30px;

    }


    .stat-card {

        min-height: 100px;

        padding: 18px;

    }


    .stat-icon {

        width: 50px;

        height: 50px;

        flex-basis: 50px;

        font-size: 22px;

    }


    .stat-label {

        font-size: 13px;

    }


    .stat-value {

        font-size: 28px;

    }


    .books-section-actions {

        width: 100%;

        justify-content: flex-end;

    }


    .books-sort-control {

        flex: 1;

    }


    .books-sort-select {

        width: 100%;

        min-width: 0;

    }


    .books-grid {

        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 14px;

    }


    .book-card-body {

        padding: 14px;

    }


    .book-title {

        min-height: 42px;

        font-size: 14px;

    }


    .book-author {

        font-size: 12px;

    }


    .book-meta {

        font-size: 11px;

    }


    .book-meta i {

        font-size: 13px;

    }

}


/* =========================================================
   9. RESPONSIVE — SMALL MOBILE
   ========================================================= */

@media (max-width: 480px) {

    .books-section-actions {

        flex-wrap: wrap;

        justify-content: stretch;

    }


    .books-sort-control {

        width: 100%;

        flex: none;

    }


    .books-section-actions > .btn {

        width: 100%;

    }


    .books-grid {

        grid-template-columns: 1fr 1fr;

        gap: 10px;

    }


    .book-card-body {

        padding: 12px;

    }


    .book-title {

        min-height: 39px;

        font-size: 13px;

    }


    .book-author {

        font-size: 11px;

    }


    .book-meta {

        font-size: 10px;

    }


    .book-meta i {

        font-size: 12px;

    }

}