/* Стили для плагина Books */

/* Основные стили */
.books-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 25px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
}

/* Заголовок */
.books-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 35px;
    padding-bottom: 25px;
    border-bottom: 3px solid #f1f3f4;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.books-header h1 {
    margin: 0;
    color: #1a202c;
    font-size: 36px;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.books-count {
    color: #4a5568;
    font-size: 18px;
    font-weight: 600;
    background: white;
    padding: 10px 20px;
    border-radius: 25px;
    border: 2px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Кнопки */
.books-actions {
    text-align: right;
    margin-bottom: 35px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border: none;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-read {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    font-size: 14px;
    padding: 10px 20px;
}

.btn-read:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(72, 187, 120, 0.4);
}

.btn-large {
    padding: 18px 36px;
    font-size: 18px;
}

.btn-icon {
    font-size: 16px;
}

/* Секции */
.section-icon {
    font-size: 28px;
    margin-right: 10px;
}

.books-categories,
.books-section {
    margin-bottom: 50px;
}

.books-categories h2,
.books-section h2 {
    margin-bottom: 30px;
    color: #2d3748;
    font-size: 28px;
    font-weight: 700;
    display: flex;
    align-items: center;
}

/* Сетка категорий */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.category-item {
    background: white;
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #f0f2f5;
}

.category-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 35px rgba(0,0,0,0.15);
}

.category-item.all-books {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.category-item.all-books a {
    color: white;
}

.category-item a {
    display: block;
    padding: 30px 25px;
    text-decoration: none;
    color: #2d3748;
    text-align: center;
    transition: all 0.3s ease;
}

.category-icon {
    font-size: 48px;
    margin-bottom: 15px;
    display: block;
}

.category-item h3 {
    margin: 0 0 12px 0;
    font-size: 20px;
    font-weight: 600;
}

.category-count {
    display: inline-block;
    background: rgba(0,0,0,0.08);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.category-item.all-books .category-count {
    background: rgba(255,255,255,0.25);
}

/* Сетка книг */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

/* Карточки книг */
.book-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #f0f2f5;
}

.book-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 35px rgba(0,0,0,0.15);
}

.book-cover {
    position: relative;
    height: 250px;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.book-cover-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.book-card:hover .book-cover-image {
    transform: scale(1.05);
}

.book-placeholder {
    text-align: center;
    color: #a0aec0;
}

.book-icon {
    font-size: 56px;
    margin-bottom: 12px;
    opacity: 0.7;
}

.book-no-cover {
    font-size: 16px;
    font-weight: 500;
}

.book-price, .book-free {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 8px 16px;
    border-radius: 25px;
    font-size: 13px;
    font-weight: 700;
    color: white;
    backdrop-filter: blur(10px);
    z-index: 2;
}

.book-price {
    background: rgba(56, 161, 105, 0.9);
}

.book-free {
    background: rgba(49, 130, 206, 0.9);
}

/* Информация о книге */
.book-info {
    padding: 25px;
}

.book-title {
    margin: 0 0 18px 0;
    font-size: 20px;
    line-height: 1.4;
    font-weight: 600;
}

.book-title a {
    color: #2d3748;
    text-decoration: none;
    transition: color 0.3s ease;
}

.book-title a:hover {
    color: #667eea;
}

.book-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 18px;
    color: #718096;
    font-size: 14px;
    font-weight: 500;
    flex-wrap: wrap;
    gap: 10px;
}

.book-excerpt {
    margin-bottom: 18px;
    color: #4a5568;
    line-height: 1.6;
    font-size: 15px;
}

