.trends-page {
    min-height: calc(100vh - 2rem);
    color: #f8fafc;
    background: #0d1117;
}

.trends-page-authenticated {
    padding: 2rem 1rem 5rem;
    padding-top: 5rem;
}

.trends-page-guest {
    padding: 7rem 1rem 5rem;
}

.trends-shell {
    width: min(100%, 1540px);
    margin: 0 auto;
}

.trends-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.75rem;
}

.trends-eyebrow {
    color: #a78bfa;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.trends-title {
    margin: 0.35rem 0 0;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.04em;
}

.trends-subtitle {
    max-width: 44rem;
    margin: 0.65rem 0 0;
    color: #94a3b8;
    font-size: 0.98rem;
    line-height: 1.6;
}

.trends-toolbar {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 3.1rem;
    margin-bottom: 1.25rem;
    padding: 0.35rem;
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 0.85rem;
    background: rgba(22, 27, 34, 0.84);
}

.trends-tab,
.trends-sort-select,
.trends-load-more {
    border: 1px solid transparent;
    border-radius: 0.65rem;
    color: #94a3b8;
    background: transparent;
    transition: 160ms ease;
}

.trends-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 2.35rem;
    padding: 0.45rem 0.85rem;
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
}

.trends-tab:hover,
.trends-tab.is-active {
    color: #fff;
    border-color: rgba(168, 85, 247, 0.42);
    background: linear-gradient(135deg, rgba(126, 34, 206, 0.38), rgba(79, 70, 229, 0.28));
}

.trends-tab-icon {
    color: #c4b5fd;
    font-size: 1rem;
}

.trends-toolbar-spacer {
    flex: 1;
}

.trends-sort-label {
    color: #64748b;
    font-size: 0.75rem;
}

.trends-sort-select {
    min-height: 2.35rem;
    margin-right: 0.1rem;
    padding: 0.35rem 0.65rem;
    color: #e2e8f0;
    border-color: rgba(100, 116, 139, 0.32);
    background: #111827;
    cursor: pointer;
}

.trends-status {
    min-height: 1.4rem;
    margin-bottom: 0.7rem;
    color: #94a3b8;
    font-size: 0.82rem;
}

.trends-status.is-error {
    color: #fda4af;
}

.trends-grid {
    column-count: 1;
    column-gap: 1rem;
}

.trend-card {
    position: relative;
    display: inline-block;
    width: 100%;
    margin: 0 0 1rem;
    overflow: hidden;
    break-inside: avoid;
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 1rem;
    background: #161b22;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.16);
    vertical-align: top;
}

.trend-card:hover {
    border-color: rgba(168, 85, 247, 0.58);
    box-shadow: 0 18px 44px rgba(76, 29, 149, 0.2);
}

.trend-card-media {
    position: relative;
    overflow: hidden;
    background: #090d12;
    cursor: pointer;
}

.trend-card-media img,
.trend-card-media video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.trend-card-media img {
    transition: transform 280ms ease;
}

.trend-card:hover .trend-card-media img {
    transform: scale(1.035);
}

.trend-card-gradient {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(2, 6, 23, 0.1) 30%, rgba(2, 6, 23, 0.86) 100%);
}

.trend-card-topline {
    position: absolute;
    top: 0.7rem;
    left: 0.7rem;
    right: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    pointer-events: none;
}

.trend-badge,
.trend-media-badge {
    display: inline-flex;
    align-items: center;
    min-height: 1.7rem;
    padding: 0.25rem 0.55rem;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    color: #f8fafc;
    background: rgba(15, 23, 42, 0.74);
    backdrop-filter: blur(10px);
    font-size: 0.68rem;
    font-weight: 700;
}

.trend-volume-control {
    position: absolute;
    top: 0.65rem;
    right: 0.65rem;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    color: #fff;
    background: rgba(15, 23, 42, 0.78);
    opacity: 0;
    cursor: pointer;
    transition: opacity 160ms ease, background 160ms ease;
}

.trend-card:hover .trend-volume-control,
.trend-volume-control:focus-visible {
    opacity: 1;
}

.trend-volume-control:hover {
    background: rgba(124, 58, 237, 0.9);
}

.trend-card-bottom {
    position: absolute;
    right: 0.85rem;
    bottom: 0.85rem;
    left: 0.85rem;
    z-index: 2;
}

.trend-card-title {
    margin: 0 0 0.45rem;
    color: #fff;
    font-size: 1rem;
    font-weight: 750;
    line-height: 1.25;
}

.trend-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
    color: #cbd5e1;
    font-size: 0.72rem;
}

