/*
========================================
File: trending-page-pro-v2.css
========================================
*/

/* --- Page Header (Reutilizado) --- */
.page-header--trends {
    text-align: center;
    padding: var(--spacing-8) 0;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: var(--spacing-10);
}

.page-header--trends .page-header__icon-wrapper {
    display: inline-block;
    padding: var(--spacing-3);
    background-color: var(--color-primary-darker);
    border-radius: var(--border-radius-full);
    margin-bottom: var(--spacing-4);
    box-shadow: 0 0 20px var(--color-primary-darker);
}

.page-header--trends .page-header__icon {
    color: var(--color-primary);
    font-size: var(--fs-4xl);
}

.page-header--trends .page-header__title {
    font-size: var(--fs-4xl);
    font-weight: 800;
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-2);
}

.page-header--trends .page-header__subtitle {
    max-width: 600px;
    margin: 0 auto;
    font-size: var(--fs-lg);
    color: var(--color-text-secondary);
}

@media (min-width: 768px) {
    .page-header--trends .page-header__title {
        font-size: var(--fs-5xl);
    }
}

/* --- Filtros (Reutilizado) --- */
.filters-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--spacing-2);
    margin-bottom: var(--spacing-10);
}

/* --- Filtros --- */
.filters-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--spacing-2);
    margin-bottom: var(--spacing-10);
}

.filter-chip {
    background-color: var(--color-bg-content);
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
    padding: var(--spacing-1) var(--spacing-4);
    border-radius: var(--border-radius-full);
    font-size: var(--fs-sm);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}

.filter-chip:hover:not(.active) {
    background-color: var(--color-bg-elevated);
    border-color: var(--color-text-tertiary);
}

.filter-chip.active {
    background-color: var(--color-primary);
    color: var(--color-bg-dark);
    border-color: var(--color-primary);
}

.filter-tabs {
    display: flex;
    justify-content: center;
    gap: var(--spacing-6);
    margin-bottom: var(--spacing-10);
    border-bottom: 1px solid var(--color-border);
}

.filter-tabs__btn {
    background: none;
    border: none;
    color: var(--color-text-secondary);
    padding: var(--spacing-2) 0 var(--spacing-4);
    font-size: var(--fs-base);
    font-weight: 500;
    cursor: pointer;
    position: relative;
    transition: color 0.2s ease;
}

.filter-tabs__btn:hover {
    color: var(--color-text-primary);
}

.filter-tabs__btn.active {
    color: var(--color-primary);
}

.filter-tabs__btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    /* Alinha com a borda do container */
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--color-primary);
}

/* --- Lista de Trends Sofisticada --- */
.trends-list {
    display: flex;
    flex-direction: column;
}

/* Cabeçalho da Lista (visível apenas em desktop) */
.trends-list__header {
    display: none;
    /* Escondido por padrão */
    padding: 0 var(--spacing-6);
    margin-bottom: var(--spacing-2);
    font-size: var(--fs-xs);
    text-transform: uppercase;
    color: var(--color-text-tertiary);
    letter-spacing: 0.05em;
    display: grid;
    grid-template-columns: 3rem 1fr 1fr 100px;
    gap: var(--spacing-4);
    align-items: center;
}

@media (max-width: 767px) {
    .trends-list__header {
        display: none;
    }
}

