/**
 * My Books Library - Main Styles
 * Version: 1.0.0
 */

/* ========================================
   My Books Library Container
   ======================================== */

.my-books-library {
    background: transparent;
    padding: 0;
}

.my-books-library h2 {
    margin: 0 0 30px 0;
    font-size: 28px;
    font-weight: 700;
    color: #13274b;
}

/* ========================================
   Products Grid
   ======================================== */

.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin-top: 0;
}

.product-card {
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 4px 12px rgba(19, 39, 75, 0.08);
    border: 2px solid transparent;
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 28px rgba(0, 145, 253, 0.2);
    border-color: rgba(0, 145, 253, 0.3);
}

.product-cover {
    position: relative;
    padding-top: 110%;
    overflow: hidden;
    background: linear-gradient(135deg, #13274b 0%, #0091fd 100%);
}

.product-cover img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.books-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.98);
    color: #0091fd;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.product-info {
    padding: 16px;
    text-align: center;
}

.product-title {
    margin: 0 0 6px 0;
    font-size: 16px;
    font-weight: 700;
    color: #13274b;
    line-height: 1.4;
}

.product-meta {
    margin: 0;
    font-size: 13px;
    color: #0091fd;
    font-weight: 600;
}

/* ========================================
   Hidden Class
   ======================================== */

.hidden {
    display: none !important;
}

/* ========================================
   Pagination Styles
   ======================================== */

.mbl-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: 40px;
    padding: 20px 0;
}

.pagination-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #fff;
    border: 2px solid #0091fd;
    border-radius: 8px;
    color: #0091fd;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination-btn:hover:not(:disabled) {
    background: #0091fd;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 145, 253, 0.3);
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    border-color: #ccc;
    color: #999;
}

.pagination-numbers {
    display: flex;
    gap: 8px;
    align-items: center;
}

.pagination-number {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    color: #13274b;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination-number:hover {
    border-color: #0091fd;
    color: #0091fd;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 145, 253, 0.2);
}

.pagination-number.active {
    background: linear-gradient(135deg, #0091fd 0%, #0077cc 100%);
    border-color: #0091fd;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 145, 253, 0.3);
}

/* ========================================
   Empty State Message
   ======================================== */

.no-books-message {
    background: linear-gradient(135deg, #0091fd 0%, #0077cc 100%);
    color: #ffffff;
    padding: 25px 30px;
    border-radius: 12px;
    border: none;
    box-shadow: 0 4px 15px rgba(0, 145, 253, 0.2);
    text-align: center;
    margin: 0;
}

.no-books-message p {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    color: #ffffff;
    line-height: 1.5;
}

/* ========================================
   Modal Styles
   ======================================== */

.books-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
}

.books-modal.active {
    display: block;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    position: relative;
    max-width: 1100px;
    margin: 40px auto;
    background: #fff;
    border-radius: 16px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.4s ease;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    border: none;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    border-radius: 50%;
    z-index: 10;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: rotate(90deg);
}

.modal-header {
    padding: 35px 40px 25px 40px;
    background: linear-gradient(135deg, #13274b 0%, #0091fd 100%);
    color: #fff;
    text-align: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    color: #fff;
}

.modal-header p {
    margin: 8px 0 0 0;
    font-size: 15px;
    opacity: 0.95;
}

.modal-books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    padding: 35px;
    background: #f8f9fa;
}

.book-item {
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 3px 10px rgba(19, 39, 75, 0.08);
}

.book-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 145, 253, 0.2);
}

.book-cover {
    position: relative;
    padding-top: 140%;
    overflow: hidden;
    background: linear-gradient(135deg, #13274b 0%, #0091fd 100%);
}

.book-cover img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.book-info {
    padding: 12px;
    text-align: center;
}

.book-title {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #13274b;
    line-height: 1.3;
}

/* ========================================
   Animations
   ======================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }

    .modal-content {
        margin: 20px;
        max-height: 95vh;
    }

    .modal-header {
        padding: 25px 20px 20px 20px;
    }

    .modal-header h2 {
        font-size: 22px;
    }

    .modal-books-grid {
        grid-template-columns: repeat(2, 1fr);
        padding: 20px;
        gap: 15px;
    }

    .my-books-library h2 {
        font-size: 24px;
    }

    .mbl-pagination {
        flex-wrap: wrap;
        gap: 10px;
        margin-top: 30px;
    }

    .pagination-btn {
        padding: 8px 15px;
        font-size: 13px;
    }

    .pagination-number {
        width: 35px;
        height: 35px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .modal-books-grid {
        grid-template-columns: 1fr;
    }
}