.trend-use-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.1rem;
    padding: 0.42rem 0.8rem;
    border: 1px solid rgba(196, 181, 253, 0.35);
    border-radius: 0.65rem;
    color: #fff;
    background: linear-gradient(135deg, rgba(126, 34, 206, 0.9), rgba(79, 70, 229, 0.9));
    font-size: 0.76rem;
    font-weight: 700;
    text-decoration: none;
    transition: transform 160ms ease, filter 160ms ease;
}

.trend-use-button:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.trends-empty {
    padding: 5rem 1rem;
    color: #94a3b8;
    text-align: center;
}

.trends-empty h2 {
    margin: 0.75rem 0 0.35rem;
    color: #e2e8f0;
    font-size: 1.35rem;
}

.trends-empty p {
    margin: 0;
    font-size: 0.9rem;
}

.trends-empty-icon {
    color: #c4b5fd;
    font-size: 2rem;
}

.trends-load-more-wrap {
    display: flex;
    justify-content: center;
    padding: 1rem 0 2rem;
}

.trends-load-more {
    padding: 0.65rem 1rem;
    color: #e9d5ff;
    border-color: rgba(168, 85, 247, 0.35);
    background: rgba(126, 34, 206, 0.18);
    cursor: pointer;
}

.trends-load-more:hover {
    background: rgba(126, 34, 206, 0.35);
}

.trend-preview-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.trend-preview-modal.hidden,
.hidden {
    display: none !important;
}

.trend-preview-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, 0.84);
    backdrop-filter: blur(10px);
}

.trend-preview-sheet {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
    width: min(100%, 920px);
    max-height: min(92vh, 760px);
    overflow: hidden;
    border: 1px solid rgba(168, 85, 247, 0.35);
    border-radius: 1.1rem;
    background: #0f172a;
    box-shadow: 0 24px 90px rgba(0, 0, 0, 0.5);
}

.trend-preview-media {
    position: relative;
    min-height: 360px;
    background: #020617;
}

.trend-preview-media img,
.trend-preview-media video {
    display: block;
    width: 100%;
    height: 100%;
    max-height: 80vh;
    object-fit: contain;
}

.trend-preview-volume {
    top: 0.9rem;
    right: 0.9rem;
    opacity: 1;
}

.trend-preview-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2rem;
}

.trend-preview-kicker {
    color: #c4b5fd;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.trend-preview-title {
    margin: 0.5rem 0;
    color: #fff;
    font-size: clamp(1.4rem, 3vw, 2rem);
    line-height: 1.15;
}

.trend-preview-description {
    color: #cbd5e1;
    font-size: 0.9rem;
    line-height: 1.6;
    white-space: pre-wrap;
}

.trend-preview-source {
    margin-top: 1rem;
    color: #94a3b8;
    font-size: 0.78rem;
}

.trend-preview-source a {
    color: #c4b5fd;
}

.trend-preview-use {
    width: 100%;
    margin-top: 1.5rem;
}

.trend-preview-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 3;
    width: 2.2rem;
    height: 2.2rem;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    color: #fff;
    background: rgba(2, 6, 23, 0.7);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

@media (min-width: 640px) {
    .trends-grid {
        column-count: 2;
    }
}

@media (min-width: 1024px) {
    .trends-page-authenticated {
        padding-right: 2rem;
        padding-left: 5rem;
    }

    .trends-grid {
        column-count: 3;
    }
}

@media (min-width: 1400px) {
    .trends-grid {
        column-count: 4;
    }
}

@media (hover: none) {
    .trend-volume-control {
        opacity: 1;
    }
}

@media (max-width: 700px) {
    .trends-page-authenticated,
    .trends-page-guest {
        padding-right: 0.75rem;
        padding-left: 0.75rem;
    }

    .trends-toolbar {
        flex-wrap: wrap;
    }

    .trends-toolbar-spacer {
        display: none;
    }

    .trends-sort-label {
        margin-left: auto;
    }

    .trend-preview-modal {
        align-items: flex-end;
        padding: 0;
    }

    .trend-preview-sheet {
        grid-template-columns: 1fr;
        width: 100%;
        max-height: 92vh;
        border-right: 0;
        border-bottom: 0;
        border-radius: 1.1rem 1.1rem 0 0;
    }

    .trend-preview-media {
        min-height: 0;
        max-height: 56vh;
    }

    .trend-preview-body {
        padding: 1.25rem 1rem 1.5rem;
    }

    .trend-preview-description {
        max-height: 5rem;
        overflow: auto;
    }
}
