/* Author Carousel Styles */
.author-carousel-container {
    width: 100%;
    margin: 0 auto;
    position: relative;
}

.author-carousel-overflow {
    position: relative;
    margin-bottom: 2rem;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.author-carousel-overflow .carousel-viewport {
    overflow: hidden;
    width: 100%;
    padding: 1.5rem 0;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.author-carousel-overflow .carousel-track {
    display: flex;
    width: fit-content;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: 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);
}

/* Carousel Controls - Reuse existing styles */
.author-carousel-overflow .carousel-control-prev,
.author-carousel-overflow .carousel-control-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-color);
    border: 2px solid var(--secondary-color);
    border-radius: 50%;
    height: 50px;
    width: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.9;
    transition: background 0.3s ease, opacity 0.3s ease;
    z-index: 10;
    cursor: pointer;
}

.author-carousel-overflow .carousel-control-prev:hover,
.author-carousel-overflow .carousel-control-next:hover {
    background: var(--secondary-color);
    opacity: 1;
}

.author-carousel-overflow .carousel-control-prev:disabled,
.author-carousel-overflow .carousel-control-next:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--divider-color);
}

.author-carousel-overflow .carousel-control-prev-icon,
.author-carousel-overflow .carousel-control-next-icon {
    filter: none;
    width: 24px;
    height: 24px;
    background-color: transparent;
    mask-size: cover;
    -webkit-mask-size: cover;
}

.author-carousel-overflow .carousel-control-prev {
    left: 10px;
}

.author-carousel-overflow .carousel-control-prev-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'%3e%3cpath d='m3.86 8.753 5.482 4.796c.646.566 1.658.106 1.658-.753V3.204a1 1 0 0 0-1.659-.753l-5.48 4.796a1 1 0 0 0 0 1.506z'/%3e%3c/svg%3e");
}

.author-carousel-overflow .carousel-control-next {
    right: 10px;
}

.author-carousel-overflow .carousel-control-next-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'%3e%3cpath d='m12.14 8.753-5.482 4.796c-.646.566-1.658.106-1.658-.753V3.204a1 1 0 0 1 1.659-.753l5.48 4.796a1 1 0 0 1 0 1.506z'/%3e%3c/svg%3e");
}

/* Carousel Indicators */
.author-carousel-overflow .carousel-indicators {
    position: relative;
    margin-top: 1rem;
    margin-bottom: 0;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.author-carousel-overflow .carousel-indicators button {
    background-color: rgba(0, 180, 255, 0.5);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.author-carousel-overflow .carousel-indicators button.active {
    background-color: rgba(0, 180, 255, 1);
}

/* 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;
}

/* 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;
    }

    .author-carousel-overflow .carousel-control-prev,
    .author-carousel-overflow .carousel-control-next {
        height: 40px;
        width: 40px;
    }

    .author-carousel-overflow .carousel-control-prev-icon,
    .author-carousel-overflow .carousel-control-next-icon {
        width: 20px;
        height: 20px;
    }
}

@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;
    }

    .author-carousel-overflow .carousel-control-prev {
        left: 5px;
    }

    .author-carousel-overflow .carousel-control-next {
        right: 5px;
    }
}

/* Edge fade effect for partially visible cards */
.carousel-author-item.carousel-edge-fade {
    opacity: var(--fade-opacity, 0.6);
    transition: opacity 0.3s ease;
}

/* Loading state */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

/* 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;
}
