﻿/* Book Card 3D Effect */
.book-card {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 1.5rem;
    padding: 1.5rem;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.320, 1);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transform-style: preserve-3d;
}

    .book-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%, rgba(255,255,255,0.05) 100%);
        pointer-events: none;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .book-card:hover::before {
        opacity: 1;
    }

    .book-card:hover {
        transform: translateY(-10px) rotateX(5deg) rotateY(-5deg) scale(1.02);
        background: rgba(255, 255, 255, 0.12);
        border-color: rgba(255, 255, 255, 0.25);
        box-shadow: 0 40px 80px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1);
    }

.book-cover {
    position: relative;
    border-radius: 1rem;
    overflow: hidden;
    transition: all 0.4s ease;
}

    .book-cover::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(135deg, transparent 0%, rgba(0,0,0,0.3) 100%);
        opacity: 0;
        transition: opacity 0.3s ease;
    }

.book-card:hover .book-cover::after {
    opacity: 1;
}


/* Filter Buttons */
.filter-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
    padding: 0.75rem 1.5rem;
    border-radius: 2rem;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    backdrop-filter: blur(20px);
    position: relative;
    overflow: hidden;
}

    .filter-btn.active {
        background: var(--primary-gradient);
        border-color: transparent;
        color: white;
        box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
    }

    .filter-btn:hover {
        background: rgba(255, 255, 255, 0.15);
        border-color: rgba(255, 255, 255, 0.3);
        color: white;
        transform: translateY(-2px);
    }

/* Search Input */
.search-input {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 2rem;
    padding: 1rem 1.5rem 1rem 3rem;
    color: white;
    font-size: 1rem;
    width: 100%;
    backdrop-filter: blur(20px);
    transition: all 0.3s ease;
}

    .search-input::placeholder {
        color: rgba(255, 255, 255, 0.5);
    }

    .search-input:focus {
        outline: none;
        border-color: rgba(102, 126, 234, 0.6);
        background: rgba(255, 255, 255, 0.15);
        box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    }

/* Rating Stars */
.rating-stars {
    display: flex;
    gap: 0.125rem;
    align-items: center;
}

.star {
    font-size: 1rem;
    color: #fbbf24;
    transition: all 0.3s ease;
}

    .star.empty {
        color: rgba(255, 255, 255, 0.3);
    }

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Pagination */
.pagination-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    backdrop-filter: blur(20px);
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .pagination-btn.active {
        background: var(--primary-gradient);
        border-color: transparent;
        box-shadow: 0 8px 16px rgba(102, 126, 234, 0.3);
    }

    .pagination-btn:hover:not(.active) {
        background: rgba(255, 255, 255, 0.15);
        border-color: rgba(255, 255, 255, 0.3);
        transform: translateY(-1px);
    }

    .pagination-btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

/* Sort Dropdown */
.sort-dropdown {
    position: relative;
}

.sort-dropdown-content {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--glass-heavy);
    backdrop-filter: blur(40px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 1rem;
    padding: 0.5rem;
    min-width: 200px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.sort-dropdown.active .sort-dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.sort-option {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: white;
}

    .sort-option:hover {
        background: rgba(255, 255, 255, 0.1);
    }

    .sort-option.active {
        background: var(--primary-gradient);
    }

/* View Toggle */
.view-toggle {
    display: flex;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    padding: 0.25rem;
    backdrop-filter: blur(20px);
}

.view-toggle-btn {
    padding: 0.5rem 1rem;
    border-radius: 0.75rem;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

    .view-toggle-btn.active {
        background: var(--primary-gradient);
        color: white;
        box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
    }

/* Responsive Grid */
.books-grid {
    display: grid;
    gap: 2rem;
    transition: all 0.3s ease;
}

    .books-grid.grid-view {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }

    .books-grid.list-view {
        grid-template-columns: 1fr;
    }

        .books-grid.list-view .book-card {
            display: flex;
            align-items: center;
            gap: 2rem;
            padding: 2rem;
        }

        .books-grid.list-view .book-cover {
            width: 120px;
            height: 160px;
            flex-shrink: 0;
        }

        .books-grid.list-view .book-info {
            flex: 1;
        }

/* Advanced Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-gradient);
    border-radius: 10px;
}

    ::-webkit-scrollbar-thumb:hover {
        background: var(--secondary-gradient);
    }

/* Responsive Design */
@media (max-width: 768px) {
    .books-grid.grid-view {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 1.5rem;
    }

    .books-grid.list-view .book-card {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .books-grid.list-view .book-cover {
        width: 100px;
        height: 140px;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-in {
    animation: slideIn 0.4s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Price Display */
.price {
    background: var(--primary-gradient);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 1rem;
    font-weight: 700;
    font-size: 0.9rem;
    display: inline-block;
}

/* Badge */
.badge {
    background: var(--secondary-gradient);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
}

    .badge.new {
        background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    }

    .badge.bestseller {
        background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    }

    .badge.featured {
        background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    }
