/* 🎯 RECOMMENDATIONS STYLES */

.rec-card {
    width:160px;
    margin:6px;
    padding:8px;
    border:1px solid #ddd;
    border-radius:6px;
    text-align:center;
    cursor:pointer;
    transition:box-shadow .2s
}

.rec-card:hover {
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.rec-card img {
    width: 100%;
    height: 90%;
    object-fit: cover;
    border-radius: 4px;
}

.recommendations-header {
    display: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.recommendations-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.ai-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

.ai-badge i {
    font-size: 1.1rem;
}

.recommendations-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    opacity: 0.9;
}

.confidence-score {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
}

.algorithm-used {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
}

.recommendations-insight {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    opacity: 0.95;
}

.recommendations-insight i {
    font-size: 1rem;
}

/* Recommendation Badge */
.recommendation-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.recommendation-badge i {
    font-size: 0.8rem;
}

/* Recommendation Reason */
.recommendation-reason {
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 8px;
    padding: 0.5rem;
    margin: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #667eea;
}

.recommendation-reason i {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Recommendation Feedback */
.recommendation-feedback {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.feedback-buttons {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.feedback-btn {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    background: white;
    color: #666;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.feedback-btn:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

.feedback-btn.like-btn:hover {
    background: #e8f5e8;
    border-color: #4caf50;
    color: #4caf50;
}

.feedback-btn.dislike-btn:hover {
    background: #ffeaea;
    border-color: #f44336;
    color: #f44336;
}

.feedback-btn.submitted {
    background: #4caf50;
    border-color: #4caf50;
    color: white;
    cursor: default;
}

.feedback-btn.submitted.dislike-btn {
    background: #f44336;
    border-color: #f44336;
}

.feedback-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.feedback-btn i {
    font-size: 0.9rem;
}

/* Recommendation Score Indicator */
.product-card[data-is-recommendation="true"] {
    position: relative;
    border: 2px solid rgba(102, 126, 234, 0.2);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.1);
}

.product-card[data-is-recommendation="true"]:hover {
    border-color: rgba(102, 126, 234, 0.4);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.2);
}

/* Loading State for Recommendations */
.recommendations-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 2rem;
    color: #667eea;
    font-weight: 500;
}

.recommendations-loading .loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .recommendations-info {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    
    .recommendations-stats {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .feedback-buttons {
        flex-direction: column;
    }
    
    .feedback-btn {
        justify-content: center;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .recommendation-reason {
        background: rgba(102, 126, 234, 0.2);
        border-color: rgba(102, 126, 234, 0.3);
        color: #8b9cff;
    }
    
    .feedback-btn {
        background: #2a2a2a;
        border-color: #444;
        color: #ccc;
    }
    
    .feedback-btn:hover {
        background: #333;
        border-color: #555;
    }
    
    .product-card[data-is-recommendation="true"] {
        border-color: rgba(102, 126, 234, 0.3);
        background: rgba(102, 126, 234, 0.05);
    }
}

.recommendations-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem 0;
}

.rec-card {
    width: 200px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.rec-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: #667eea;
}

.rec-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.rec-card h4 {
    margin: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rec-price {
    margin: 0 0.5rem;
    font-size: 1.1rem;
    font-weight: bold;
    color: #00b0a4;
}

.rec-reasons {
    margin: 0.5rem;
    font-size: 0.75rem;
    color: #666;
    font-style: italic;
}

.rec-confidence {
    height: 3px;
    background: #f0f0f0;
    margin: 0.5rem;
    border-radius: 3px;
    overflow: hidden;
}

.confidence-bar {
    display: block;
    height: 100%;
    background: linear-gradient(to right, #667eea, #764ba2);
    transition: width 0.5s ease;
}

.recommendations-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: #667eea;
    font-weight: 500;
    gap: 1rem;
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(102, 126, 234, 0.2);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.no-recommendations,
.error {
    text-align: center;
    padding: 2rem;
    color: #666;
}

.error {
    color: #e74c3c;
}