.bookshelf-page {
    max-width: 1000px;
    margin: 0 auto;
}

.bookshelf-header {
    text-align: center;
}

.bookshelf-header h1 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--bs-body-color);
    margin-bottom: 0.25rem;
}

.bookshelf-subtitle {
    font-size: 0.75rem;
    color: var(--bs-secondary-color);
    margin: 0;
}

.bookshelf-filters {
    background: var(--bs-card-bg, var(--bs-body-bg));
    border: 1px solid var(--bs-border-color);
    border-radius: 6px;
    padding: 0.75rem;
}

.bookshelf-filter-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.bookshelf-filter-search {
    flex: 2;
    min-width: 180px;
}

.bookshelf-filter-select {
    flex: 1;
    min-width: 130px;
}

.bookshelf-filters .form-control-sm,
.bookshelf-filters .form-select-sm {
    font-size: 0.72rem;
    padding: 0.3rem 0.5rem;
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
    border-color: var(--bs-border-color);
}

.bookshelf-no-results {
    text-align: center;
    padding: 1rem 0 0;
    font-size: 0.78rem;
    color: var(--bs-secondary-color);
}

.bookshelf-no-results i {
    margin-right: 0.4rem;
    display: inline !important;
}

.bookshelf-badge-subject {
    background-color: rgba(111, 66, 193, 0.2) !important;
    color: #b197fc !important;
    font-size: 0.58rem !important;
    font-weight: 500 !important;
}

.bookshelf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
}

.bookshelf-card {
    background: var(--bs-card-bg, var(--bs-body-bg));
    border: 1px solid var(--bs-border-color);
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.bookshelf-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    transform: translateY(-2px);
}

.bookshelf-card-cover {
    width: 100%;
    aspect-ratio: 2/3;
    overflow: hidden;
    background: var(--bs-tertiary-bg, #1a1a2e);
    display: flex;
    align-items: center;
    justify-content: center;
}

.bookshelf-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bookshelf-cover-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    color: rgba(255, 255, 255, 0.6);
    font-size: 2.5rem;
}

.bookshelf-cover-placeholder i {
    display: block !important;
}

.bookshelf-card-body {
    padding: 0.75rem;
    flex: 1;
}

.bookshelf-card-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--bs-body-color);
    margin: 0 0 0.25rem 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bookshelf-card-author {
    font-size: 0.68rem;
    color: var(--bs-secondary-color);
    margin: 0 0 0.5rem 0;
}

.bookshelf-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.bookshelf-badge-type {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: var(--bs-secondary-color) !important;
    font-size: 0.58rem !important;
    font-weight: 500 !important;
}

.bookshelf-badge-lang {
    background-color: rgba(25, 135, 84, 0.2) !important;
    color: #75b798 !important;
    font-size: 0.58rem !important;
    font-weight: 500 !important;
}

.bookshelf-badge-chapters {
    background-color: rgba(13, 110, 253, 0.2) !important;
    color: #6ea8fe !important;
    font-size: 0.58rem !important;
    font-weight: 500 !important;
}

.bookshelf-card-actions {
    padding: 0.5rem 0.75rem 0.75rem;
    display: flex;
    gap: 0.4rem;
    flex-direction: column;
}

.bookshelf-preview-btn,
.bookshelf-amazon-btn {
    width: 100%;
    text-align: center;
    font-size: 0.68rem !important;
    white-space: nowrap;
}

.bookshelf-empty {
    color: var(--bs-secondary-color);
}

.bookshelf-empty-icon {
    font-size: 3rem;
    color: var(--bs-secondary-color);
    opacity: 0.5;
    margin-bottom: 1rem;
    display: block !important;
}

.bookshelf-pagination .page-link {
    font-size: 0.72rem;
    padding: 0.3rem 0.6rem;
    color: var(--bs-body-color);
    background-color: var(--bs-body-bg);
    border-color: var(--bs-border-color);
}

.bookshelf-pagination .page-item.active .page-link {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
    color: #fff;
}

.bookshelf-preview-limit {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(33, 37, 41, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
}

.preview-limit-content {
    text-align: center;
    color: var(--bs-body-color);
}

.preview-limit-content i {
    font-size: 2rem;
    color: var(--bs-secondary-color);
    margin-bottom: 1rem;
    display: block !important;
}

.preview-limit-content h4 {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.preview-limit-content p {
    font-size: 0.78rem;
    color: var(--bs-secondary-color);
    margin-bottom: 1rem;
}

@media (max-width: 575.98px) {
    .bookshelf-filter-row {
        flex-direction: column;
    }

    .bookshelf-filter-search,
    .bookshelf-filter-select {
        min-width: 100%;
    }

    .bookshelf-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .bookshelf-card-title {
        font-size: 0.72rem;
    }

    .bookshelf-card-author {
        font-size: 0.62rem;
    }
}

@media (min-width: 576px) and (max-width: 767.98px) {
    .bookshelf-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .bookshelf-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 992px) {
    .bookshelf-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
