/* ============================================================
   TRENDING PAGE — Award-Winning Redesign
   Dark · Purple · Editorial · Glassmorphism
   ============================================================ */

@font-face {
    font-family: 'Delight';
    src: url('../Assets/delight-font-family/delight-extrabold.otf') format('opentype');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

/* Override global layout */
.trending-main {
    display: block;
    padding: 0;
    min-height: unset;
}

/* ---- Header: transparent over hero ---- */
.trending-page .header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: transparent;
    height: 64px;
    padding: 0 2rem;
    transition: background 0.3s ease, backdrop-filter 0.3s ease;
}

.trending-page .header.scrolled {
    position: fixed;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(178, 120, 255, 0.12);
}

/* ============================================================
   HERO SECTION
   ============================================================ */

.trending-hero {
    position: relative;
    min-height: 90vh;
    display: flex;
    align-items: center;
    overflow: hidden;
}

/* Background image */
.trending-hero__bg {
    position: absolute;
    inset: -3%;
    background: url('../images/background-headphone-person.png') center top / cover no-repeat;
    z-index: 0;
    will-change: transform;
}

/* Dark overlay — left-heavy so text is readable */
.trending-hero__overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(to right,  rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.55) 50%, rgba(0, 0, 0, 0.2) 100%),
        linear-gradient(to top,    rgba(0, 0, 0, 0.7)  0%, transparent 55%),
        linear-gradient(to bottom, rgba(0, 0, 0, 0.55) 0%, transparent 25%);
    pointer-events: none;
}

/* Bottom fade to page background */
.trending-hero__fade {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 180px;
    background: linear-gradient(to bottom, transparent, #000000);
    z-index: 3;
    pointer-events: none;
}

/* Hero content — left-aligned like home hero */
.trending-hero__content {
    position: relative;
    z-index: 2;
    padding: 8rem 4rem 4rem;
    max-width: 620px;
}

/* Label row */
.trending-hero__label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--accent-purple, #B278FF);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-bottom: 1.5rem;
}

.trending-fire-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

/* Headline */
.trending-hero__headline {
    font-family: 'Delight', 'Inter', sans-serif;
    font-size: clamp(3.5rem, 8vw, 7rem);
    font-weight: 800;
    color: #ffffff;
    line-height: 0.95;
    letter-spacing: -0.04em;
    margin-bottom: 1.25rem;
    text-wrap: balance;
}

.trending-hero__headline .accent {
    background: linear-gradient(135deg, #B278FF 0%, #7C3AED 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Sub */
.trending-hero__sub {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: rgba(255, 255, 255, 0.55);
    font-weight: 400;
    line-height: 1.6;
    max-width: 420px;
}

/* ============================================================
   SHARED SECTION ELEMENTS
   ============================================================ */

.trending-section-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 2rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.trending-section-label {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--accent-purple, #B278FF);
    text-transform: uppercase;
    letter-spacing: 0.22em;
    margin-bottom: 0.5rem;
}

.trending-section-headline {
    font-family: 'Delight', 'Inter', sans-serif;
    font-size: clamp(1.75rem, 3.5vw, 2.75rem);
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.trending-see-all {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.45);
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 0.45rem 1rem;
    border-radius: 20px;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}
.trending-see-all:hover {
    color: #fff;
    border-color: rgba(178, 120, 255, 0.45);
    background: rgba(178, 120, 255, 0.08);
}

/* ============================================================
   EVENTS SECTION
   ============================================================ */

.trending-events-section {
    padding: 0 4rem 6rem;
    max-width: 1400px;
    margin: 0 auto;
    box-sizing: content-box;
}

/* Events Grid */
.trending-events-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

/* Event Card */
.t-event-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(178, 120, 255, 0.1);
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.t-event-card:hover {
    border-color: rgba(178, 120, 255, 0.4);
    transform: translateY(-5px);
    box-shadow: 0 16px 40px rgba(178, 120, 255, 0.12);
}

.t-event-card__img-wrap {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: rgba(178, 120, 255, 0.06);
}
.t-event-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}
.t-event-card:hover .t-event-card__img { transform: scale(1.06); }

.t-event-card__body {
    padding: 0.75rem 0.9rem 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.t-event-card__date {
    font-size: 0.67rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #B278FF;
}
.t-event-card__title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.t-event-card__location {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.38);
    display: flex;
    align-items: center;
    gap: 0.3rem;
    overflow: hidden;
}
.t-event-card__location i { font-size: 0.65rem; flex-shrink: 0; }
.t-event-card__location span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-event-card__genres {
    font-size: 0.67rem;
    color: rgba(178, 120, 255, 0.8);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 0.1rem;
}

/* Loading dots */
.trending-events-loading {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 3rem 0;
}
.trending-events-loading span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(178, 120, 255, 0.5);
    animation: trendDotPulse 1.2s ease-in-out infinite;
}
.trending-events-loading span:nth-child(2) { animation-delay: 0.2s; }
.trending-events-loading span:nth-child(3) { animation-delay: 0.4s; }

