/* ===== BOOKS STYLES ===== */

/* Hero Books */
.books-hero {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2em 1em;
    position: relative;
}

.books-hero .hero-container {
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
}

.books-hero .hero-title {
    font-size: 2.8em;
    font-weight: 400;
    margin-bottom: 0.5em;
    line-height: 1.2;
}

.books-hero .hero-description {
    font-size: 1.2em;
    max-width: 600px;
    margin: 1em auto 2em auto;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
}

/* Books Section */
.books-section {
    background: #2e1556;
    min-height: auto;
    padding: 3em 0;
}

.books-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}



/* Loading State */
.loading-state {
    text-align: center;
    padding: 3em 0;
    color: rgba(255, 255, 255, 0.8);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(167, 139, 250, 0.3);
    border-top: 3px solid #a78bfa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1em auto;
}

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

/* Books Grid */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2em;
    margin-top: 2em;
    padding: 0 1em;
}

/* Book Card */
.book-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 1.2em;
    overflow: hidden;
    transition: all 0.4s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(167, 139, 250, 0.2);
    position: relative;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 480px;
}

.book-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(167, 139, 250, 0.1), rgba(224, 170, 255, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.book-card:hover::before {
    opacity: 1;
}

.book-card:hover {
    transform: translateY(-8px);
    border-color: rgba(167, 139, 250, 0.4);
    box-shadow: 0 15px 40px rgba(167, 139, 250, 0.2);
}

/* Book Image Container */
.book-image-container {
    position: relative;
    height: 200px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.2);
}

.book-image {
    width: auto;
    height: 100%;
    max-width: 100%;
    object-fit: contain;
    transition: transform 0.4s ease;
}

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

/* Featured Badge */
.featured-badge {
    position: absolute;
    top: 0.8em;
    right: 0.8em;
    background: linear-gradient(135deg, #a78bfa, #e0aaff);
    color: #140c24;
    padding: 0.3em 0.8em;
    border-radius: 1em;
    font-size: 0.8em;
    font-weight: 600;
    z-index: 2;
}

/* Book Content */
.book-content {
    padding: 1.5em;
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    flex: 1;
    justify-content: space-between;
}

.book-main-info {
    flex: 1;
}

.book-footer {
    margin-top: auto;
    padding-top: 1em;
}

.book-title {
    font-size: 1.3em;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.5em;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-author {
    color: #e0aaff;
    font-size: 1em;
    font-weight: 500;
    margin-bottom: 0.8em;
}

.book-summary {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9em;
    line-height: 1.5;
    margin-bottom: 1em;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Book Meta */
.book-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1em;
    gap: 1em;
}

.book-rating {
    color: #ffd700;
    font-size: 0.9em;
    font-weight: 500;
}

.book-year {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85em;
}

/* Keywords */
.book-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em;
    margin-bottom: 1.2em;
}

.keyword-tag {
    background: rgba(167, 139, 250, 0.2);
    color: #e0aaff;
    padding: 0.3em 0.8em;
    border-radius: 1em;
    font-size: 0.75em;
    font-weight: 500;
    border: 1px solid rgba(167, 139, 250, 0.3);
}

/* Book Actions */
.book-actions {
    display: flex;
    gap: 0.8em;
    margin-top: 1em;
}

.book-detail-btn {
    flex: 1;
    background: linear-gradient(135deg, #a78bfa, #e0aaff);
    color: #140c24;
    padding: 0.8em 1.2em;
    border: none;
    border-radius: 0.8em;
    font-weight: 600;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5em;
}

.book-detail-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(167, 139, 250, 0.4);
    filter: brightness(1.1);
}

.book-icon {
    width: 16px;
    height: 16px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3em 0;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.1em;
}

/* Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.book-card {
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
}

/* Staggered animation delays */
.book-card:nth-child(1) { animation-delay: 0.1s; }
.book-card:nth-child(2) { animation-delay: 0.2s; }
.book-card:nth-child(3) { animation-delay: 0.3s; }
.book-card:nth-child(4) { animation-delay: 0.4s; }
.book-card:nth-child(5) { animation-delay: 0.5s; }
.book-card:nth-child(6) { animation-delay: 0.6s; }
.book-card:nth-child(n+7) { animation-delay: 0.7s; }

/* Responsive Design */
@media (max-width: 768px) {
    .books-hero {
        min-height: 50vh;
        padding: 1.5em 1em;
    }

    .books-hero .hero-title {
        font-size: 2.2em;
    }

    .books-hero .hero-description {
        font-size: 1.1em;
    }

    .books-container {
        padding: 0 1em;
    }

    .books-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1.5em;
        padding: 0;
    }



    .book-content {
        padding: 1.2em;
    }

    .book-title {
        font-size: 1.2em;
    }
}

@media (max-width: 480px) {
    .books-hero .hero-title {
        font-size: 1.8em;
    }

    .books-grid {
        grid-template-columns: 1fr;
        gap: 1.2em;
    }



    .book-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5em;
    }
}