:root {
    --primary-color: #2e7d32;
    --primary-light: #e8f5e9;
    --primary-dark: #005005;
    --primary-gradient: linear-gradient(135deg, #2e7d32 0%, #45904a 100%);
    --secondary-gradient: linear-gradient(135deg, #f8f9fa 0%, #e8f5e9 100%);
}

body {
    background: #f8fafc;
    background-image: 
        radial-gradient(at 40% 20%, rgba(46, 125, 50, 0.1) 0px, transparent 50%),
        radial-gradient(at 80% 0%, rgba(96, 173, 94, 0.1) 0px, transparent 50%),
        radial-gradient(at 0% 50%, rgba(46, 125, 50, 0.1) 0px, transparent 50%);
    min-height: 100vh;
}

.library-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    position: relative;
}

.library-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem;
    background: var(--primary-gradient);
    border-radius: 1rem;
    box-shadow: 0 4px 20px rgba(46, 125, 50, 0.2);
}

.library-header h1 {
    color: white;
    margin-bottom: 0.5rem;
    font-size: 2.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.library-header p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    background: white;
    padding: 0.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    color: #2e7d32;
    cursor: pointer;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    font-weight: 500;
}

.tab-btn:hover {
    background: #e8f5e9;
    color: var(--primary-dark);
}

.tab-btn.active {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 2px 10px rgba(46, 125, 50, 0.2);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Filters */
.filters-section {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: linear-gradient(to right bottom, white, #f1f8e9);
    border-radius: 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid #e8f5e9;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.filter-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.filter-group select,
.filter-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f8fafc;
}

.filter-group select:focus,
.filter-group input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
    outline: none;
}

.filter-group select:hover,
.filter-group input:hover {
    background-color: #f1f8e9;
}

/* Books Grid */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    padding: 1rem 0;
}


.book-cover {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: #f1f1f1;
}

.book-info {
    padding: 1rem;
}

.book-title {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--primary-dark);
}

.book-meta {
    font-size: 0.9rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.book-actions {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    flex: 1;
    padding: 0.75rem;
    border: none;
    border-radius: 0.25rem;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background 0.3s ease;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.read-btn {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 2px 10px rgba(46, 125, 50, 0.2);
}

.read-btn:hover {
    background: linear-gradient(135deg, #1b5e20 0%, #004d40 100%);
}

.download-btn {
    background: linear-gradient(135deg, #43a047 0%, #2e7d32 100%);
    color: white;
    box-shadow: 0 2px 10px rgba(46, 125, 50, 0.2);
}

.download-btn:hover {
    background: linear-gradient(135deg, #2e7d32 0%, #1b5e20 100%);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 1000;
}

.modal-content {
    position: relative;
    width: 90%;
    height: 90%;
    margin: 2% auto;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--primary-gradient);
    color: white;
    border-radius: 1rem 1rem 0 0;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: white;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.close-btn:hover {
    opacity: 1;
}

.modal-body {
    flex: 1;
    overflow: hidden;
}

#pdf-viewer {
    width: 100%;
    height: 100%;
}

.modal-footer {
    padding: 1rem;
    border-top: 1px solid #eee;
    text-align: right;
}

/* Responsive Design */
@media (max-width: 768px) {
    .filters-section {
        flex-direction: column;
    }

    .filter-group {
        width: 100%;
    }

    .books-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    .modal-content {
        width: 95%;
        height: 95%;
        margin: 2.5% auto;
    }
}

/* Loading State */
.loading {
    text-align: center;
    padding: 2rem;
    color: #666;
    background: white;
    border-radius: 1rem;
    padding: 3rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid #e8f5e9;
}

.loading i {
    font-size: 2rem;
    margin-bottom: 1rem;
}

/* No Results State */
.no-results {
    text-align: center;
    padding: 2rem;
    color: #666;
    background: white;
    border-radius: 1rem;
    padding: 3rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid #e8f5e9;
}

.no-results i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #ddd;
}

/* Update the book card and cover styles */
.book-card {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

.book-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(46, 125, 50, 0.15);
}

.book-cover {
    width: 100%;
    height: 280px;
    background: var(--secondary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
    border-bottom: 1px solid #eee;
    position: relative;
}

.default-cover {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-gradient);
    color: white;
}

.default-cover i {
    font-size: 6rem;
    opacity: 0.9;
}

.book-info {
    padding: 1rem;
    background: white;
    flex: 1;
    border-top: 1px solid #eee;
    position: relative;
    z-index: 3;
}

.book-title {
    color: #2c3e50;
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
}

.book-meta {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.book-meta p {
    margin: 0.25rem 0;
}

.book-actions {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    flex: 1;
    padding: 0.75rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: background-color 0.3s ease;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.read-btn {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 2px 10px rgba(46, 125, 50, 0.2);
}

.read-btn:hover {
    background: linear-gradient(135deg, #1b5e20 0%, #004d40 100%);
}

.download-btn {
    background: linear-gradient(135deg, #43a047 0%, #2e7d32 100%);
    color: white;
    box-shadow: 0 2px 10px rgba(46, 125, 50, 0.2);
}

.download-btn:hover {
    background: linear-gradient(135deg, #2e7d32 0%, #1b5e20 100%);
}

/* Add these new utility classes for text colors */
.text-primary {
    color: var(--primary-color);
}

.text-light {
    color: var(--primary-light);
}

.text-dark {
    color: var(--primary-dark);
}

/* Update scrollbar colors */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f8e9;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}
