/*
 * Spam channel statistics page (stats.ejs).
 * Everything shared with the scanner page now lives in base.css; this file only
 * carries what is unique to the stats layout.
 */

.scs {
    flex: 1 0 auto;
    padding-block: clamp(1.5rem, 4vw, 2.5rem) clamp(2rem, 6vw, 4rem);
}

/* the page's title, under the compact header (partials/site_header.ejs) */
.scs-title {
    margin-bottom: clamp(1rem, 3vw, 1.5rem);
    font-size: var(--fs-page-title);
    font-weight: 600;
}

.scs-block + .scs-block {
    margin-top: clamp(2rem, 5vw, 3.25rem);
    padding-top: clamp(1.5rem, 4vw, 2.5rem);
    border-top: 1px solid var(--border);
}

.scs-block h2 {
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* overview cards */

.stat-grid {
    display: grid;
    gap: clamp(1rem, 2.5vw, 1.5rem);
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
}

.stat-card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-1);
    overflow: hidden;
}

.stat-card .top {
    flex: 1 1 auto;
    display: grid;
    place-items: center;
    text-align: center;
    padding: 1.1rem var(--space-5);
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
    font-size: var(--fs-md-plus);
}

.stat-card .bottom {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 1.1rem var(--space-5);
    font-size: var(--fs-num);
    font-weight: 500;
    color: var(--stat);
}

/* top indicators */

.indic-list {
    list-style: none;
    margin: 1.5rem 0 0;
    padding: 0;
    max-width: var(--measure);
}

.indic-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding: var(--space-3) 1.15rem;
    border-bottom: 1px solid var(--border);
}

.indic-list li {
    position: relative;
}

.indic-list li:last-child {
    border-bottom: 0;
}

/* under each row, scaled to the top indicator (lib/site_stats.js share) */
.indic-bar {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    background: var(--stat);
    opacity: .45;
}

.indic-count {
    color: var(--stat);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

/* latest channels checked */

/* the period the list covers, as plain text beside the heading: there is only the one */
.section-period {
    margin: 0;
    font-weight: 500;
    color: var(--text-muted);
}

.channel-grid {
    display: grid;
    gap: clamp(1rem, 2.5vw, 1.5rem);
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
    margin-top: 1.5rem;
}

.channel-card {
    position: relative;
    display: flex;
    align-items: flex-end;
    min-height: 170px;
    border-radius: var(--radius);
    overflow: hidden;
    background-color: var(--surface-2);
    box-shadow: var(--shadow-1);
    isolation: isolate;
    /* the ring sits on a banner of any colour, under the dark scrim, so it is white */
    --focus: var(--on-plate);
}

/* the channel banner, as an img behind the card rather than a background-image
   written into a style attribute */
.channel-card-banner {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.channel-card::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(to top, rgba(0, 0, 0, .72), rgba(0, 0, 0, .15));
}

.channel-card-body {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    width: 100%;
    padding: .85rem var(--space-4);
}

.channel-info {
    display: flex;
    align-items: center;
    gap: .6rem;
    min-width: 0;
    /* the banner behind this can be any colour, so the name gets its own plate
       rather than relying on the card gradient alone */
    background: var(--plate-bg);
    border-radius: 999px;
    padding: .3rem var(--space-3) .3rem .3rem;
}

.channel-thumb {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex: none;
}

.channel-name {
    color: var(--on-plate);
    font-size: var(--fs-md);
    overflow-wrap: anywhere;
}

.channel-card a:hover .channel-name {
    text-decoration: underline;
}

.spam-info {
    flex: none;
    background: var(--surface);
    color: var(--text);
    border-radius: 999px;
    padding: .35rem var(--space-3);
    font-size: var(--fs-md-plus);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.scs-empty {
    color: var(--text-subtle);
    margin-top: 1.5rem;
}

/* the earnings calculator under the statistics, in the page body rather than the footer */

.scs-calculator {
    color: var(--text-subtle);
    margin-top: 1rem;
    font-size: var(--fs-md);
}

/* the same note as under the result's calculator link (main.css) */
.scs-calculator .calculator-note {
    display: block;
    margin-top: .125rem;
    font-size: var(--fs-sm);
    line-height: 1.45;
}

.scs-calculator a {
    color: var(--brand);
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: var(--underline-offset);
}
