/* ============================================================
   Social Trend — Styles
   Matches the Next.js design: light card-based UI with RPN red
   ============================================================ */

/* Full-page "Đang thử nghiệm" overlay */
.st-page-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    background: rgba(255,255,255,0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.st-page-lock {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: #999;
    text-align: center;
}
.st-page-lock svg {
    opacity: 0.4;
}
.st-page-lock span {
    font-size: 18px;
    font-weight: 700;
    color: #666;
}
.st-page-lock p {
    font-size: 13px;
    color: #aaa;
    margin: 0;
}

/* ── Filter Bar ── */
.st-filter-bar {
    background: var(--color-surface, #fff);
    border-bottom: 1px solid var(--color-border, #ebebeb);
    padding: 0 24px;
    margin-bottom: 24px;
    border-radius: 12px 12px 0 0;
}
.st-filter-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 0;
}
.st-platform-tabs {
    display: flex;
    flex: 1;
    gap: 0;
}
.st-platform-tab {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 14px 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #888;
    border-bottom: 2.5px solid transparent;
    transition: all 0.15s ease;
    margin-bottom: -1px;
    white-space: nowrap;
    font-family: inherit;
}
.st-platform-tab.active {
    font-weight: 700;
    border-bottom-color: currentColor;
}
.st-platform-tab[data-platform="all"].active { color: #E23340; }
.st-platform-tab[data-platform="facebook"].active { color: #1877F2; }
.st-platform-tab[data-platform="tiktok"].active { color: #000; }

.st-timeframe-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
}
.st-timeframe-label {
    font-size: 12px;
    color: #bbb;
    margin-right: 4px;
}
.st-timeframe-group {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--color-surface-alt, #f5f5f5);
    border-radius: 10px;
    padding: 3px;
}
.st-timeframe-btn {
    padding: 5px 14px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    background: transparent;
    color: #888;
    transition: all 0.15s ease;
    font-family: inherit;
}
.st-timeframe-btn.active {
    background: #383636;
    color: #fff;
}

/* ── Page Header ── */
.st-page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 20px;
}
.st-page-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--color-text, #383636);
    margin-bottom: 4px;
}
.st-page-subtitle {
    font-size: 13px;
    color: #aaa;
    display: flex;
    align-items: center;
    gap: 6px;
}
.st-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.st-last-update {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #aaa;
    font-size: 12px;
}
.st-refresh-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1.5px solid #E23340;
    background: transparent;
    color: #E23340;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}
.st-refresh-btn:hover {
    background: #E23340;
    color: #fff;
}

/* ── Stats Bar ── */
.st-stats-bar {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}
.st-stat-card {
    background: var(--color-surface, #fff);
    border-radius: 14px;
    padding: 16px 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    gap: 12px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    cursor: default;
}
.st-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}
.st-stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 18px;
}
.st-stat-label {
    font-size: 11px;
    color: #aaa;
    font-weight: 600;
    margin-bottom: 2px;
}
.st-stat-value {
    font-size: 18px;
    font-weight: 800;
}

/* ── Top 10 Card ── */
.st-top10-card {
    background: var(--color-surface, #fff);
    border-radius: 16px;
    padding: 20px 20px 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    margin-bottom: 20px;
}
.st-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.st-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
}
.st-section-bar {
    width: 4px;
    height: 22px;
    background: #E23340;
    border-radius: 2px;
}
.st-section-title h2 {
    font-size: 17px;
    font-weight: 800;
    color: var(--color-text, #383636);
    margin: 0;
}
.st-section-meta {
    font-size: 12px;
    color: #bbb;
}

/* ── Top 3 Podium ── */
.st-podium {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 280px));
    gap: 36px;
    justify-content: center;
    margin-bottom: 24px;
}
.st-podium-card {
    position: relative;
    padding-left: 90px;
    text-decoration: none;
    display: block;
}
.st-podium-rank {
    position: absolute;
    left: -5px;
    bottom: 10px;
    font-size: 220px;
    font-weight: 900;
    line-height: 1;
    color: rgba(40,40,40,0.12);
    font-family: "Arial Black", Impact, sans-serif;
    user-select: none;
    pointer-events: none;
    z-index: 2;
    letter-spacing: -10px;
}
.st-podium-poster {
    position: relative;
    z-index: 1;
    border-radius: 16px;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 2/3;
    box-shadow: 0 10px 32px rgba(0,0,0,0.22);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.st-podium-poster:hover {
    transform: translateY(-5px);
    box-shadow: 0 18px 48px rgba(0,0,0,0.30);
}
.st-podium-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.st-podium-poster .st-no-poster {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #e8e8e8, #d0d0d0);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: #bbb;
}
.st-podium-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.90) 0%, rgba(0,0,0,0.45) 60%, transparent 100%);
    padding: 40px 14px 16px;
}
.st-podium-buzz {
    font-size: 28px;
    font-weight: 900;
    color: #fff;
    letter-spacing: -0.5px;
    margin-bottom: 5px;
    line-height: 1;
}
.st-podium-title {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255,255,255,0.85);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.35;
}

