/* ============================================
   Books Pages Styles
   ============================================ */

/* Page Header */
.level-header {
    text-align: center;
    padding: 3rem 0;
    margin-bottom: 2rem;
}

.level-badge {
    display: inline-block;
    background: var(--level-color, #2563EB);
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.level-header h1 {
    font-size: 2.5rem;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.page-subtitle {
    color: #64748b;
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Books Grid */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    padding: 1rem 0 3rem;
}

/* Book Card */
.book-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.book-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

/* Book Cover */
.book-cover {
    position: relative;
    aspect-ratio: 3/4;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 1.5rem;
}

.book-cover img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
}

.book-card:hover .book-cover img {
    transform: scale(1.03);
}

.book-level-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Book Info */
.book-info {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.book-series {
    display: inline-block;
    background: #f1f5f9;
    color: #64748b;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    width: fit-content;
}

.book-title {
    font-size: 1.25rem;
    color: #1e293b;
    margin-bottom: 0.25rem;
    font-weight: 700;
}

.book-level {
    color: #64748b;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.book-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.book-stat {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: #64748b;
    font-size: 0.85rem;
}

.stat-icon {
    font-size: 1rem;
}

/* Book Actions */
.book-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: auto;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
}

.btn-amazon {
    background: #FF9900;
    color: #111;
}

.btn-amazon:hover {
    background: #e68a00;
    transform: translateY(-2px);
}

.btn-amazon.disabled {
    background: #cbd5e1;
    color: #64748b;
    cursor: not-allowed;
}

.btn-solutions {
    background: #2563EB;
    color: white;
}

.btn-solutions:hover {
    background: #1d4ed8;
    color: white;
    transform: translateY(-2px);
}

/* Loading State */
.loading-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    color: #64748b;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e2e8f0;
    border-top-color: #2563EB;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Empty State */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    background: #f8fafc;
    border-radius: 16px;
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.empty-state h3 {
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: #64748b;
}

/* Responsive */
@media (max-width: 768px) {
    .level-header h1 {
        font-size: 2rem;
    }
    
    .books-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 1.5rem;
    }
    
    .book-info {
        padding: 1.25rem;
    }
}

@media (max-width: 480px) {
    .books-grid {
        grid-template-columns: 1fr;
    }
}
