/* BB AI Recommendations Frontend Styles */

.bb-ai-rec-widget {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: box-shadow 0.3s ease;
}

.bb-ai-rec-widget:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.bb-ai-rec-widget-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 20px 0;
    padding: 0 0 15px 0;
    border-bottom: 2px solid #f0f0f0;
    color: #1a1a1a;
    letter-spacing: -0.02em;
}

.bb-ai-rec-items {
    margin: 0 -10px;
}

.bb-ai-rec-item {
    padding: 16px 12px;
    border-bottom: 1px solid #f5f5f5;
    transition: all 0.3s ease;
    position: relative;
    border-radius: 8px;
    margin: 0 -12px;
    padding-left: 12px;
    padding-right: 12px;
}

.bb-ai-rec-item:last-child {
    border-bottom: none;
}

.bb-ai-rec-item:hover {
    background: #f8fafb;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.bb-ai-rec-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
}

.bb-ai-rec-avatar {
    flex-shrink: 0;
    margin-right: 15px;
}

.bb-ai-rec-avatar img {
    border-radius: 50%;
    width: 50px;
    height: 50px;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.bb-ai-rec-thumbnail {
    flex-shrink: 0;
    margin-right: 16px;
    width: 90px;
    height: 70px;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    background: #f5f5f5;
}

.bb-ai-rec-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bb-ai-rec-content {
    flex-grow: 1;
    min-width: 0;
}

.bb-ai-rec-headline {
    margin: 0 0 6px 0;
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.3;
    letter-spacing: -0.01em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bb-ai-rec-link:hover .bb-ai-rec-headline {
    color: #3498db;
}

.bb-ai-rec-excerpt {
    margin: 0 0 6px 0;
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bb-ai-rec-meta {
    font-size: 12px;
    color: #999;
    font-weight: 500;
    letter-spacing: 0.01em;
}

.bb-ai-rec-price {
    font-size: 15px;
    color: #27ae60;
    font-weight: 700;
    display: inline-block;
    margin-top: 4px;
}

.bb-ai-rec-item-actions {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
}

.bb-ai-rec-dismiss {
    width: 24px;
    height: 24px;
    line-height: 22px;
    text-align: center;
    color: #999;
    text-decoration: none;
    font-size: 20px;
    transition: all 0.2s ease;
    opacity: 0;
}

.bb-ai-rec-item:hover .bb-ai-rec-dismiss {
    opacity: 1;
}

.bb-ai-rec-dismiss:hover {
    color: #e74c3c;
    transform: scale(1.2);
}

.bb-ai-rec-actions {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
    text-align: center;
}

.bb-ai-rec-refresh {
    color: #3498db;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.bb-ai-rec-refresh:hover {
    background: #e8f4f8;
    color: #2980b9;
}

.bb-ai-rec-refresh:before {
    content: "\21bb";
    font-size: 16px;
}

/* Loading state */
.bb-ai-rec-loading {
    opacity: 0.5;
    pointer-events: none;
}

.bb-ai-rec-loading:after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #3498db;
    border-top-color: transparent;
    border-radius: 50%;
    animation: bb-ai-rec-spin 0.8s linear infinite;
}

@keyframes bb-ai-rec-spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .bb-ai-rec-widget {
        padding: 16px;
        margin-bottom: 20px;
        border-radius: 8px;
    }
    
    .bb-ai-rec-widget-title {
        font-size: 18px;
        margin-bottom: 16px;
        padding-bottom: 12px;
    }
    
    .bb-ai-rec-avatar img {
        width: 40px;
        height: 40px;
    }
    
    .bb-ai-rec-thumbnail {
        width: 70px;
        height: 55px;
    }
    
    .bb-ai-rec-headline {
        font-size: 15px;
    }
    
    .bb-ai-rec-excerpt {
        font-size: 13px;
    }
}

/* Widget specific styles */
.bb-ai-rec-widget-member_suggestions .button.small {
    padding: 5px 15px;
    font-size: 13px;
}

.bb-ai-rec-widget-group_suggestions .bb-ai-rec-meta {
    color: #27ae60;
}

.bb-ai-rec-widget-course_suggestions .bb-ai-rec-price {
    display: inline-block;
    margin-top: 5px;
}

/* Empty state */
.bb-ai-rec-empty {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.bb-ai-rec-empty p {
    margin: 0;
}

/* Additional enhancements for better visual hierarchy */
.bb-ai-rec-post .bb-ai-rec-link,
.bb-ai-rec-course .bb-ai-rec-link {
    align-items: flex-start;
}

.bb-ai-rec-post .bb-ai-rec-thumbnail,
.bb-ai-rec-course .bb-ai-rec-thumbnail {
    margin-top: 2px;
}

/* Ensure featured images maintain aspect ratio */
.bb-ai-rec-thumbnail img {
    transition: transform 0.3s ease;
}

.bb-ai-rec-item:hover .bb-ai-rec-thumbnail img {
    transform: scale(1.05);
}

/* Better button styling */
.bb-ai-rec-item-actions .button.small {
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    background: #3498db;
    color: #fff;
    border: none;
    transition: all 0.2s ease;
}

.bb-ai-rec-item-actions .button.small:hover {
    background: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Smooth animations */
.bb-ai-rec-item {
    animation: bb-ai-rec-fade-in 0.5s ease;
}

@keyframes bb-ai-rec-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Widget type specific styling */
.bb-ai-rec-widget-course_suggestions .bb-ai-rec-item {
    padding: 18px 12px;
}

.bb-ai-rec-widget-member_suggestions .bb-ai-rec-avatar {
    position: relative;
}

.bb-ai-rec-widget-member_suggestions .bb-ai-rec-avatar::after {
    content: '';
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background: #27ae60;
    border: 2px solid #fff;
    border-radius: 50%;
}