/* ============================================
   ML RECOMMENDATIONS SECTION STYLES
   ============================================ */

   .recommended-products-section {
    padding: 60px 0;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.recommended-products-section .section-title span {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Loading state */
.loading {
    text-align: center;
    padding: 60px 20px;
    color: #7f8c8d;
    font-size: 16px;
}

.loading::before {
    content: "";
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Product Card Enhancements for Recommendations */
.recommended-products-section .product-card {
    position: relative;
    overflow: hidden;
}

.recommended-products-section .product-card::before {
    content: "🎯";
    position: absolute;
    top: 10px;
    left: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    z-index: 2;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

/* Recommendation Badge */
.recommendation-badge {
    position: absolute;
    top: 50px;
    left: 10px;
    background: rgba(255, 255, 255, 0.95);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.recommendation-badge.similar {
    color: #667eea;
    border: 1px solid #667eea;
}

.recommendation-badge.popular {
    color: #e74c3c;
    border: 1px solid #e74c3c;
}

.recommendation-badge.category {
    color: #27ae60;
    border: 1px solid #27ae60;
}

.recommendation-badge.search {
    color: #f39c12;
    border: 1px solid #f39c12;
}

/* Analytics Dashboard Styles */
.analytics-dashboard {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin: 30px 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.analytics-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 10px;
    text-align: center;
}

.analytics-card h3 {
    font-size: 36px;
    margin-bottom: 10px;
    font-weight: 700;
}

.analytics-card p {
    font-size: 14px;
    opacity: 0.9;
}

.analytics-card.green {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.analytics-card.orange {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.analytics-card.blue {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

/* Recently Viewed Products */
.recently-viewed-section {
    padding: 40px 0;
    background: #f8f9fa;
}

.recently-viewed-scroll {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding: 20px 0;
    scroll-behavior: smooth;
}

.recently-viewed-scroll::-webkit-scrollbar {
    height: 8px;
}

.recently-viewed-scroll::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.recently-viewed-scroll::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.recently-viewed-scroll::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.recently-viewed-item {
    min-width: 180px;
    background: white;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.recently-viewed-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.recently-viewed-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 10px;
}

.recently-viewed-item h4 {
    font-size: 14px;
    color: #2c3e50;
    margin-bottom: 5px;
}

.recently-viewed-item .price {
    font-size: 16px;
    font-weight: 600;
    color: #e74c3c;
}

/* Trending Badge Animation */
@keyframes trending-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(231, 76, 60, 0);
    }
}

.trending-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #e74c3c;
    color: white;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    z-index: 2;
    animation: trending-pulse 2s infinite;
}

/* Personalization Score */
.personalization-score {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    margin-top: 10px;
}

.personalization-score i {
    font-size: 16px;
}

/* Match Percentage Bar */
.match-bar {
    width: 100%;
    height: 6px;
    background: #ecf0f1;
    border-radius: 10px;
    overflow: hidden;
    margin: 10px 0;
}

.match-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    transition: width 0.5s ease;
}

/* Dark Mode Support */
body.dark-mode .recommended-products-section {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
}

body.dark-mode .analytics-dashboard {
    background: #34495e;
}

body.dark-mode .recently-viewed-item {
    background: #34495e;
}

body.dark-mode .recently-viewed-item h4 {
    color: #ecf0f1;
}

/* Responsive Design */
@media (max-width: 768px) {
    .recommended-products-section {
        padding: 40px 0;
    }
    
    .analytics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .recently-viewed-item {
        min-width: 150px;
    }
}

/* Success Message for Tracking */
.tracking-success {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    animation: slideInUp 0.3s ease;
}

@keyframes slideInUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}