/* ===== TRENDING ===== */

.trd-main {
    max-width: 860px;
    margin: 80px auto 40px;
    padding: 0 16px;
}

.trd-header {
    text-align: center;
    margin-bottom: 24px;
}

.trd-header h1 {
    font-size: 1.8rem;
    font-weight: 800;
    margin: 0 0 6px;
    background: linear-gradient(135deg, #f59e0b, #ef4444, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.trd-header h1 i { -webkit-text-fill-color: #f59e0b; }

.trd-header p {
    color: rgba(255,255,255,0.45);
    margin: 0;
    font-size: 0.9rem;
}

/* Filters */
.trd-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 16px;
}

.trd-filter-btn {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.6);
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
}

.trd-filter-btn:hover {
    background: rgba(255,255,255,0.07);
    color: #fff;
}

.trd-filter-btn.active {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    border-color: transparent;
    color: #fff;
}

.trd-meta {
    text-align: center;
    color: rgba(255,255,255,0.35);
    font-size: 0.75rem;
    margin-bottom: 28px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* List */
.trd-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.trd-card {
    display: flex;
    gap: 14px;
    align-items: center;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 10px 14px 10px 10px;
    cursor: pointer;
    transition: all 0.2s;
    overflow: hidden;
}

.trd-card:hover {
    background: rgba(255,255,255,0.05);
    border-color: rgba(239,68,68,0.25);
    transform: translateY(-2px);
}

.trd-pos {
    font-size: 1.4rem;
    font-weight: 800;
    color: rgba(255,255,255,0.35);
    min-width: 36px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.trd-card:nth-child(1) .trd-pos { color: #f59e0b; }
.trd-card:nth-child(2) .trd-pos { color: #cbd5e1; }
.trd-card:nth-child(3) .trd-pos { color: #b45309; }

.trd-poster, .trd-poster-ph {
    width: 60px;
    height: 90px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.trd-poster-ph {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.4);
    font-size: 1.6rem;
}

.trd-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.trd-type {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    width: fit-content;
}

.trd-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.trd-stats {
    display: flex;
    gap: 12px;
    font-size: 0.72rem;
    color: rgba(255,255,255,0.5);
}

.trd-stats i { margin-right: 4px; }

.trd-rating { color: #f59e0b; font-weight: 600; }

/* Loading & Empty */
.trd-loading, .trd-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: rgba(255,255,255,0.4);
    gap: 12px;
    text-align: center;
}

.trd-loading i, .trd-empty i {
    font-size: 2.5rem;
    color: #f59e0b;
}

@media (max-width: 480px) {
    .trd-main { margin-top: 70px; padding: 0 10px; }
    .trd-card { padding: 8px 10px 8px 6px; gap: 10px; }
    .trd-pos { font-size: 1.2rem; min-width: 28px; }
    .trd-poster, .trd-poster-ph { width: 52px; height: 78px; }
    .trd-title { font-size: 0.88rem; }
}

/* Light theme: surfaces, content and interaction states. */
:is(html.light-theme-early, body.light-theme) .trd-header p,
:is(html.light-theme-early, body.light-theme) .trd-meta,
:is(html.light-theme-early, body.light-theme) .trd-pos,
:is(html.light-theme-early, body.light-theme) .trd-stats,
:is(html.light-theme-early, body.light-theme) .trd-loading,
:is(html.light-theme-early, body.light-theme) .trd-empty {
    color: var(--text-muted, #526070);
}

:is(html.light-theme-early, body.light-theme) .trd-title {
    color: var(--text, #1e293b);
}

:is(html.light-theme-early, body.light-theme) .trd-card {
    background: var(--surface, #fff); border-color: var(--border, rgba(30, 41, 59, .12));
}

:is(html.light-theme-early, body.light-theme) .trd-filter-btn,
:is(html.light-theme-early, body.light-theme) .trd-poster-ph {
    background: var(--surface2, #f8f7f3); border-color: var(--border, rgba(30, 41, 59, .12)); color: var(--text-muted, #526070);
}

:is(html.light-theme-early, body.light-theme) .trd-card:hover,
:is(html.light-theme-early, body.light-theme) .trd-filter-btn:hover {
    background: #edeaf5; border-color: rgba(109, 40, 217, .22); color: var(--text, #1e293b);
}

:is(html.light-theme-early, body.light-theme) .trd-filter-btn.active {
    background: linear-gradient(135deg, #c2410c, #be185d); color: #fff; border-color: transparent;
}

:is(html.light-theme-early, body.light-theme) .trd-rating,
:is(html.light-theme-early, body.light-theme) .trd-card:nth-child(1) .trd-pos {
    color: var(--accent-ink, #806117);
}

:is(html.light-theme-early, body.light-theme) .trd-card:nth-child(2) .trd-pos {
    color: #64748b;
}

:is(html.light-theme-early, body.light-theme) .trd-card:nth-child(3) .trd-pos {
    color: #92400e;
}

:is(html.light-theme-early, body.light-theme) .trd-header h1 { background-image: linear-gradient(135deg, #a16207, #b91c1c, #be185d); }
:is(html.light-theme-early, body.light-theme) .trd-header h1 i { -webkit-text-fill-color: #a16207; }

:is(html.light-theme-early, body.light-theme) .trd-loading i,
:is(html.light-theme-early, body.light-theme) .trd-empty i { color: var(--accent-ink, #806117); }
