/**
 * Book Authors Listing Styles
 */

/* Filter Container */
.bal-filter-container {
    width: 100%;
    margin-bottom: 30px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.bal-filter-scroll {
    display: flex;
    gap: 10px;
    padding: 15px 0;
    min-width: max-content;
}

/* Mobile: Horizontal scroll */
@media (max-width: 767px) {
    .bal-filter-container {
        margin-left: -20px;
        margin-right: -20px;
        padding: 0 20px;
    }
    
    .bal-filter-scroll {
        padding: 15px 20px;
    }
}

/* Filter Buttons */
.bal-filter-letter {
    background: #f5f5f5;
    border: 2px solid #e0e0e0;
    border-radius: 50px;
    padding: 10px 20px;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-width: 45px;
    text-align: center;
    font-family: inherit;
}

.bal-filter-letter:hover {
    background: #e8e8e8;
    border-color: #ccc;
    transform: translateY(-2px);
}

.bal-filter-letter.active {
    background: #0073aa;
    border-color: #0073aa;
    color: #fff;
}

.bal-filter-letter.active:hover {
    background: #005a87;
    border-color: #005a87;
}

/* Authors Container */
.bal-authors-container {
    width: 100%;
}

/* Authors Grid - Dynamic columns using CSS variables */
.bal-authors-grid {
    display: grid;
    grid-template-columns: repeat(var(--bal-columns, 4), 1fr);
    gap: 30px;
    margin-bottom: 30px;
}

/* Responsive Grid - Tablet */
@media (max-width: 1024px) {
    .bal-authors-grid {
        grid-template-columns: repeat(var(--bal-columns-tablet, 3), 1fr);
        gap: 25px;
    }
}

/* Responsive Grid - Mobile */
@media (max-width: 768px) {
    .bal-authors-grid {
        grid-template-columns: repeat(var(--bal-columns-mobile, 2), 1fr);
        gap: 20px;
    }
}

/* Single Column on Very Small Mobile */
@media (max-width: 480px) {
    .bal-authors-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }
}

/* Author Item */
.bal-author-item {
    text-align: center;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.bal-author-item.hidden {
    display: none;
}

.bal-author-link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.3s ease;
}

.bal-author-link:hover {
    transform: translateY(-5px);
}

.bal-author-link:hover .bal-author-name {
    color: #0073aa;
}

/* Author Photo */
.bal-author-photo {
    width: 150px;
    height: 150px;
    margin: 0 auto 20px;
    border-radius: 50%;
    overflow: hidden;
    background: #f5f5f5;
    border: 3px solid #e0e0e0;
    transition: border-color 0.3s ease;
    position: relative;
}

.bal-author-link:hover .bal-author-photo {
    border-color: #0073aa;
}

.bal-author-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.bal-author-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-size: 48px;
    font-weight: bold;
}

/* Author Name */
.bal-author-name {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 10px;
    color: #333;
    transition: color 0.3s ease;
    word-wrap: break-word;
}

/* Author Count */
.bal-author-count {
    font-size: 14px;
    color: #666;
    margin: 0;
    font-weight: 400;
}

/* Loading State */
.bal-loading {
    text-align: center;
    padding: 40px 20px;
    font-size: 16px;
    color: #666;
}

/* No Results */
.bal-no-results {
    text-align: center;
    padding: 40px 20px;
    font-size: 18px;
    color: #666;
    grid-column: 1 / -1;
}

/* Smooth Fade Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bal-author-item {
    animation: fadeIn 0.3s ease;
}

/* WordPress Admin Bar Compatibility */
.admin-bar .bal-filter-container {
    margin-top: 0;
}

