/* assets/css/trending.css */

/* Variables et configuration globale */
:root {
    --primary: #8A4FFF;
    --primary-light: #A77DFF;
    --primary-dark: #6E32DD;
    --secondary: #FF7BAC;
    --text: #333333;
    --text-light: #666666;
    --white: #FFFFFF;
    --bg-light: #F8F9FF;
    --card-shadow: 0 8px 20px rgba(138, 79, 255, 0.1);
    --radius: 12px;
    --radius-lg: 20px;
    --radius-sm: 8px;
    --transition: all 0.3s ease;
}

/* ===== LAYOUT DE BASE ===== */
.trending-container {
    padding: 30px 5%;
    max-width: 1400px;
    margin: 0 auto;
}

.trending-header {
    text-align: center;
    margin-bottom: 40px;
}

.trending-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    color: var(--primary-dark);
    margin-bottom: 15px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.trending-subtitle {
    font-size: clamp(1rem, 1.5vw, 1.2rem);
    color: var(--text-light);
    margin-bottom: 30px;
}

/* ===== NAVIGATION PAR ONGLETS ===== */
.trending-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.tab-item {
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
    color: var(--text);
    background-color: var(--white);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.tab-item:hover {
    background-color: var(--bg-light);
    transform: translateY(-3px);
    color: var(--primary);
}

.tab-item.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    box-shadow: 0 6px 15px rgba(138, 79, 255, 0.2);
}

/* ===== FILTRES ET HEADERS DE SECTION ===== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.section-header h2 {
    font-size: clamp(1.5rem, 3vw, 1.8rem);
    font-weight: 700;
    color: var(--primary-dark);
    position: relative;
}

.section-header h2::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -10px;
    width: 40px;
    height: 3px;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    border-radius: 1.5px;
}

.trending-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 500;
    background-color: var(--white);
    color: var(--text);
    border: 1px solid rgba(138, 79, 255, 0.2);
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn:hover {
    background-color: var(--bg-light);
    color: var(--primary);
    border-color: var(--primary-light);
}

.filter-btn.active {
    background-color: var(--primary);
    color: var(--white);
    border-color: var(--primary);
    box-shadow: 0 4px 10px rgba(138, 79, 255, 0.2);
}

/* ===== GRILLE DES CHANSONS TENDANCES ===== */
.trending-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 25px;
    margin-bottom: 60px;
}

.song-card {
    background-color: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
    position: relative;
    opacity: 0;
    animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.song-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--card-shadow);
}

.song-rank-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    z-index: 2;
    box-shadow: 0 3px 8px rgba(138, 79, 255, 0.3);
}

.song-cover {
    position: relative;
    height: 0;
    padding-bottom: 100%; /* Aspect ratio 1:1 */
    overflow: hidden;
}

.song-cover img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.song-card:hover .song-cover img {
    transform: scale(1.05);
}

.play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.song-card:hover .play-overlay {
    opacity: 1;
}

.play-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--primary);
    color: var(--white);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: var(--transition);
}

.play-button:hover {
    transform: scale(1.1);
    background-color: var(--primary-dark);
}

.song-info-overlay {
    position: absolute;
    bottom: 10px;
    right: 10px;
    z-index: 2;
}

.song-stats {
    display: flex;
    gap: 8px;
}

.song-views, .song-likes {
    display: inline-flex;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.6);
    color: var(--white);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.song-views i, .song-likes i {
    margin-right: 5px;
    font-size: 0.7rem;
}

.song-likes {
    background-color: var(--secondary);
}

.song-views {
    background-color: var(--primary);
}

.song-info {
    padding: 15px;
}

.song-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-creator {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 12px;
}

.song-creator a {
    color: var(--text-light);
    transition: var(--transition);
}

.song-creator a:hover {
    color: var(--primary);
}

.admin-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    font-size: 0.65rem;
    font-weight: bold;
    padding: 2px 5px;
    border-radius: 4px;
    margin-left: 5px;
    vertical-align: middle;
}

.song-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.song-style {
    background-color: var(--bg-light);
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
}

.song-date {
    font-size: 0.75rem;
    color: var(--text-light);
}

/* ===== SECTION ÉTOILES MONTANTES ===== */
.rising-stars-section {
    margin-bottom: 60px;
}

.rising-header-info {
    display: flex;
    align-items: center;
}

.rising-info-tag {
    display: inline-flex;
    align-items: center;
    background-color: var(--bg-light);
    color: var(--primary);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.rising-info-tag i {
    margin-right: 8px;
    color: var(--secondary);
}

.rising-carousel {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Pour Firefox */
    -ms-overflow-style: none; /* Pour IE et Edge */
    padding: 10px 0;
    scroll-behavior: smooth;
    cursor: grab;
}

.rising-carousel::-webkit-scrollbar {
    display: none; /* Pour Chrome, Safari et Opera */
}

.rising-carousel.active {
    cursor: grabbing;
}

.rising-carousel .song-card {
    flex: 0 0 auto;
    width: 240px;
    scroll-snap-align: start;
}

.rising-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #FF7BAC 0%, #FF5C8D 100%);
    color: var(--white);
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    z-index: 2;
    box-shadow: 0 3px 8px rgba(255, 123, 172, 0.3);
    display: flex;
    align-items: center;
}

.rising-indicator i {
    margin-right: 5px;
    font-size: 0.7rem;
}

/* ===== SECTION STYLES POPULAIRES ===== */
.styles-section {
    margin-bottom: 60px;
}

.styles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

.style-card {
    background-color: var(--white);
    border-radius: var(--radius);
    padding: 25px 15px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.style-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--card-shadow);
}