/* Item da Lista de Trend */
.trend-list-item {
    display: grid;
    grid-template-columns: 3rem 1fr auto;
    /* Mobile: Rank, Info, Opções */
    gap: var(--spacing-4);
    align-items: center;
    padding: var(--spacing-3) var(--spacing-4);
    border-radius: var(--border-radius-lg);
    border: 1px solid transparent;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.trend-list-item:hover {
    background-color: var(--color-bg-content);
    border-color: var(--color-border);
}

.trend-list-item__rank {
    font-size: var(--fs-lg);
    font-weight: 600;
    color: var(--color-text-tertiary);
    text-align: center;
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
}

.trend-list-item__rank-indicator {
    font-size: var(--fs-sm);
}

.trend-list-item__rank-indicator--up {
    color: var(--color-primary);
}

.trend-list-item__rank-indicator--down {
    color: #EF4444;
}

/* red-500 */
.trend-list-item__rank-indicator--same {
    color: var(--color-text-tertiary);
}

/* Destaque para Top 3 */
.trend-list-item--top1 .trend-list-item__rank {
    color: #FBBF24;
}

/* yellow-400 */
.trend-list-item--top2 .trend-list-item__rank {
    color: #9CA3AF;
}

/* gray-400 */
.trend-list-item--top3 .trend-list-item__rank {
    color: #A16207;
}

/* yellow-700 */

.trend-list-item__main {
    display: flex;
    align-items: center;
    gap: var(--spacing-4);
    overflow: hidden;
}

.trend-list-item__image {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: var(--border-radius-sm);
    flex-shrink: 0;
}

.trend-list-item__info {
    overflow: hidden;
}

.trend-list-item__title {
    font-weight: 600;
    color: var(--color-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.trend-list-item__artist {
    font-size: var(--fs-sm);
    color: var(--color-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.trend-list-item__stats {
    display: none;
    /* Escondido em mobile */
    font-size: var(--fs-sm);
    color: var(--color-text-secondary);
    text-align: right;
}

.trend-list-item__stats i {
    vertical-align: middle;
    margin-right: var(--spacing-1);
}

.trend-list-item__actions {
    opacity: 0;
    transition: var(--transition-fast);
}

.trend-list-item:hover .trend-list-item__actions {
    opacity: 1;
}

@media (min-width: 768px) {
    .trend-list-item {
        grid-template-columns: 3rem 2fr 1fr auto;
    }

    .trend-list-item__stats {
        display: block;
    }
}

@media (min-width: 1024px) {
    .trend-list-item {
        padding: var(--spacing-4) var(--spacing-6);
    }
}

/*
========================================
File: trending-page-premium.css
========================================
*/

/* --- Page Header (Reutilizado) --- */
/* ... (código do page-header da resposta anterior) ... */
/* --- Filtros (Reutilizado) --- */
/* ... (código dos filter-chip da resposta anterior) ... */

/* --- Layout Principal da Página --- */
.trends-layout {
    display: grid;
    grid-template-columns: 1fr;
    /* Mobile First */
    gap: var(--spacing-10);
}

@media (min-width: 1024px) {

    /* lg */
    .trends-layout {
        grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
    }
}

/* --- Lista de Trends --- */
.trends-list-pro {
    display: flex;
    flex-direction: column;
}

.trends-list-pro__header {
    display: none;
    /* Escondido, a UI é mais visual */
}

.trend-item-pro {
    display: grid;
    grid-template-columns: 3rem 50px 1fr auto;
    gap: var(--spacing-4);
    align-items: center;
    padding: var(--spacing-3);
    border-bottom: 1px solid var(--color-border);
    cursor: pointer;
    position: relative;
}

.trend-item-pro::before {
    /* Indicador de hover/ativo */
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background-color: var(--color-primary);
    transform: scaleY(0);
    transition: transform 0.2s ease;
    border-radius: 0 3px 3px 0;
}

.trend-item-pro:hover::before,
.trend-item-pro.active::before {
    transform: scaleY(1);
}

.trend-item-pro.active {
    background-color: var(--color-bg-content);
}

.trend-item-pro__rank {
    font-size: var(--fs-lg);
    font-weight: 600;
    color: var(--color-text-tertiary);
    text-align: center;
}

.trend-item-pro__image {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: var(--border-radius-sm);
}

.trend-item-pro__info {
    overflow: hidden;
}

.trend-item-pro__title {
    font-weight: 600;
    color: var(--color-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.trend-item-pro__artist {
    font-size: var(--fs-sm);
    color: var(--color-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.trend-item-pro__stats {
    display: none;
    /* Escondido por padrão, aparece em telas maiores */
    font-size: var(--fs-sm);
    color: var(--color-text-secondary);
    text-align: right;
}

.trend-item-pro__stats i {
    vertical-align: middle;
}

@media (min-width: 768px) {
    .trend-item-pro {
        grid-template-columns: 3rem 50px 1fr 100px;
    }

    .trend-item-pro__stats {
        display: block;
    }
}

/* --- Painel de Detalhes (Direita) --- */
.details-panel {
    position: sticky;
    top: 6rem;
    /* Altura do header + espaçamento */
    background-color: var(--color-bg-content);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-6);
    display: none;
    /* Escondido em mobile */
}

@media (min-width: 1024px) {
    .details-panel {
        display: flex;
        flex-direction: column;
    }
}

.details-panel__artwork {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: var(--border-radius-md);
    object-fit: cover;
    margin-bottom: var(--spacing-6);
}

.details-panel__title {
    font-size: var(--fs-2xl);
    font-weight: 700;
    color: var(--color-text-primary);
    line-height: 1.2;
}

.details-panel__artist {
    font-size: var(--fs-lg);
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-6);
}

.details-panel__chart-label {
    font-size: var(--fs-xs);
    color: var(--color-text-tertiary);
    margin-bottom: var(--spacing-1);
}

.details-panel__chart {
    /* Gráfico simulado */
    height: 60px;
    background-color: var(--color-bg-elevated);
    border-radius: var(--border-radius-sm);
    margin-bottom: var(--spacing-6);
    display: flex;
    align-items: flex-end;
    padding: var(--spacing-2);
}

.details-panel__chart-bar {
    background-color: var(--color-primary);
    width: 20%;
    margin-right: 5%;
    border-radius: 2px 2px 0 0;
    animation: growBar 1s ease-out;
}

@keyframes growBar {
    from {
        height: 0;
    }
}

.details-panel__actions {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-3);
}


/* --- Modal "Bottom Sheet" para Mobile --- */
.bottom-sheet-modal {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--color-bg-content);
    border-top: 1px solid var(--color-border);
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
    padding: var(--spacing-4);
    z-index: 60;
    max-height: 80vh;
    overflow-y: auto;

    transform: translateY(100%);
    transition: transform 0.3s ease-out;
}

.bottom-sheet-modal.open {
    transform: translateY(0);
}

.bottom-sheet-modal__handle {
    width: 40px;
    height: 4px;
    background-color: var(--color-border);
    border-radius: var(--border-radius-full);
    margin: 0 auto var(--spacing-4);
}

.bottom-sheet-modal__header {
    display: flex;
    gap: var(--spacing-4);
    align-items: center;
    margin-bottom: var(--spacing-6);
}

.bottom-sheet-modal__image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--border-radius-md);
    flex-shrink: 0;
}

.bottom-sheet-modal__title {
    font-size: var(--fs-xl);
    font-weight: 700;
    color: var(--color-text-primary);
}

.bottom-sheet-modal__artist {
    font-size: var(--fs-base);
    color: var(--color-text-secondary);
}

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 59;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}