/* Books Page Specific Styles */

/* Books Hero Section */
.books-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.books-hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    color: white;
}

.books-hero p {
    font-size: 1.2rem;
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.books-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
}

.books-stats .stat {
    text-align: center;
}

.books-stats .stat .number {
    display: block;
    font-size: 2.5rem;
    font-weight: 900;
    color: #f39c12;
}

.books-stats .stat .label {
    font-size: 1rem;
    opacity: 0.9;
}

/* Books Filters Section */
.books-filters {
    background: white;
    padding: 2rem 0;
    border-bottom: 1px solid #eee;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.filters-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
}

.filter-group select {
    padding: 0.75rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    background: white;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    cursor: pointer;
}

.filter-group select:focus {
    outline: none;
    border-color: #3498db;
}

.active-filters {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-label {
    font-weight: 600;
    color: #2c3e50;
}

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

.filter-tag {
    background: #3498db;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-tag .remove {
    cursor: pointer;
    font-weight: bold;
}

.clear-filters {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
}

.clear-filters:hover {
    background: #c0392b;
}

/* Books Grid Section */
.books-grid-section {
    padding: 3rem 0;
    background: #f8f9fa;
}

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

.books-header h2 {
    margin: 0;
    text-align: left;
}

.view-options {
    display: flex;
    gap: 0.5rem;
}

.view-toggle {
    background: white;
    border: 2px solid #e9ecef;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.view-toggle.active {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

.view-toggle:hover {
    border-color: #3498db;
}

/* Books Container */
.books-container {
    margin-bottom: 3rem;
}

.books-container.grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.books-container.list-view {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Book Card Styles */
.book-item {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.book-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.book-item.list-layout {
    display: flex;
    height: 200px;
}

.book-item.list-layout .book-cover {
    width: 150px;
    height: 200px;
    flex-shrink: 0;
}

.book-item.list-layout .book-info {
    flex: 1;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.book-cover {
    position: relative;
    height: auto;
    overflow: hidden;
}

.book-item.list-layout .book-cover {
    height: 200px;
}

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

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

.book-overlay {
    position: absolute;
    top: 1rem;
    left: 1rem;
    right: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.genre-badge {
    background: rgba(52, 152, 219, 0.9);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
}

.rating-badge {
    color: #f39c12;
    font-size: 1rem;
    background: rgba(255,255,255,0.9);
    padding: 0.25rem 0.5rem;
    border-radius: 5px;
}

.book-info {
    padding: 0.8rem;
}

.book-item.list-layout .book-info {
    padding: 1.5rem;
}

.book-title {
    font-size: 1rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.3rem;
    line-height: 1.2;
}

.book-author {
    color: #7f8c8d;
    font-style: italic;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
}

.book-description {
    color: #555;
    margin-bottom: 0.5rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.8rem;
}

.book-item.list-layout .book-description {
    -webkit-line-clamp: 2;
}

.book-meta {
    display: flex;
    gap: 0.5rem;
    font-size: 0.7rem;
    color: #7f8c8d;
    flex-wrap: wrap;
    justify-content: center;
}

.book-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.book-actions {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.5rem;
    justify-content: center;
}

.book-action-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background-color 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.book-action-btn:hover {
    background: #2980b9;
}

.book-action-btn.secondary {
    background: transparent;
    color: #3498db;
    border: 2px solid #3498db;
}

.book-action-btn.secondary:hover {
    background: #3498db;
    color: white;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
}

.pagination-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.pagination-btn:hover {
    background: #2980b9;
}

.pagination-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

.page-numbers {
    display: flex;
    gap: 0.5rem;
}

.page-number {
    background: white;
    border: 2px solid #e9ecef;
    padding: 0.75rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 40px;
    text-align: center;
}

.page-number:hover {
    border-color: #3498db;
}

.page-number.active {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

/* Browse Categories */
.browse-categories {
    padding: 4rem 0;
    background: white;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.category-card {
    background: #f8f9fa;
    padding: 2rem 1.5rem;
    border-radius: 15px;
    text-align: center;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 3px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 2px solid transparent;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: #3498db;
}

.category-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.category-card h3 {
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.category-card p {
    color: #7f8c8d;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.book-count {
    background: #3498db;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Loading States */
.loading {
    text-align: center;
    padding: 3rem;
    color: #7f8c8d;
}

.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #7f8c8d;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.empty-state p {
    margin-bottom: 2rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* Responsive Design */
@media (max-width: 768px) {
    .books-hero h1 {
        font-size: 2.5rem;
    }
    
    .filters-container {
        grid-template-columns: 1fr;
    }
    
    .books-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .books-container.grid-view {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 0.8rem;
    }
    
    .book-item.list-layout {
        flex-direction: column;
        height: auto;
    }
    
    .book-item.list-layout .book-cover {
        width: 100%;
        height: 200px;
    }
    
    .category-grid {
        grid-template-columns: 1fr;
    }
    
    .pagination {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .books-hero {
        padding: 2rem 0;
    }
    
    .books-hero h1 {
        font-size: 2rem;
    }
    
    .books-stats {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .active-filters {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .filter-tags {
        width: 100%;
    }
    
    .books-container.grid-view {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 0.6rem;
    }
    
    .book-info {
        padding: 0.6rem;
    }
    
    .book-title {
        font-size: 0.9rem;
    }
    
    .book-author {
        font-size: 0.7rem;
    }
    
    .book-description {
        font-size: 0.7rem;
    }
    
    .book-meta {
        font-size: 0.6rem;
        gap: 0.3rem;
    }
    
    .book-action-btn {
        padding: 0.3rem 0.6rem;
        font-size: 0.7rem;
    }
}