/* ── Vertical Bar Chart (rank 4-10) ── */
.st-vchart {
    display: flex;
    align-items: stretch;        /* all columns same height */
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
    padding: 0 8px 8px;
}
.st-vchart-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    max-width: 120px;
    min-width: 60px;
}
.st-vchart-buzz {
    font-size: 12px;
    font-weight: 700;
    color: #E23340;
    margin-bottom: 6px;
    white-space: nowrap;
    flex-shrink: 0;
}
.st-vchart-bar-wrap {
    width: 100%;
    flex: 1;                     /* absorb remaining space */
    min-height: 100px;
    display: flex;
    align-items: flex-end;       /* bars grow upward from bottom */
    justify-content: center;
}
.st-vchart-bar {
    width: 70%;
    min-height: 6px;
    border-radius: 6px 6px 0 0;
    transition: height 0.6s ease;
}
.st-vchart-poster {
    width: 44px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
    margin-top: 8px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
.st-vchart-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.st-vchart-rank {
    font-size: 11px;
    font-weight: 800;
    color: #ccc;
    margin-top: 4px;
    flex-shrink: 0;
}
.st-vchart-title {
    font-size: 10px;
    font-weight: 600;
    color: var(--color-text, #383636);
    text-align: center;
    margin-top: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
    max-width: 100%;
    min-height: 26px;            /* reserve 2-line height so all titles align */
    flex-shrink: 0;
}
.st-vchart-buzz--zero {
    color: #ccc;
    font-size: 11px;
}
.st-vchart-bar-empty {
    width: 70%;
    height: 2px;
    background: #eee;
    border-radius: 1px;
}
.st-vchart-col--empty .st-vchart-poster {
    opacity: 0.6;
}

/* ── Ranking Table ── */
.st-ranking-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.st-ranking-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}
.st-ranking-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--color-text, #383636);
}
.st-ranking-title span {
    color: #E23340;
    margin-left: 6px;
}
.st-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
}
.st-badge--red {
    background: #E23340;
    color: #fff;
}
.st-badge--green {
    background: #22c55e;
    color: #fff;
}
.st-ranking-meta {
    font-size: 12px;
    color: #bbb;
}

