/* Library page specific styles */
.container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    padding-top: 4rem;
}

.home-button {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 3rem;
    height: 3rem;
    background-color: var(--primary);
    color: var(--darker);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    z-index: 100;
    animation: fadeIn 0.5s ease;
}

.home-button:hover {
    transform: translateY(-3px) rotate(5deg);
    background-color: var(--primary-dark);
    box-shadow: 0 10px 20px rgba(74, 222, 128, 0.2);
}

.filter-bar {
    margin-bottom: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    animation: fadeInUp 0.8s ease both;
    animation-delay: 0.3s;
}

.search-input-container {
    position: relative;
    flex: 1;
    min-width: 250px;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary);
    pointer-events: none;
}

#search-input {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 3rem;
    border-radius: 8px;
    border: 1px solid var(--gray);
    background-color: var(--gray);
    color: var(--light);
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

#search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.2);
}

.filter-options {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-options select {
    padding: 0.8rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--gray);
    background-color: var(--gray);
    color: var(--light);
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%234ade80' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.filter-options select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.2);
}

.library-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
    animation: fadeInUp 0.8s ease both;
    animation-delay: 0.4s;
}

.stat-box {
    background-color: var(--gray);
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.stat-icon {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--light);
}

.stat-label {
    color: var(--light);
    opacity: 0.7;
}

.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
    animation: fadeInUp 0.8s ease both;
    animation-delay: 0.5s;
}

.book-card {
    background-color: var(--gray);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: fadeIn 0.5s ease both;
    display: flex;
    flex-direction: column;
    position: relative;
}

.book-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.book-status {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    z-index: 10;
}

.status-completed {
    background-color: rgba(74, 222, 128, 0.2);
    color: var(--primary-light);
}

.status-in-progress {
    background-color: rgba(56, 189, 248, 0.2);
    color: #38bdf8;
}

.status-not-started {
    background-color: rgba(248, 113, 113, 0.2);
    color: #f87171;
}

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

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

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

.book-info {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.book-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--light);
    line-height: 1.4;
}

.book-author {
    font-size: 0.9rem;
    color: var(--light);
    opacity: 0.7;
    margin-bottom: 1rem;
}

.book-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-weight: 600;
    color: var(--primary);
}

.stat-text {
    font-size: 0.8rem;
    color: var(--light);
    opacity: 0.7;
}

.book-progress {
    margin-top: auto;
}

.progress-text {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.progress-label {
    color: var(--light);
    opacity: 0.8;
}

.progress-value {
    color: var(--primary);
    font-weight: 500;
}

.progress-bar {
    height: 6px;
    background-color: var(--darker);
    border-radius: 3px;
    overflow: hidden;
}

.progress-filled {
    height: 100%;
    background-color: var(--primary);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.book-date {
    margin-top: 1rem;
    font-size: 0.8rem;
    color: var(--light);
    opacity: 0.6;
    text-align: right;
}

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

.book-action-btn {
    flex: 1;
    padding: 0.6rem;
    border-radius: 6px;
    border: none;
    background-color: var(--darker);
    color: var(--light);
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.book-action-btn:hover {
    background-color: rgba(74, 222, 128, 0.1);
    color: var(--primary);
}

.empty-library {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    background-color: var(--gray);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.empty-library i {
    font-size: 3rem;
    color: var(--primary);
    opacity: 0.8;
}

.empty-library p {
    color: var(--light);
    opacity: 0.8;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.empty-library .btn-add {
    padding: 0.8rem 1.5rem;
    background-color: var(--primary);
    color: var(--darker);
    border-radius: 8px;
    font-weight: 500;
    display: inline-block;
    transition: all 0.3s ease;
}

.empty-library .btn-add:hover {
    background-color: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(74, 222, 128, 0.2);
}

/* Animation for card appearance */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-options {
        flex-direction: column;
    }
    
    .library-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1.5rem;
    }
    
    .book-cover {
        height: 180px;
    }
}

@media (max-width: 480px) {
    .library-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .book-card {
        display: grid;
        grid-template-columns: 120px 1fr;
        height: auto;
    }
    
    .book-cover {
        height: 100%;
    }
}