/* ==========================================================================
   Chiefs Salary Cap Tracker — Styles
   Colors: Red #E31837, Gold #FFB81C, Black #000, White #fff
   ========================================================================== */

/* ---------- Container ---------- */
.cct-tracker {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    max-width: 1100px;
    margin: 0 auto;
    color: #222;
    line-height: 1.5;
}

/* ---------- Notices ---------- */
.cct-notice {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
}
.cct-notice-warn {
    background: #fff8e1;
    border: 1px solid #FFB81C;
    color: #7a5d00;
}

/* ---------- Tabs ---------- */
.cct-tabs {
    display: flex;
    gap: 0;
    border-bottom: 3px solid #E31837;
    margin-bottom: 24px;
}
.cct-tab {
    padding: 12px 24px;
    border: none;
    background: #f2f2f2;
    color: #333;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 6px 6px 0 0;
    transition: background 0.2s, color 0.2s;
}
.cct-tab:hover {
    background: #e0e0e0;
}
.cct-tab-active {
    background: #E31837;
    color: #fff;
}
.cct-tab-content {
    display: none;
}
.cct-tab-content-active {
    display: block;
}

/* ---------- Cap Gauge ---------- */
.cct-gauge-wrap {
    margin-bottom: 28px;
}
.cct-gauge-label {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 6px;
}
.cct-gauge-bar {
    height: 28px;
    background: #eee;
    border-radius: 14px;
    overflow: hidden;
}
.cct-gauge-fill {
    height: 100%;
    border-radius: 14px;
    transition: width 0.6s ease;
}
.cct-bar-green {
    background: linear-gradient(90deg, #27ae60, #2ecc71);
}
.cct-bar-gold {
    background: linear-gradient(90deg, #e6a800, #FFB81C);
}
.cct-bar-red {
    background: linear-gradient(90deg, #c0392b, #E31837);
}
.cct-gauge-legend {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #666;
    margin-top: 6px;
}

/* ---------- Big Numbers ---------- */
.cct-big-numbers {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}
.cct-big-num {
    background: #fafafa;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 20px 16px;
    text-align: center;
}
.cct-big-val {
    display: block;
    font-size: 24px;
    font-weight: 800;
    color: #E31837;
}
.cct-big-lbl {
    display: block;
    font-size: 13px;
    color: #666;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ---------- Top 5 Leaderboard ---------- */
.cct-section-title {
    font-size: 18px;
    font-weight: 700;
    color: #000;
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 2px solid #E31837;
}
.cct-leaderboard {
    list-style: none;
    margin: 0;
    padding: 0;
}
.cct-lb-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
}
.cct-lb-item:last-child {
    border-bottom: none;
}
.cct-lb-rank {
    width: 32px;
    height: 32px;
    background: #E31837;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
    margin-right: 12px;
}
.cct-lb-name {
    font-weight: 600;
    flex: 1;
    min-width: 0;
}
.cct-lb-pos {
    color: #888;
    font-size: 13px;
    margin: 0 12px;
    flex-shrink: 0;
}
.cct-lb-val {
    font-weight: 700;
    color: #E31837;
    flex-shrink: 0;
}

.cct-updated {
    font-size: 12px;
    color: #999;
    margin-top: 20px;
    text-align: right;
}

/* ---------- Phase Summary (Offense/Defense/ST) ---------- */
.cct-phase-summary {
    display: flex;
    gap: 16px;
    margin-bottom: 28px;
}
.cct-phase-item {
    flex: 1;
    background: #000;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
}
.cct-phase-label {
    display: block;
    font-size: 13px;
    color: #FFB81C;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-bottom: 4px;
}
.cct-phase-val {
    display: block;
    font-size: 20px;
    font-weight: 800;
    color: #fff;
}

/* ---------- Attribution ---------- */
.cct-attribution {
    font-size: 11px;
    color: #aaa;
    text-align: center;
    margin-top: 24px;
    padding-top: 12px;
    border-top: 1px solid #eee;
}
.cct-attribution a {
    color: #E31837;
    text-decoration: none;
}
.cct-attribution a:hover {
    text-decoration: underline;
}

/* ---------- Controls (Search / Filter) ---------- */
.cct-controls {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.cct-search {
    flex: 1;
    min-width: 200px;
    padding: 10px 14px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
}
.cct-search:focus {
    outline: none;
    border-color: #E31837;
    box-shadow: 0 0 0 2px rgba(227, 24, 55, 0.15);
}
.cct-pos-filter {
    padding: 10px 14px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    min-width: 160px;
}
.cct-pos-filter:focus {
    outline: none;
    border-color: #E31837;
}

/* ---------- Table ---------- */
.cct-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.cct-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.cct-table thead {
    background: #000;
    color: #fff;
}
.cct-table th {
    padding: 12px 10px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
    user-select: none;
    position: relative;
}
.cct-table th[data-cct-sort]:hover {
    background: #222;
}
.cct-table th.cct-sort-asc::after {
    content: " \25B2";
    font-size: 10px;
}
.cct-table th.cct-sort-desc::after {
    content: " \25BC";
    font-size: 10px;
}
.cct-table td {
    padding: 10px;
    border-bottom: 1px solid #eee;
    white-space: nowrap;
}
.cct-table tbody tr:hover {
    background: #fafafa;
}
.cct-table a {
    color: #E31837;
    text-decoration: none;
    font-weight: 600;
}
.cct-table a:hover {
    text-decoration: underline;
}

/* Color-coded rows */
.cct-row-red td:first-child {
    border-left: 4px solid #E31837;
}
.cct-row-gold td:first-child {
    border-left: 4px solid #FFB81C;
}

/* ---------- Position Breakdown ---------- */
.cct-breakdown {
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.cct-bd-group {
    background: #fafafa;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 20px;
}
.cct-bd-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.cct-bd-group-name {
    font-size: 18px;
    font-weight: 700;
    color: #000;
}
.cct-bd-group-total {
    font-size: 15px;
    font-weight: 600;
    color: #E31837;
}
.cct-bd-bar-wrap {
    height: 20px;
    background: #e5e5e5;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 16px;
}
.cct-bd-bar {
    height: 100%;
    background: linear-gradient(90deg, #E31837, #ff4d6a);
    border-radius: 10px;
    transition: width 0.5s ease;
}
.cct-bd-subs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}
.cct-bd-sub {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 12px;
}
.cct-bd-sub-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.cct-bd-sub-name {
    font-weight: 600;
    font-size: 14px;
}
.cct-bd-sub-total {
    font-weight: 600;
    font-size: 13px;
    color: #FFB81C;
}
.cct-bd-subbar-wrap {
    height: 8px;
    background: #eee;
    border-radius: 4px;
    overflow: hidden;
}
.cct-bd-subbar {
    height: 100%;
    background: linear-gradient(90deg, #FFB81C, #ffcc4d);
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .cct-tabs {
        flex-wrap: wrap;
    }
    .cct-tab {
        flex: 1;
        min-width: 0;
        padding: 10px 12px;
        font-size: 13px;
        text-align: center;
    }
    .cct-big-numbers {
        grid-template-columns: repeat(2, 1fr);
    }
    .cct-big-val {
        font-size: 20px;
    }
    .cct-lb-item {
        flex-wrap: wrap;
    }
    .cct-lb-val {
        width: 100%;
        text-align: right;
        margin-top: 4px;
    }
    .cct-controls {
        flex-direction: column;
    }
    .cct-search,
    .cct-pos-filter {
        width: 100%;
        min-width: 0;
    }
    .cct-bd-subs {
        grid-template-columns: 1fr;
    }
    .cct-phase-summary {
        flex-direction: column;
    }
    .cct-phase-val {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .cct-big-numbers {
        grid-template-columns: 1fr;
    }
    .cct-tab {
        font-size: 12px;
        padding: 8px 8px;
    }
}
