/**
 * Books library page styles
 * Maintains the futuristic glassmorphic design with search and filter functionality
 */

/* Books main layout */
.books-main {
    min-height: 100vh;
    position: relative;
    padding-top: 6rem;
    padding-bottom: 2rem;
}

.books-bg {
    position: absolute;
    inset: 0;
}

.books-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.2;
}

.books-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), rgba(17, 24, 39, 0.8));
}

.books-container {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header section */
.books-header {
    text-align: center;
    margin-bottom: 3rem;
}

.header-content {
    max-width: 600px;
    margin: 0 auto;
}

.books-title {
    font-size: 3.5rem;
    font-weight: 700;
    background: linear-gradient(to right, #22d3ee, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
}

.books-subtitle {
    font-size: 1.25rem;
    color: #9ca3af;
    margin-bottom: 2rem;
}

/* Search section */
.search-section {
    position: relative;
    margin-bottom: 3rem;
}

.search-border {
    position: absolute;
    inset: -1px;
    background: linear-gradient(to right, #0891b2, #3b82f6);
    border-radius: 1rem;
    filter: blur(1px);
    opacity: 0.2;
}

.search-card {
    position: relative;
    background: rgba(17, 24, 39, 0.8);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(34, 211, 238, 0.3);
    border-radius: 0.75rem;
    padding: 2rem;
}

.search-container {
    margin-bottom: 1.5rem;
}

.search-input-container {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(34, 211, 238, 0.5);
    border-radius: 0.75rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

.search-input-container:focus-within {
    border-color: #22d3ee;
    box-shadow: 0 0 0 1px #22d3ee;
}

.search-icon {
    position: absolute;
    left: 1rem;
    width: 1.25rem;
    height: 1.25rem;
    color: #22d3ee;
    z-index: 1;
}

.search-input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 1rem 1rem 1rem 3rem;
    color: #f3f4f6;
    font-size: 1rem;
    outline: none;
}

.search-input::placeholder {
    color: #6b7280;
}

.search-button {
    background: #22d3ee;
    color: #000000;
    border: none;
    padding: 1rem 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-button:hover {
    background: #06b6d4;
}

.search-button i {
    width: 1.25rem;
    height: 1.25rem;
}

/* Filters */
.filters-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #d1d5db;
    margin-bottom: 0.5rem;
}

.filter-select {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(34, 211, 238, 0.5);
    border-radius: 0.5rem;
    padding: 0.75rem;
    color: #f3f4f6;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-select:focus {
    outline: none;
    border-color: #22d3ee;
    box-shadow: 0 0 0 1px #22d3ee;
}

.filter-select option {
    background: #111827;
    color: #f3f4f6;
}

.filter-reset-btn {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    color: #ef4444;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    height: fit-content;
}

.filter-reset-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
}

.filter-reset-btn i {
    width: 1rem;
    height: 1rem;
}

/* Results section */
.results-section {
    margin-bottom: 3rem;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.results-title {
    font-size: 2rem;
    font-weight: 700;
    color: #ffffff;
}

.results-count {
    color: #9ca3af;
    font-size: 0.875rem;
}

/* Loading state */
.loading-state {
    text-align: center;
    padding: 3rem;
    color: #9ca3af;
}

.loading-spinner {
    width: 3rem;
    height: 3rem;
    border: 3px solid rgba(34, 211, 238, 0.3);
    border-top: 3px solid #22d3ee;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Books grid */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
}

.book-card {
    background: rgba(17, 24, 39, 0.6);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(34, 211, 238, 0.3);
    border-radius: 0.75rem;
    padding: 1rem;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.book-card:hover {
    border-color: #22d3ee;
    box-shadow: 0 0 30px rgba(34, 211, 238, 0.2);
    transform: translateY(-5px);
}

.book-cover {
    width: 100%;
    height: 280px;
    object-fit: cover;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.book-info {
    text-align: center;
}

.book-title {
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 0.5rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-author {
    font-size: 0.875rem;
    color: #9ca3af;
    margin-bottom: 0.75rem;
}

.book-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.75rem;
}

.book-rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: #22d3ee;
}

.book-rating i {
    width: 0.875rem;
    height: 0.875rem;
}

.book-genre {
    background: rgba(34, 211, 238, 0.1);
    color: #22d3ee;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
}

.book-actions {
    display: flex;
    gap: 0.5rem;
}

.book-action-btn {
    flex: 1;
    background: rgba(34, 211, 238, 0.1);
    border: 1px solid rgba(34, 211, 238, 0.3);
    border-radius: 0.5rem;
    padding: 0.5rem;
    color: #22d3ee;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    font-size: 0.875rem;
}

.book-action-btn:hover {
    background: rgba(34, 211, 238, 0.2);
    border-color: #22d3ee;
}

.book-action-btn.primary {
    background: #22d3ee;
    color: #000000;
}

.book-action-btn.primary:hover {
    background: #06b6d4;
}

.book-action-btn i {
    width: 1rem;
    height: 1rem;
}

/* No results state */
.no-results {
    text-align: center;
    padding: 3rem;
    color: #9ca3af;
}

.no-results-icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1rem;
    color: #6b7280;
}

.no-results-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 0.5rem;
}

.no-results-text {
    font-size: 1rem;
}

/* Pagination */
.pagination-section {
    margin-top: 3rem;
}

.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(17, 24, 39, 0.6);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(34, 211, 238, 0.3);
    border-radius: 0.75rem;
    padding: 1rem 1.5rem;
}

.pagination-btn {
    background: rgba(34, 211, 238, 0.1);
    border: 1px solid rgba(34, 211, 238, 0.3);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    color: #22d3ee;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.pagination-btn:hover:not(:disabled) {
    background: rgba(34, 211, 238, 0.2);
    border-color: #22d3ee;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-btn i {
    width: 1rem;
    height: 1rem;
}

.pagination-info {
    color: #d1d5db;
    font-weight: 500;
}

/* Responsive adjustments */
@media (max-width: 767px) {
    .books-title {
        font-size: 2.5rem;
    }
    
    .books-subtitle {
        font-size: 1rem;
    }
    
    .search-card {
        padding: 1.5rem;
    }
    
    .filters-container {
        grid-template-columns: 1fr;
    }
    
    .results-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .results-title {
        font-size: 1.5rem;
    }
    
    .books-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 1rem;
    }
    
    .pagination-container {
        flex-direction: column;
        gap: 1rem;
    }
}

@media (max-width: 575px) {
    .books-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .book-cover {
        height: 200px;
    }
    
    .search-input-container {
        flex-direction: column;
    }
    
    .search-input {
        padding: 1rem;
        text-align: center;
    }
    
    .search-icon {
        position: static;
        margin: 0 auto 0.5rem;
    }
    
    .search-button {
        width: 100%;
        border-radius: 0;
    }
}