/* ============================================================
   Blue Radio — Styles de Popularité (popularity.css)
   ============================================================
   Styles pour :
   - Badges like / trending  
   - Statistiques de popularité sur les cards
   - Section "Tendances"  
   - Animations micro-interactions
   ============================================================ */

/* ── Variables ──────────────────────────────────────────────── */
:root {
    --pop-like-color     : #f43f5e;
    --pop-fire-color     : #f97316;
    --pop-active-color   : #22c55e;
    --pop-score-color    : #6366f1;
    --pop-plays-color    : #38bdf8;
    --pop-badge-radius   : 20px;
    --pop-stat-gap       : 6px;
}

/* ════════════════════════════════════════════════════════════
   1. STATS BAR — barre de statistiques sur les cards
   ════════════════════════════════════════════════════════════ */

.pop-stats {
    display         : flex;
    align-items     : center;
    flex-wrap       : wrap;
    gap             : 6px 10px;
    margin-top      : 8px;
    padding-top     : 8px;
    border-top      : 1px solid rgba(255, 255, 255, 0.06);
}

.pop-stat {
    display        : flex;
    align-items    : center;
    gap            : 3px;
    font-size      : 11px;
    color          : rgba(255,255,255,0.45);
    letter-spacing : 0.3px;
    transition     : color 0.3s;
}

.pop-stat .material-icons {
    font-size : 13px;
}

/* Auditeurs actifs — vert si > 0 */
.pop-stat--live {
    color : var(--pop-active-color);
}

.pop-stat--live .material-icons {
    animation : pulse-dot 1.5s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.4; }
}

/* ════════════════════════════════════════════════════════════
   2. BOUTON LIKE
   ════════════════════════════════════════════════════════════ */

.like-btn {
    display        : inline-flex;
    align-items    : center;
    gap            : 4px;
    padding        : 5px 10px;
    border         : 1px solid rgba(244, 63, 94, 0.3);
    border-radius  : var(--pop-badge-radius);
    background     : transparent;
    color          : rgba(255,255,255,0.5);
    font-size      : 12px;
    cursor         : pointer;
    transition     : all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    user-select    : none;
    white-space    : nowrap;
}

.like-btn .material-icons {
    font-size  : 15px;
    color      : rgba(244, 63, 94, 0.5);
    transition : transform 0.3s, color 0.25s;
}

.like-btn:hover {
    border-color : var(--pop-like-color);
    color        : var(--pop-like-color);
    background   : rgba(244, 63, 94, 0.08);
}

.like-btn:hover .material-icons {
    color     : var(--pop-like-color);
    transform : scale(1.2);
}

/* État liké */
.like-btn.liked {
    border-color : var(--pop-like-color);
    background   : rgba(244, 63, 94, 0.12);
    color        : var(--pop-like-color);
}

.like-btn.liked .material-icons {
    color : var(--pop-like-color);
}

