.authors-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    padding: 1rem;
}

.author-card {
    position: relative;
    height: 400px;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    background: #81236A;
}

.author-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.author-card-background {
    position: absolute;
    top: 0;
    left: -15%;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.author-background-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    transition: transform 0.3s ease;
}

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

.author-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
            180deg,
            rgba(0, 0, 0, 0.1) 0%,
            rgba(0, 0, 0, 0.3) 50%,
            rgba(0, 0, 0, 0.8) 100%
    );
    z-index: 2;
}

.book-cover-corner {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 160px;
    height: 240px;
    z-index: 4;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.author-card:hover .book-cover-corner {
    transform: scale(1.1);
}

.book-cover-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.author-card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px;
    z-index: 3;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    height: 100%;
}

.author-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: start;
    padding-right: 180px; /* Make space for the larger book cover */
}

.author-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    line-height: 1.2;
    width: 250px;
    text-align: right;
}

.book-info {
    margin-bottom: 0.75rem;
}

.book-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.book-genre {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
    margin: 0;
}

.author-bio {
    font-size: 0.9rem;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.author-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-right: 180px; /* Make space for the larger book cover */
}

.social-links {
    display: flex;
    gap: 0.5rem;
}

.social-icon {
    font-size: 1.2rem;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.social-icon:hover {
    opacity: 1;
}

.learn-more {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    transition: transform 0.3s ease;
}

.author-card:hover .learn-more {
    transform: translateX(4px);
}

.learn-more-arrow {
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.author-card:hover .learn-more-arrow {
    transform: translateX(4px);
}

.card-hover-effect {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.05);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 5;
    pointer-events: none;
}

.author-card:hover .card-hover-effect {
    opacity: 1;
}


.filter-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-section label {
    font-weight: 600;
    color: #374151;
    font-size: 1.1rem;
}

.genre-filter {
    padding: 0.75rem 1.5rem;
    border: 2px solid #e2e8f0;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, #ffffff, #f8fafc);
    color: #374151;
    font-weight: 500;
    font-size: 1rem;
    transition: all 0.3s ease;
    min-width: 200px;
}

.genre-filter:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .authors-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
        padding: 0.5rem;
    }

    .author-card {
        height: 350px;
    }

    .author-card-content {
        padding: 20px;
    }

    .author-name {
        font-size: 1.3rem;
    }

    .book-cover-corner {
        width: 130px;
        height: 196px;
        bottom: 16px;
        right: 16px;
    }

    .author-info {
        padding-right: 150px;
    }

    .author-card-footer {
        padding-right: 150px;
    }
}

@media (max-width: 480px) {
    .authors-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .author-card {
        height: 320px;
    }

    .author-card-content {
        padding: 16px;
    }

    .author-name {
        font-size: 1.2rem;
    }

    .book-title {
        font-size: 0.9rem;
    }

    .author-bio {
        font-size: 0.85rem;
    }

    .book-cover-corner {
        width: 98px;
        height: 150px;
        bottom: 12px;
        right: 12px;
    }

    .author-info {
        padding-right: 130px;
    }

    .author-card-footer {
        padding-right: 130px;
    }
}

/* Image loading fallbacks */
.author-background-image {
    background-color: #f8f9fa;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236c757d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'%3E%3C/path%3E%3Ccircle cx='12' cy='7' r='4'%3E%3C/circle%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 48px;
}

.book-cover-image {
    background-color: #e9ecef;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236c757d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 19.5A2.5 2.5 0 0 1 6.5 17H20'%3E%3C/path%3E%3Cpath d='M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 20px;
}

.author-background-image[src]:not([src=""]) {
    background-image: none;
}

.book-cover-image[src]:not([src=""]) {
    background-image: none;
}