@keyframes trendDotPulse {
    0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
    40%           { opacity: 1;   transform: scale(1.2); }
}

/* ============================================================
   MUSIC SECTION
   ============================================================ */

.trending-music-section {
    padding: 0 4rem 7rem;
    max-width: 1400px;
    margin: 0 auto;
    box-sizing: content-box;
}

/* Shazam hint */
.trending-shazam-hint {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(178, 120, 255, 0.7);
    border: 1px solid rgba(178, 120, 255, 0.25);
    padding: 0.45rem 1rem;
    border-radius: 20px;
    background: rgba(178, 120, 255, 0.06);
    flex-shrink: 0;
}

/* ---- Genre Filter Bar ---- */
.trending-filter-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.trending-filter-btn {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.45);
    padding: 7px 18px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.22s ease;
    font-family: inherit;
}
.trending-filter-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}
.trending-filter-btn.active {
    background: rgba(178, 120, 255, 0.2);
    border-color: rgba(178, 120, 255, 0.5);
    color: #B278FF;
}

/* ---- Song Chart ---- */
.song-chart {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Song Card — editorial numbered chart style */
.song-card {
    display: grid;
    grid-template-columns: 3rem 52px 1fr auto;
    align-items: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(178, 120, 255, 0.07);
    border-radius: 14px;
    padding: 14px 20px;
    cursor: pointer;
    transition: background 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
    position: relative;
    overflow: hidden;
}

.song-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 80% 80% at 0% 50%, rgba(178, 120, 255, 0.05) 0%, transparent 65%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}
.song-card:hover::before { opacity: 1; }

.song-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(178, 120, 255, 0.28);
    transform: translateX(4px);
}

/* Rank number */
.song-card__number {
    font-family: 'Delight', 'Inter', sans-serif;
    font-size: clamp(1.3rem, 2.5vw, 1.8rem);
    font-weight: 900;
    background: linear-gradient(135deg, #B278FF, #7C3AED);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0.55;
    line-height: 1;
    text-align: center;
    letter-spacing: -0.04em;
    transition: opacity 0.2s ease;
}
.song-card:hover .song-card__number { opacity: 1; }

/* Genre color block */
.song-card__cover {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    flex-shrink: 0;
}

/* Info */
.song-card__info {
    min-width: 0;
}
.song-card__title {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
}
.song-card__artist {
    display: block;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.42);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Genre tag */
.song-card__genre-tag {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
    letter-spacing: 0.04em;
}

/* Genre color schemes */
.song-card__cover--dance    { background: linear-gradient(135deg, #06b6d4, #3b82f6); }
.song-card__cover--hiphop   { background: linear-gradient(135deg, #f97316, #ef4444); }
.song-card__cover--pop      { background: linear-gradient(135deg, #ec4899, #8b5cf6); }
.song-card__cover--viral    { background: linear-gradient(135deg, #10b981, #06b6d4); }
.song-card__cover--default  { background: linear-gradient(135deg, #6D28D9, #4C1D95); }

.song-card__genre-tag--dance   { background: rgba(6, 182, 212, 0.15);   color: #22d3ee; border: 1px solid rgba(6, 182, 212, 0.3); }
.song-card__genre-tag--hiphop  { background: rgba(249, 115, 22, 0.15);  color: #fb923c; border: 1px solid rgba(249, 115, 22, 0.3); }
.song-card__genre-tag--pop     { background: rgba(236, 72, 153, 0.15);  color: #f472b6; border: 1px solid rgba(236, 72, 153, 0.3); }
.song-card__genre-tag--viral   { background: rgba(16, 185, 129, 0.15);  color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.song-card__genre-tag--default { background: rgba(178, 120, 255, 0.15); color: #B278FF; border: 1px solid rgba(178, 120, 255, 0.3); }

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1200px) {
    .trending-events-section,
    .trending-music-section {
        padding-left: 2.5rem;
        padding-right: 2.5rem;
    }
    .trending-events-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1024px) {
    .trending-hero__content {
        padding: 6rem 3rem 3rem;
    }
}

@media (max-width: 768px) {
    .trending-page .header {
        padding: 0 1.25rem;
    }
    .trending-hero {
        min-height: 80vh;
    }
    .trending-hero__content {
        padding: 5rem 1.5rem 3rem;
    }
    .trending-events-section,
    .trending-music-section {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
        padding-bottom: 4rem;
    }
    .trending-events-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .song-card {
        grid-template-columns: 2.5rem 44px 1fr auto;
        padding: 12px 14px;
        gap: 0.75rem;
    }
    .song-card__cover {
        width: 44px;
        height: 44px;
    }
    .trending-section-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .trending-events-grid {
        grid-template-columns: 1fr;
    }
    .trending-hero__headline { font-size: 3rem; }
    .song-card { grid-template-columns: 2.2rem 40px 1fr; }
    .song-card__genre-tag { display: none; }
}