.book-tags {
    margin-bottom: 25px;
    color: #718096;
    font-size: 14px;
    background: #f7fafc;
    padding: 10px 15px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.tags-label {
    font-weight: 600;
    color: #4a5568;
}

.book-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.book-id {
    color: #a0aec0;
    font-size: 12px;
    font-weight: 500;
}

/* Пустое состояние */
.books-empty {
    text-align: center;
    padding: 80px 20px;
    color: #718096;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.empty-icon {
    font-size: 80px;
    margin-bottom: 25px;
    opacity: 0.7;
}

.books-empty h3 {
    margin-bottom: 18px;
    color: #2d3748;
    font-size: 28px;
    font-weight: 600;
}

.books-empty p {
    margin-bottom: 35px;
    font-size: 18px;
    line-height: 1.6;
}

/* Красивая пагинация */
.books-pagination {
    text-align: center;
    margin-top: 50px;
    padding: 30px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.pagination-info {
    margin-bottom: 25px;
    color: #4a5568;
    font-size: 16px;
    font-weight: 500;
    padding: 15px;
    background: #f7fafc;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.pagination-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 25px;
}

.pagination-nav a,
.pagination-nav span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 45px;
    height: 45px;
    padding: 10px 15px;
    border: 2px solid #e2e8f0;
    text-decoration: none;
    border-radius: 12px;
    color: #4a5568;
    font-weight: 500;
    transition: all 0.3s ease;
    background: white;
}

.pagination-nav a:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.pagination-current {
    background: #667eea !important;
    color: white !important;
    border-color: #667eea !important;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    font-weight: 700;
}

.pagination-first,
.pagination-last {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%) !important;
    color: white !important;
    border-color: #48bb78 !important;
    font-weight: 600;
}

.pagination-first:hover,
.pagination-last:hover {
    background: linear-gradient(135deg, #38a169 0%, #2f855a 100%) !important;
    box-shadow: 0 6px 20px rgba(72, 187, 120, 0.4);
}

.pagination-prev,
.pagination-next {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%) !important;
    color: white !important;
    border-color: #ed8936 !important;
    font-weight: 600;
    padding: 10px 20px;
}

.pagination-prev:hover,
.pagination-next:hover {
    background: linear-gradient(135deg, #dd6b20 0%, #c05621 100%) !important;
    box-shadow: 0 6px 20px rgba(237, 137, 54, 0.4);
}

.pagination-dots {
    background: transparent !important;
    border: none !important;
    color: #a0aec0 !important;
    font-weight: 700;
    font-size: 18px;
}

.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #f7fafc !important;
    color: #a0aec0 !important;
    border-color: #e2e8f0 !important;
}

.disabled:hover {
    transform: none !important;
    background: #f7fafc !important;
    color: #a0aec0 !important;
    border-color: #e2e8f0 !important;
    box-shadow: none !important;
}

/* Быстрый переход */
.pagination-jump {
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.pagination-form {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.pagination-form label {
    color: #4a5568;
    font-weight: 500;
}

.pagination-input {
    width: 80px;
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    transition: border-color 0.3s ease;
}

.pagination-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.pagination-go {
    padding: 8px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination-go:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Адаптивность для пагинации */
@media (max-width: 768px) {
    .pagination-nav {
        gap: 4px;
    }
    
    .pagination-nav a,
    .pagination-nav span {
        min-width: 40px;
        height: 40px;
        padding: 8px 12px;
        font-size: 14px;
    }
    
    .pagination-prev,
    .pagination-next {
        padding: 8px 15px;
    }
    
    .pagination-first,
    .pagination-last {
        display: none;
    }
    
    .pagination-form {
        flex-direction: column;
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .pagination-prev span,
    .pagination-next span {
        display: none;
    }
    
    .pagination-nav a,
    .pagination-nav span {
        min-width: 35px;
        height: 35px;
        padding: 6px 10px;
        font-size: 13px;
    }
}

/* Адаптивность */
@media (max-width: 768px) {
    .books-wrapper {
        padding: 15px;
    }
    
    .books-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
        padding: 20px;
    }
    
    .books-header h1 {
        font-size: 28px;
    }
    
    .books-actions {
        text-align: left;
        width: 100%;
    }
    
    .categories-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 15px;
    }
    
    .books-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .book-meta {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
    
    .book-actions {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .btn {
        justify-content: center;
    }
    
    .pagination-nav {
        gap: 4px;
    }
    
    .pagination-nav a,
    .pagination-nav span {
        min-width: 35px;
        height: 35px;
        padding: 6px 10px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .books-header h1 {
        font-size: 24px;
    }
    
    .category-item a {
        padding: 20px 15px;
    }
    
    .category-icon {
        font-size: 36px;
    }
    
    .book-info {
        padding: 20px;
    }
}