/* Author Carousel Styles */
.author-carousel-container {
    width: 100%;
    margin: 0 auto;
    position: relative;
}

.author-carousel-overflow {
    position: relative;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex: 1;
    display: flex;
    gap: 1.25rem;
    padding: 0.5rem 0;
}

.author-carousel-overflow::-webkit-scrollbar {
    display: none;
}

.carousel-author-item {
    position: relative;
    overflow: visible;
    flex: 0 0 auto;
    width: 300px;
    margin: 0 10px;
    padding: 0;
}

/* Author Card */
.author-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 1.25rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.author-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

/* Avatar Section */
.author-avatar-section {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 0.5rem;
}

.author-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-color);
}

.author-avatar-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.75rem;
    border: 3px solid var(--primary-color);
}

/* Content Section */
.author-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 0;
}

.author-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recommendation-context {
    display: flex;
    justify-content: center;
}

.author-bio {
    font-size: 0.875rem;
    color: #666;
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.author-bio.explanation {
    font-style: italic;
    color: #888;
}

/* Metadata Section */
.author-metadata {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #666;
}

.metadata-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.metadata-item.topics {
    color: var(--primary-color);
}

/* Action Buttons */
.author-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: auto;
}

.author-actions button {
    transition: all 0.2s ease;
}

.author-actions button:hover:not(:disabled) {
    transform: scale(1.05);
}

.author-actions button:active:not(:disabled) {
    transform: scale(0.98);
}

/* Accessibility - Visually hidden helper */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Loading state */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

/* Responsive Styles */
@media (max-width: 1200px) {
    .carousel-author-item {
        width: 300px;
        margin: 0 8px;
    }
}

@media (max-width: 768px) {
    .carousel-author-item {
        width: 290px;
        margin: 0 5px;
    }

    .author-card {
        padding: 1rem;
    }
}

@media (max-width: 576px) {
    .carousel-author-item {
        width: 280px;
        margin: 0 5px;
    }

    .author-avatar,
    .author-avatar-placeholder {
        width: 64px;
        height: 64px;
        font-size: 1.5rem;
    }

    .author-name {
        font-size: 1rem;
    }

    .author-bio {
        font-size: 0.8rem;
        -webkit-line-clamp: 2;
    }

    .author-metadata {
        font-size: 0.8rem;
    }
}

/* Edge fade effect for partially visible cards */
.carousel-author-item.carousel-edge-fade {
    opacity: var(--fade-opacity, 0.6);
    transition: opacity 0.3s ease;
}

/* Focus states for accessibility */
.author-carousel-overflow button:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.author-card:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}
