/* Стили для страницы библиотеки */
.books-hero {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    border-radius: 1rem;
    padding: 3rem 2rem;
    margin-bottom: 2rem;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.books-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: pulse 4s ease-in-out infinite;
}

.books-hero-content {
    position: relative;
    z-index: 2;
}

.search-filters {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.book-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 0.75rem;
    overflow: visible; /* Позволяем стикерам выходить за границы */
    transition: all 0.3s ease;
    height: 100%;
    position: relative;
    margin: 10px; /* Отступ для стикеров */
}

.book-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: #2ecc71;
}

.book-cover {
    position: relative;
    aspect-ratio: 3/4;
    background: #f5f5f5;
    overflow: hidden;
    border-radius: 0.5rem 0.5rem 0 0;
}

.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #f8f9fa;
    transition: transform 0.3s ease;
}

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

.book-price-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #2ecc71;
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    z-index: 10;
    transform: rotate(2deg);
    border: 2px solid #fff;
    transition: transform 0.2s ease;
}

.book-price-badge.free {
    background: #3498db;
}

.book-card:hover .book-price-badge {
    transform: rotate(2deg) scale(1.05);
}

.book-format-badge {
    position: absolute;
    top: -8px;
    left: -8px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    z-index: 10;
    transform: rotate(-2deg);
    border: 1px solid #fff;
    transition: transform 0.2s ease;
}

.book-card:hover .book-format-badge {
    transform: rotate(-2deg) scale(1.05);
}

.book-content {
    padding: 1.5rem;
    width: 100%;
    box-sizing: border-box;
}

.book-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
}

.book-author {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    font-style: italic;
}

.book-description {
    color: #666;
    font-size: 0.85rem;
    line-height: 1.4;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    width: 100% !important;
    max-width: 100% !important;
    word-wrap: break-word;
    text-align: justify;
}

.book-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-size: 0.8rem;
    color: #666;
}

.book-rating {
    display: flex;
    align-items: center;
}

.book-rating .stars {
    color: #f39c12;
    margin-right: 0.25rem;
}

.book-downloads {
    display: flex;
    align-items: center;
}

.book-tags {
    margin-bottom: 1rem;
}

.book-tag {
    display: inline-block;
    padding: 3px 8px;
    background: #f8f9fa;
    color: #333;
    border-radius: 0.25rem;
    font-size: 0.7rem;
    margin-right: 0.5rem;
    margin-bottom: 0.25rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.book-tag:hover {
    background: #2ecc71;
    color: white;
    text-decoration: none;
}

.book-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-top: auto;
    padding: 0 0.25rem;
    width: 100%;
}

.btn-main {
    flex: 1;
    min-width: 0;
}

.btn-success.btn-add-to-cart {
    font-size: 0.72rem;
    white-space: nowrap;
}

.btn-icon {
    flex: 0 0 auto;
    width: 40px;
    padding: 0.375rem 0.5rem;
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border: none;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
    white-space: nowrap;
    font-size: 0.8rem;
}

.btn-success:hover {
    background: linear-gradient(135deg, #20c997 0%, #28a745 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.btn-success:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.category-filter {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.category-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #e0e0e0;
    background: #fff;
    color: #333;
    border-radius: 0.5rem;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.category-btn:hover,
.category-btn.active {
    background: #2ecc71;
    border-color: #2ecc71;
    color: white;
    text-decoration: none;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.no-results {
    text-align: center;
    padding: 3rem 1rem;
    color: #666;
}

.no-results i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

@keyframes pulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

@media (max-width: 768px) {
    .books-hero {
        padding: 2rem 1rem;
    }
    
    .search-filters {
        padding: 1rem;
    }
    
    .results-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn-primary, .btn-success {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
    .btn-success.btn-add-to-cart {
        font-size: 0.72rem;
        padding: 10px 10px;
    }
}
