﻿/* Public Challenges (hub) – page-specific styles
   Base styles come from leagues.css. This file adds the 3-column hub, coach chips,
   skinny tribe cards, and annotated standings.
*/

/* Ensure the Pick / Manage button can host a top-right badge */
#pickBtn {
    position: relative; /* anchor for .notif-badge */
}

/* ───────────────────────────────────────────────────────────────────────── */
/* 3-column layout: Coaches (left) → Tribes (middle) → Standings (right)    */
/* ───────────────────────────────────────────────────────────────────────── */
.challenge-main {
    display: grid;
    grid-template-columns: 280px minmax(560px, 720px) 1fr;
    align-items: start;
    gap: 24px;
    padding: 0 1rem;
}

/* Middle column title */
.cards-title {
    font-size: 1.25rem;
    margin: 2rem 0 0.75rem 0;
}

/* Right-side placeholder for standings */
.right-open-space {
    min-height: 1px;
}

/* ───────────────────────────────────────────────────────────────────────── */
/* Coach chips (mirrors private hub)                                        */
/* ───────────────────────────────────────────────────────────────────────── */
.coach-list-column .challenge-members {
    padding-left: 0;
}

.coach-chip-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

    .coach-chip-list li {
        margin-bottom: .5rem;
    }

.coach-link.coach-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none !important;
    color: inherit;
    vertical-align: middle;
    padding: 4px 0;
}

.coach-avatar,
.coach-initials {
    width: 35px;
    height: 35px;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #77DD77;
    box-shadow: 0 0 0 1px rgba(119,221,119,.25);
    background: #fff;
    overflow: hidden;
    object-fit: cover;
    font-weight: 700;
    line-height: 1;
}

.coach-initials {
    background: #e5f6e5;
    color: #14532d;
    font-size: 15px;
}

.coach-name {
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ───────────────────────────────────────────────────────────────────────── */
/* Tribes skinny cards (two-up grid)                                        */
/* ───────────────────────────────────────────────────────────────────────── */
.coach-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(260px, 1fr));
    gap: 12px;
}

.coach-cards-column .team-card {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid rgba(0,0,0,.08);
    box-shadow: 0 1px 0 rgba(0,0,0,.03);
    text-decoration: none;
    transition: transform .06s ease, box-shadow .06s ease;
    max-width: 340px; /* keep each card skinny */
}

    .coach-cards-column .team-card:hover {
        transform: translateY(-1px);
        box-shadow: 0 6px 16px rgba(0,0,0,.06);
    }

.coach-cards-column .tc-left {
    min-width: 0;
}

.coach-cards-column .tc-title {
    font-size: 1.05rem;
    line-height: 1.25;
    font-weight: 800;
    color: #1f2937;
    margin: 0 0 2px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.coach-cards-column .tc-subtitle {
    font-size: .95rem;
    color: #6b7280;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Right stack: label + score */
.coach-cards-column .tc-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

/* Label above the score (always green text) */
.coach-cards-column .tc-score-label {
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .02em;
    margin: 0 0 2px 0;
    color: #22c55e;
}

/* Score with conditional color */
.coach-cards-column .tc-points {
    font-variant-numeric: tabular-nums;
    font-weight: 800;
    font-size: 1.25rem;
    color: #111827; /* default/zero = black */
}

    .coach-cards-column .tc-points.is-positive {
        color: #22c55e;
    }
    /* green */
    .coach-cards-column .tc-points.is-negative {
        color: #dc2626;
    }
    /* red */
    .coach-cards-column .tc-points.is-zero {
        color: #111827;
    }
/* black */

.cards-empty {
    color: #717680;
    font-size: .95rem;
}

/* ───────────────────────────────────────────────────────────────────────── */
/* Annotated Standings (right column)                                       */
/* ───────────────────────────────────────────────────────────────────────── */
.annotated-title {
    font-size: 1.25rem;
    margin: 2rem 0 0.75rem 0;
}

.annotated-standings {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid rgba(0,0,0,.08);
    box-shadow: 0 1px 0 rgba(0,0,0,.03);
    border-radius: 12px;
    overflow: hidden;
    table-layout: fixed;
}

    .annotated-standings thead th {
        background: #f9f9f9;
        color: #535862;
        font-weight: 700;
        text-align: left;
        padding: .6rem .8rem;
        font-size: .875rem;
        border-bottom: 1px solid #e9eaeb;
    }

    .annotated-standings tbody td {
        padding: .6rem .8rem;
        font-size: .9rem;
        color: #181D27;
        border-bottom: 1px solid #f1f2f3;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .annotated-standings tbody tr:last-child td {
        border-bottom: 0;
    }

    /* Column widths */
    .annotated-standings th:nth-child(1), .annotated-standings td.as-coach {
        width: 40%;
    }

    .annotated-standings th:nth-child(2), .annotated-standings td.as-placement {
        width: 22%;
    }

    .annotated-standings th:nth-child(3), .annotated-standings td.as-score {
        width: 18%;
        text-align: right;
    }

    .annotated-standings th:nth-child(4), .annotated-standings td.as-remaining {
        width: 20%;
        text-align: right;
    }

.as-coach-name {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.as-placement {
    text-align: left;
}

.as-rank {
    font-weight: 800;
    margin-right: .35rem;
}

.as-delta {
    font-size: .85rem;
    font-weight: 700;
}

    .as-delta.up {
        color: #16a34a;
    }
    /* green */
    .as-delta.down {
        color: #dc2626;
    }
    /* red */
    .as-delta.same {
        color: #181D27;
    }
/* neutral */

.annotated-empty {
    color: #717680;
    font-size: .95rem;
    margin-top: .5rem;
}

/* ───────────────────────────────────────────────────────────────────────── */
/* Responsive tweaks                                                         */
/* ───────────────────────────────────────────────────────────────────────── */
@media (max-width: 1200px) {
    .challenge-main {
        grid-template-columns: 240px minmax(520px, 1fr) 0.7fr;
    }
}

@media (max-width: 992px) {
    .challenge-main {
        grid-template-columns: 1fr;
    }
    /* stack */
    .coach-card-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 600px) {
    .coach-card-grid {
        grid-template-columns: 1fr;
    }
}