.style-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    color: var(--white);
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    box-shadow: 0 5px 15px rgba(138, 79, 255, 0.2);
    transition: var(--transition);
}

.style-card:hover .style-icon {
    transform: scale(1.1);
}

.style-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.style-count {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* ===== WEEKLY CHART STYLES ===== */
.chart-container {
    background-color: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--card-shadow);
    margin-bottom: 50px;
}

.chart-header {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    background-color: var(--primary-dark);
    color: var(--white);
    font-weight: 600;
    font-size: 0.9rem;
}

.chart-col {
    padding: 0 10px;
}

.rank-col {
    flex: 0 0 50px;
    text-align: center;
}

.info-col {
    flex: 1;
    min-width: 0; /* Pour que le texte puisse être tronqué */
    display: flex;
    align-items: center;
}

.style-col {
    flex: 0 0 120px;
    text-align: center;
}

.stats-col {
    flex: 0 0 150px;
    text-align: center;
}

.action-col {
    flex: 0 0 100px;
    text-align: center;
}

.chart-list {
    max-height: 800px;
    overflow-y: auto;
}

.chart-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: var(--transition);
    opacity: 0;
    transform: translateY(20px);
}

.chart-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.chart-item:hover {
    background-color: var(--bg-light);
}

.rank-number {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary-dark);
}

.song-image {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-right: 15px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

.song-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.song-details {
    min-width: 0;
}

.chart-song-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chart-song-artist {
    font-size: 0.85rem;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chart-style-tag {
    display: inline-block;
    background-color: var(--bg-light);
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 20px;
}

.chart-stats {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.85rem;
}

.stat-item i {
    font-size: 1rem;
    margin-bottom: 5px;
    color: var(--primary);
}

.chart-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.chart-play-btn, .chart-add-playlist-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.chart-play-btn {
    background-color: var(--primary);
    color: var(--white);
}

.chart-play-btn:hover {
    background-color: var(--primary-dark);
    transform: scale(1.1);
}

.chart-add-playlist-btn {
    background-color: var(--bg-light);
    color: var(--primary);
}

.chart-add-playlist-btn:hover {
    background-color: var(--secondary);
    color: var(--white);
    transform: scale(1.1);
}

.chart-add-playlist-btn.clicked {
    animation: pulse 0.3s ease;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

/* ===== ARTISTS SPOTLIGHT STYLES ===== */
.artists-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.artist-card {
    background-color: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    opacity: 0;
    transform: translateY(30px);
}

.artist-card.visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.artist-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 25px rgba(138, 79, 255, 0.15);
}

.artist-banner {
    height: 120px;
    position: relative;
}

.artist-avatar {
    position: absolute;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid var(--white);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.artist-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.artist-info {
    padding: 60px 20px 20px;
    text-align: center;
}

.artist-name {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.artist-name a {
    color: var(--text);
    transition: var(--transition);
}

.artist-name a:hover {
    color: var(--primary);
}

.artist-stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.artist-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text-light);
}

.artist-stat i {
    font-size: 1.2rem;
    margin-bottom: 5px;
    color: var(--primary);
}

.artist-top-song {
    margin: 20px 0;
    padding: 15px;
    background-color: var(--bg-light);
    border-radius: var(--radius-sm);
}

.top-song-header {
    font-size: 0.9rem;
    color: var(--text);
    margin-bottom: 10px;
    font-weight: 600;
}

.top-song-card {
    display: flex;
    align-items: center;
    gap: 10px;
}

.top-song-cover {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}

.top-song-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.top-song-play-btn {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    opacity: 0;
    transition: var(--transition);
    cursor: pointer;
}

.top-song-cover:hover .top-song-play-btn {
    opacity: 1;
}

.top-song-info {
    flex: 1;
    text-align: left;
    min-width: 0;
}

.top-song-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top-song-style {
    font-size: 0.8rem;
    color: var(--text-light);
}

.view-profile-btn {
    display: inline-block;
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    font-weight: 600;
    border-radius: 30px;
    font-size: 0.9rem;
    transition: var(--transition);
    margin-top: 15px;
}

.view-profile-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(138, 79, 255, 0.3);
}

/* ===== MEDIA QUERIES POUR RESPONSIVE ===== */
@media (max-width: 991px) {
    .trending-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
    
    .artists-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .styles-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .style-col {
        display: none;
    }
}

@media (max-width: 768px) {
    .trending-header {
        padding: 0 10px;
    }
    
    .trending-tabs {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 10px;
        margin-left: -10px;
        margin-right: -10px;
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .trending-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .styles-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .stats-col {
        display: none;
    }
    
    .song-rank-badge {
        width: 25px;
        height: 25px;
        font-size: 0.8rem;
    }
    
    .chart-stats {
        flex-direction: column;
        gap: 5px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .trending-filters {
        width: 100%;
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 10px;
    }
}

@media (max-width: 576px) {
    .trending-container {
        padding: 20px 15px;
    }
    
    .trending-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .rising-carousel .song-card {
        width: 180px;
    }
    
    .styles-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .song-title {
        font-size: 0.95rem;
    }
    
    .song-creator {
        font-size: 0.8rem;
    }
    
    .song-style, .song-date {
        font-size: 0.7rem;
    }
    
    .play-button {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .chart-item {
        padding: 12px 10px;
    }
    
    .song-image {
        width: 40px;
        height: 40px;
    }
    
    .action-col {
        flex: 0 0 80px;
    }
    
    .artists-grid {
        grid-template-columns: 1fr;
    }
    
    .chart-song-title {
        font-size: 0.9rem;
    }
    
    .chart-song-artist {
        font-size: 0.8rem;
    }
}