/**
 * Styles pour le Compteur de Vues
 * Mayram Fashion House
 */

/* === BADGE DE VUES (ADMIN) === */
.views-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    color: #1565c0;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    border: 1px solid #90caf9;
    transition: all 0.3s ease;
}

.views-badge:hover {
    background: linear-gradient(135deg, #bbdefb, #90caf9);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(21, 101, 192, 0.2);
}

/* === COMPTEUR PUBLIC (DÉTAIL PRODUIT) === */
.product-views {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(21, 101, 192, 0.05);
    border: 1px solid rgba(21, 101, 192, 0.1);
    border-radius: 8px;
    font-size: 0.875rem;
    color: #666;
    margin-top: 0.5rem;
}

.product-views svg,
.product-views .icon {
    color: #1565c0;
}

.product-views .count {
    font-weight: 600;
    color: #1565c0;
}

/* === COMPTEUR DANS LES CARTES PRODUITS === */
.product-card-views {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: #999;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #f0f0f0;
}

/* === BADGE DE VUES DANS L'IMAGE (COIN SUPÉRIEUR GAUCHE) === */
.product-views-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 500;
    z-index: 2;
    transition: all 0.3s ease;
}

.product-views-badge:hover {
    background: rgba(0, 0, 0, 0.85);
    transform: scale(1.05);
}

.product-views-badge svg {
    flex-shrink: 0;
    opacity: 0.9;
}

/* === BADGE DE PRODUITS POUR CRÉATEURS (COIN SUPÉRIEUR GAUCHE) === */
.creator-products-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, rgba(79, 195, 247, 0.9), rgba(41, 182, 246, 0.9));
    backdrop-filter: blur(8px);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    z-index: 2;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(79, 195, 247, 0.3);
}

.creator-products-badge:hover {
    background: linear-gradient(135deg, rgba(41, 182, 246, 0.95), rgba(21, 101, 192, 0.95));
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(79, 195, 247, 0.4);
}

.creator-products-badge svg {
    flex-shrink: 0;
    opacity: 0.9;
}

/* Réduire l'espacement dans les cartes créateurs sur toutes les tailles d'écran */
.creator-card-body {
    padding: 1.2rem !important;
}

.creator-card-body h3.creator-name {
    margin-bottom: 0.4rem !important;
    font-size: 1.1rem !important;
}

.creator-card-body p.creator-specialty {
    margin-bottom: 0.3rem !important;
    font-size: 0.9rem !important;
}

.creator-card-body p.creator-location {
    margin-bottom: 0 !important;
    font-size: 0.85rem !important;
}

/* Réduire l'espacement dans les cartes shops sur toutes les tailles d'écran */
.shop-card-body {
    padding: 1.2rem !important;
}

.shop-card-name {
    margin-bottom: 0.4rem !important;
    font-size: 1.1rem !important;
}

.shop-card-specialty {
    margin-bottom: 0.3rem !important;
    font-size: 0.9rem !important;
}

.shop-card-location {
    margin-bottom: 0.5rem !important;
    font-size: 0.85rem !important;
}

.shop-card-stats {
    margin-bottom: 0.5rem !important;
    padding: 0.5rem 0 !important;
}

/* Prix plus petits sur toutes les tailles d'écran */
.product-price {
    font-size: 0.9rem !important;
}

.product-price .price-current {
    font-size: 0.95rem !important;
    font-weight: 600 !important;
}

.product-price .price-original {
    font-size: 0.85rem !important;
    font-weight: 400 !important;
}

.product-card-views svg {
    color: #1565c0;
    flex-shrink: 0;
}

.product-card-views span {
    font-weight: 500;
}

/* Hover effect sur la carte */
.product-card:hover .product-card-views {
    color: #1565c0;
}

.product-card:hover .product-card-views svg {
    animation: viewPulse 0.5s ease;
}

@keyframes viewPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.15);
    }
}

/* === WIDGET PRODUITS POPULAIRES === */
.popular-products-widget {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
}

.popular-products-widget h3 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.popular-product-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    transition: background 0.2s ease;
}

.popular-product-item:hover {
    background: #f5f5f5;
}