.st-ranking-table {
    background: var(--color-surface, #fff);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.st-ranking-thead {
    display: grid;
    grid-template-columns: 50px 1fr 120px 80px 80px 80px;
    padding: 12px 20px;
    background: var(--color-surface-alt, #fafafa);
    border-bottom: 1px solid #f0f0f0;
    font-size: 12px;
    font-weight: 700;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.st-ranking-thead div:nth-child(n+3) { text-align: right; }
.st-ranking-thead div:last-child { text-align: center; }

.st-ranking-row {
    display: grid;
    grid-template-columns: 50px 1fr 120px 80px 80px 80px;
    padding: 14px 20px;
    border-bottom: 1px solid #f8f8f8;
    align-items: center;
    transition: background 0.15s ease;
    cursor: default;
}
.st-ranking-row:hover {
    background: #fef7f7;
}
.st-ranking-row div:nth-child(n+3) { text-align: right; }
.st-ranking-row div:last-child { text-align: center; }

.st-rank-badge {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
}
.st-rank-badge--top {
    background: #E23340;
    color: #fff;
}
.st-rank-badge--normal {
    background: #f5f5f5;
    color: #999;
}

.st-movie-info {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
    text-align: left;
}
.st-movie-poster {
    width: 40px;
    height: 54px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}
.st-movie-poster--placeholder {
    width: 40px;
    height: 54px;
    border-radius: 6px;
    background: linear-gradient(135deg, #ffeef0, #FC9DA6);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 18px;
}
.st-movie-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--color-text, #383636);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin: 0 0 3px 0;
    padding: 0;
    text-align: left;
    transition: color 0.15s;
}
.st-movie-name:hover { color: #E23340; }
.st-movie-tags {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.st-status-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 20px;
}
.st-status-badge--showing {
    background: #fff0f1;
    color: #E23340;
}
.st-status-badge--coming {
    background: #f0faff;
    color: #0078b4;
}
.st-hashtag {
    font-size: 10px;
    color: #bbb;
    font-weight: 500;
}

.st-buzz-value {
    font-weight: 800;
}
.st-buzz-value--active { color: #E23340; font-size: 16px; }
.st-buzz-value--empty { color: #ccc; font-size: 14px; }
.st-buzz-breakdown {
    font-size: 10px;
    color: #bbb;
    margin-top: 1px;
}

.st-metric-value {
    font-size: 13px;
    font-weight: 500;
}
.st-metric-value--active { color: var(--color-text, #383636); }
.st-metric-value--empty { color: #ddd; }

.st-growth-badge {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 12px;
    font-weight: 700;
}
.st-growth-badge--up { color: #16a34a; }
.st-growth-badge--down { color: #E23340; }
.st-growth-badge--flat { color: #999; font-weight: 600; }

/* ── Footer Note ── */
.st-footer-note {
    margin-top: 24px;
    padding: 16px 20px;
    background: #fff8f8;
    border-radius: 12px;
    border: 1px solid #ffd0d5;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 12px;
    color: #888;
    line-height: 1.6;
}

/* ── Loading / Empty ── */
.st-loading, .st-empty {
    background: var(--color-surface, #fff);
    border-radius: 16px;
    padding: 60px 24px;
    text-align: center;
    color: #aaa;
    font-size: 14px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    margin-bottom: 20px;
}
.st-loading-icon, .st-empty-icon {
    font-size: 28px;
    margin-bottom: 12px;
}

/* ── No Buzz Section (compact list) ── */
.st-no-buzz-section {
    margin-top: 24px;
    margin-bottom: 20px;
}
.st-no-buzz-header {
    font-size: 13px;
    font-weight: 600;
    color: #bbb;
    margin-bottom: 12px;
    padding-left: 4px;
}
.st-no-buzz-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.st-no-buzz-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--color-surface, #fff);
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    padding: 6px 12px 6px 6px;
    font-size: 12px;
    color: #999;
    transition: border-color 0.2s;
}
.st-no-buzz-item:hover {
    border-color: #ddd;
}
.st-no-buzz-item img {
    width: 28px;
    height: 38px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
}
.st-no-buzz-item span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}
.st-no-buzz-placeholder {
    width: 28px;
    height: 38px;
    border-radius: 4px;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}
@media (max-width: 900px) {
    .st-stats-bar { grid-template-columns: repeat(3, 1fr); }
    .st-podium { grid-template-columns: repeat(3, 1fr); gap: 16px; }
    .st-podium-card { padding-left: 40px; }
    .st-podium-rank { font-size: 120px; left: -10px; }
    .st-ranking-thead,
    .st-ranking-row { grid-template-columns: 40px 1fr 100px 70px; }
    .st-ranking-thead div:nth-child(5),
    .st-ranking-thead div:nth-child(6),
    .st-ranking-row div:nth-child(5),
    .st-ranking-row div:nth-child(6) { display: none; }
}
@media (max-width: 600px) {
    .st-stats-bar { grid-template-columns: repeat(2, 1fr); }
    .st-podium { grid-template-columns: 1fr; gap: 24px; }
    .st-podium-card { padding-left: 60px; }
    .st-filter-inner { flex-direction: column; align-items: stretch; }
    .st-page-header { flex-direction: column; gap: 12px; }
}