/* Animation pulsation au clic */
.like-btn.like-pulse .material-icons {
    animation : like-pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes like-pop {
    0%   { transform: scale(1);   }
    40%  { transform: scale(1.6); }
    70%  { transform: scale(0.9); }
    100% { transform: scale(1);   }
}

/* ════════════════════════════════════════════════════════════
   3. BADGE TENDANCE 🔥
   ════════════════════════════════════════════════════════════ */

.badge-trending {
    display        : inline-flex;
    align-items    : center;
    gap            : 3px;
    padding        : 3px 8px;
    border-radius  : var(--pop-badge-radius);
    background     : linear-gradient(135deg, #f97316, #ef4444);
    color          : #fff;
    font-size      : 10px;
    font-weight    : 700;
    letter-spacing : 0.5px;
    text-transform : uppercase;
    box-shadow     : 0 2px 8px rgba(249,115,22,0.4);
}

.badge-trending .material-icons {
    font-size : 13px;
}

/* ════════════════════════════════════════════════════════════
   4. SECTION "STATIONS EN TENDANCE"
   ════════════════════════════════════════════════════════════ */

.trending-section {
    background    : linear-gradient(135deg,
                        rgba(249,115,22,0.06) 0%,
                        rgba(239,68,68,0.04) 100%);
    border        : 1px solid rgba(249,115,22,0.15);
    border-radius : 16px;
    padding       : 20px 24px;
    margin-bottom : 28px;
}

.trending-section-header {
    display        : flex;
    align-items    : center;
    gap            : 8px;
    margin-bottom  : 14px;
    color          : var(--pop-fire-color);
    font-size      : 14px;
    font-weight    : 700;
    text-transform : uppercase;
    letter-spacing : 1px;
}

.trending-section-header .material-icons {
    font-size : 20px;
}

/* Liste des tendances */
#trendingList {
    display        : flex;
    flex-wrap      : wrap;
    gap            : 8px;
}

.trending-item {
    display        : flex;
    align-items    : center;
    gap            : 6px;
    padding        : 6px 12px;
    background     : var(--bg-card);
    border         : 1px solid rgba(249,115,22,0.2);
    border-radius  : 30px;
    cursor         : pointer;
    transition     : all 0.2s;
    font-size      : 13px;
    color          : var(--text-primary);
}

.trending-item:hover {
    background    : rgba(249,115,22,0.1);
    border-color  : rgba(249,115,22,0.4);
    transform     : translateY(-1px);
}

.trending-rank {
    font-size   : 11px;
    font-weight : 700;
    color       : var(--pop-fire-color);
    min-width   : 20px;
}

.trending-fire {
    font-size : 15px !important;
    color     : var(--pop-fire-color) !important;
    animation : fire-flicker 1.2s ease-in-out infinite alternate;
}

@keyframes fire-flicker {
    from { opacity: 0.7; transform: scale(1); }
    to   { opacity: 1;   transform: scale(1.15); }
}

.trending-name {
    font-weight  : 600;
    max-width    : 120px;
    overflow     : hidden;
    text-overflow: ellipsis;
    white-space  : nowrap;
}

.trending-meta {
    display      : flex;
    align-items  : center;
    gap          : 3px;
    font-size    : 11px;
    color        : var(--pop-active-color);
    margin-left  : 2px;
}

/* ════════════════════════════════════════════════════════════
   5. SCORE DE POPULARITÉ — widget dans le player flottant
   ════════════════════════════════════════════════════════════ */

.floating-popularity {
    display      : flex;
    align-items  : center;
    gap          : 12px;
    padding      : 8px 14px;
    background   : rgba(255,255,255,0.04);
    border-top   : 1px solid rgba(255,255,255,0.06);
    font-size    : 12px;
    color        : rgba(255,255,255,0.5);
}

.floating-popularity-stat {
    display     : flex;
    align-items : center;
    gap         : 4px;
}

.floating-popularity-stat .material-icons {
    font-size : 14px;
}

.floating-popularity-stat.stat-live {
    color : var(--pop-active-color);
}

#floatingActiveUsers {
    font-weight : 700;
    font-variant-numeric: tabular-nums;
}

/* ════════════════════════════════════════════════════════════
   6. PAGE POPULAIRES — mise en page améliorée
   ════════════════════════════════════════════════════════════ */

/* Classement avec rang numéroté */
.station-card .rank-badge {
    position      : absolute;
    top           : 10px;
    left          : 10px;
    width         : 26px;
    height        : 26px;
    border-radius : 50%;
    background    : linear-gradient(135deg, #6366f1, #8b5cf6);
    color         : #fff;
    font-size     : 12px;
    font-weight   : 900;
    display       : flex;
    align-items   : center;
    justify-content: center;
    box-shadow    : 0 2px 8px rgba(99,102,241,0.5);
    z-index       : 2;
}

/* Top 3 dorés */
.station-card:nth-child(1) .rank-badge { background: linear-gradient(135deg, #f59e0b, #fbbf24); box-shadow: 0 2px 10px rgba(245,158,11,0.6); }
.station-card:nth-child(2) .rank-badge { background: linear-gradient(135deg, #9ca3af, #d1d5db); box-shadow: 0 2px 8px rgba(156,163,175,0.4); }
.station-card:nth-child(3) .rank-badge { background: linear-gradient(135deg, #dc9c5a, #e6ad72); box-shadow: 0 2px 8px rgba(220,156,90,0.4); }

/* ════════════════════════════════════════════════════════════
   7. RESPONSIF
   ════════════════════════════════════════════════════════════ */

@media (max-width: 640px) {
    .trending-section {
        padding : 14px 16px;
    }

    .trending-item {
        font-size : 12px;
        padding   : 5px 10px;
    }

    .pop-stats {
        gap : 4px 8px;
    }

    .like-btn {
        padding   : 4px 8px;
        font-size : 11px;
    }
}