.popular-product-rank {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #d4af37, #b8941f);
    color: white;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.popular-product-rank.rank-1 {
    background: linear-gradient(135deg, #ffd700, #ffb700);
}

.popular-product-rank.rank-2 {
    background: linear-gradient(135deg, #c0c0c0, #a8a8a8);
}

.popular-product-rank.rank-3 {
    background: linear-gradient(135deg, #cd7f32, #b8691e);
}

.popular-product-thumb {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}

.popular-product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.popular-product-info {
    flex: 1;
    min-width: 0;
}

.popular-product-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: #1a1a1a;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.popular-product-views {
    font-size: 0.75rem;
    color: #1565c0;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* === STATISTIQUES VUES (DASHBOARD) === */
.stat-views {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    border-left-color: #1565c0 !important;
}

.stat-views .stat-icon {
    background: #1565c0;
}

/* === INDICATEUR TENDANCE === */
.trending-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    background: linear-gradient(135deg, #ffebee, #ffcdd2);
    color: #c62828;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

.trending-indicator.hot {
    background: linear-gradient(135deg, #ff5252, #d32f2f);
    color: white;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
}

/* === GRAPHIQUE DE VUES (OPTIONNEL) === */
.views-chart {
    position: relative;
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.views-chart-fill {
    height: 100%;
    background: linear-gradient(90deg, #1565c0, #42a5f5);
    border-radius: 2px;
    transition: width 0.5s ease;
}

/* === COMPARAISON VUES === */
.views-comparison {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: #666;
    margin-top: 0.25rem;
}

.views-change {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 600;
}

.views-change.up {
    color: #2e7d32;
}

.views-change.down {
    color: #c62828;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .views-badge {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
    
    .product-views {
        font-size: 0.8125rem;
        padding: 0.375rem 0.75rem;
    }
    
    /* Badge de vues dans l'image sur mobile */
    .product-views-badge {
        top: 6px;
        left: 6px;
        padding: 3px 6px;
        font-size: 0.65rem;
        border-radius: 10px;
    }
    
    .product-views-badge svg {
        width: 10px;
        height: 10px;
    }
    
    /* Prix plus petits sur mobile */
    .product-price {
        font-size: 0.85rem !important;
    }
    
    .product-price .price-current {
        font-size: 0.9rem !important;
    }
    
    .product-price .price-original {
        font-size: 0.8rem !important;
    }
    
    /* Badge de produits créateur sur mobile */
    .creator-products-badge {
        top: 6px;
        left: 6px;
        padding: 3px 6px;
        font-size: 0.65rem;
        border-radius: 10px;
    }
    
    .creator-products-badge svg {
        width: 10px;
        height: 10px;
    }
    
    /* Réduire l'espacement dans les cartes créateurs */
    .creator-card-body {
        padding: 1rem !important;
    }
    
    .creator-card-body h3.creator-name {
        margin-bottom: 0.25rem !important;
    }
    
    .creator-card-body p.creator-specialty {
        margin-bottom: 0.25rem !important;
    }
    
    .creator-card-body p.creator-location {
        margin-bottom: 0 !important;
    }
    
    /* Réduire l'espacement dans les cartes shops sur mobile */
    .shop-card-body {
        padding: 1rem !important;
    }
    
    .shop-card-name {
        margin-bottom: 0.25rem !important;
    }
    
    .shop-card-specialty {
        margin-bottom: 0.25rem !important;
    }
    
    .shop-card-location {
        margin-bottom: 0.3rem !important;
    }
    
    .shop-card-stats {
        margin-bottom: 0.3rem !important;
        padding: 0.3rem 0 !important;
    }
    
    .popular-products-widget {
        padding: 1rem;
    }
    
    .popular-product-item {
        padding: 0.5rem;
    }
    
    .popular-product-rank {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }
    
    .popular-product-thumb {
        width: 40px;
        height: 40px;
    }

    .popular-product-name {
        white-space: normal;
        line-height: 1.25;
    }
}

/* === ANIMATION COMPTEUR === */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.views-badge.new {
    animation: countUp 0.5s ease;
}

/* === ICÔNE ŒIL === */
.eye-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
}

/* === MODE SOMBRE === */
@media (prefers-color-scheme: dark) {
    .views-badge {
        background: linear-gradient(135deg, #1e3a5f, #1565c0);
        color: #90caf9;
        border-color: #1e88e5;
    }
    
    .product-views {
        background: rgba(144, 202, 249, 0.1);
        border-color: rgba(144, 202, 249, 0.2);
        color: #e0e0e0;
    }
    
    .popular-products-widget {
        background: #1e293b;
    }
    
    .popular-product-item:hover {
        background: #334155;
    }
}

[data-theme="dark"] .popular-products-widget {
    background: #1e293b;
    border: 1px solid #334155;
}

[data-theme="dark"] .popular-products-widget h3 {
    color: #e2e8f0;
}

[data-theme="dark"] .popular-product-name {
    color: #f1f5f9;
}

[data-theme="dark"] .popular-product-views {
    color: #90caf9;
}

[data-theme="dark"] .popular-product-item:hover {
    background: #334155;
}
