/**
 * Library Page Styles
 *
 * Visual grid of published storybook covers with hover effects
 * that match the homepage examples section behavior.
 */

/* Library Hero Section */
.library-hero {
    padding: 80px 0 40px;
    background: linear-gradient(135deg, #FFF5F2 0%, #FFF 100%);
    text-align: center;
}

.library-header h1 {
    font-size: 48px;
    color: var(--text-dark);
    margin-bottom: 16px;
    font-weight: 700;
}

.library-header p {
    font-size: 20px;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
}

/* Library Section */
.library-section {
    padding: 60px 0 80px;
    background: var(--bg-light);
    min-height: 400px;
}

/* Library Grid - Responsive grid of book covers */
.library-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

/* Library Card - Similar to example-card on homepage */
.library-card {
    background: transparent;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    aspect-ratio: 1 / 1;
}

.library-card:hover {
    transform: translateY(-12px) rotate(-2deg);
    box-shadow: var(--shadow-lg);
}

.library-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 16px;
}

/* Empty State */
.library-empty {
    background: white;
    border-radius: 16px;
    padding: 80px 40px;
    text-align: center;
    box-shadow: var(--shadow);
    max-width: 500px;
    margin: 0 auto;
}

.library-empty .empty-icon {
    font-size: 72px;
    margin-bottom: 24px;
}

.library-empty h2 {
    font-size: 28px;
    color: var(--text-dark);
    margin-bottom: 12px;
}

.library-empty p {
    font-size: 18px;
    color: var(--text-light);
    margin-bottom: 32px;
}

/* Responsive Breakpoints */

/* 3 columns on smaller desktops */
@media (max-width: 1200px) {
    .library-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 24px;
    }
}

/* 2 columns on tablets */
@media (max-width: 900px) {
    .library-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }

    .library-header h1 {
        font-size: 36px;
    }

    .library-header p {
        font-size: 18px;
    }
}

/* 2 columns on small tablets, larger cards */
@media (max-width: 640px) {
    .library-hero {
        padding: 60px 0 30px;
    }

    .library-section {
        padding: 40px 0 60px;
    }

    .library-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .library-card {
        border-radius: 12px;
    }

    .library-cover {
        border-radius: 12px;
    }

    .library-header h1 {
        font-size: 28px;
    }

    .library-header p {
        font-size: 16px;
    }
}

/* Single column only on very small screens */
@media (max-width: 400px) {
    .library-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        max-width: 280px;
        margin: 0 auto;
    }
}

/* ============================================
   PAGINATION
   ============================================ */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 48px;
    flex-wrap: wrap;
}

/* Previous/Next buttons */
.pagination-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: white;
    border: 2px solid #E5E7EB;
    border-radius: 8px;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.pagination-btn:hover:not(.disabled) {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.pagination-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-arrow {
    font-size: 18px;
    line-height: 1;
}

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

/* Individual page number */
.pagination-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: white;
    border: 2px solid #E5E7EB;
    border-radius: 8px;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.pagination-number:hover:not(.active) {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.pagination-number.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* Ellipsis */
.pagination-ellipsis {
    color: var(--text-light);
    font-size: 18px;
    padding: 0 4px;
}

/* Responsive pagination */
@media (max-width: 640px) {
    .pagination {
        gap: 8px;
        margin-top: 32px;
    }

    .pagination-btn {
        padding: 10px 14px;
        font-size: 14px;
    }

    .pagination-text {
        display: none;
    }

    .pagination-arrow {
        font-size: 20px;
    }

    .pagination-number {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
}

@media (max-width: 400px) {
    .pagination-numbers {
        gap: 4px;
    }

    .pagination-number {
        width: 32px;
        height: 32px;
        font-size: 13px;
        border-radius: 6px;
    }
}
