/* ===================================================================
   Koora Pro — Team Page  (kp-team-*)
   Design: PREMIUM DARK MINIMAL — deep navy, restrained green accents,
   cream text, generous whitespace, hairline borders.
   All tokens live on .kp-shell via kp.css — consumed here via var().
   =================================================================== */

/* ── WRAPPER ── */
.kp-team-wrap {
    direction: rtl;
}

/* ═══════════════════════════════
   HEADER
═══════════════════════════════ */
.kp-team-hdr {
    position: relative;
    overflow: hidden;
    border-radius: var(--r);
    margin-bottom: 24px;
    border: 1px solid rgba(51,168,137,.28);
    background: linear-gradient(135deg, rgba(2,121,93,.15) 0%, rgba(255,255,255,.03) 100%);
}

.kp-team-hdr-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 22px 22px 20px;
}

.kp-team-crest {
    flex: none;
    width: 80px;
    height: 80px;
    border-radius: 18px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.1);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,.35);
}

.kp-team-crest img.kp-logo,
.kp-team-crest .kp-logo-ph {
    width: 60px !important;
    height: 60px !important;
}

.kp-team-hdr-meta {
    flex: 1;
    min-width: 0;
}

.kp-team-hdr-name {
    font-size: clamp(18px, 4vw, 26px);
    font-weight: 900;
    color: var(--ink);
    margin: 0 0 8px;
    letter-spacing: -.3px;
    line-height: 1.15;
}

.kp-team-hdr-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.kp-team-badge-lg {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: var(--pill);
    background: rgba(2,121,93,.18);
    border: 1px solid rgba(51,168,137,.35);
    color: var(--green300);
    font-size: 11.5px;
    font-weight: 800;
}

.kp-team-form-strip {
    display: inline-flex;
    align-items: center;
}

/* ═══════════════════════════════
   SUB-NAV
═══════════════════════════════ */
.kp-team-subnav {
    display: flex;
    gap: 2px;
    overflow-x: auto;
    scrollbar-width: none;
    border-bottom: 1px solid var(--line);
    margin-bottom: 20px;
    padding-bottom: 0;
}

.kp-team-subnav::-webkit-scrollbar { display: none; }

.kp-team-subnav-item {
    position: relative;
    flex: 0 0 auto;
    font-weight: 700;
    font-size: 13.5px;
    color: var(--ink-3);
    padding: 10px 16px;
    white-space: nowrap;
    transition: color .18s;
    text-decoration: none;
}

.kp-team-subnav-item:hover { color: var(--ink-2); }

.kp-team-subnav-item.is-active {
    color: var(--ink);
}

.kp-team-subnav-item.is-active::after {
    content: "";
    position: absolute;
    inset-inline: 10px;
    bottom: -1px;
    height: 2px;
    background: var(--green400);
    border-radius: 2px;
}

/* ═══════════════════════════════
   TAB BODY
═══════════════════════════════ */
.kp-team-tab-body {
    padding-top: 4px;
}

/* ═══════════════════════════════
   SECTIONS
═══════════════════════════════ */
.kp-team-sec {
    margin-bottom: 28px;
}

.kp-team-empty-inner {
    color: var(--ink-3);
    font-size: 13px;
    font-weight: 700;
    padding: 14px 16px;
    background: var(--surface);
    border: 1px dashed var(--line);
    border-radius: var(--r-sm);
    text-align: center;
}

/* ═══════════════════════════════
   SEASON STATS GRID
═══════════════════════════════ */
.kp-team-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.kp-team-stat-cell {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    padding: 14px 8px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 5px;
    transition: background .18s;
}

.kp-team-stat-cell:hover {
    background: var(--surface-2);
}

.kp-team-stat-val {
    font-size: 22px;
    font-weight: 900;
    color: var(--ink);
    line-height: 1;
}

.kp-team-stat-val.kp-team-stat-green { color: var(--green300); }
.kp-team-stat-val.kp-team-stat-red   { color: #F24040; }

.kp-team-stat-lbl {
    font-size: 11px;
    color: var(--ink-3);
    font-weight: 700;
}

/* ═══════════════════════════════
   HOME vs AWAY BARS
═══════════════════════════════ */
.kp-team-hvsa {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    padding: 16px 18px;
}

.kp-team-hvsa-hd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.kp-team-hvsa-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--ink-3);
}

.kp-team-hvsa-badge {
    font-size: 11px;
    font-weight: 800;
    padding: 2px 9px;
    border-radius: var(--pill);
}

.kp-team-hvsa-home { background: rgba(51,168,137,.14); color: var(--green300); }
.kp-team-hvsa-away { background: rgba(255,255,255,.06); color: var(--ink-3); }

/* ═══════════════════════════════
   COMPETITIONS LIST
═══════════════════════════════ */
.kp-team-comps {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.kp-team-comp-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    transition: background .18s;
}

.kp-team-comp-row:hover { background: var(--surface-2); }

.kp-team-comp-name {
    flex: 1;
    min-width: 0;
    font-size: 14px;
    font-weight: 800;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kp-team-comp-nums {
    display: flex;
    gap: 8px;
    flex: none;
}

.kp-team-comp-num {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    min-width: 30px;
    font-size: 13px;
    font-weight: 900;
    color: var(--ink-2);
}

.kp-team-comp-num small {
    font-size: 9px;
    font-weight: 700;
    color: var(--ink-3);
}

.kp-team-comp-num-g { color: var(--green300); }
.kp-team-comp-num-r { color: #F24040; }

/* ═══════════════════════════════
   FIXTURES LIST
═══════════════════════════════ */
.kp-team-fxlist {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

/* ═══════════════════════════════
   VENUE
═══════════════════════════════ */
.kp-team-venue {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    overflow: hidden;
}

.kp-team-venue-img-wrap {
    width: 100%;
    height: 160px;
    overflow: hidden;
}

.kp-team-venue-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: brightness(.8);
}

.kp-team-venue-body {
    padding: 16px 18px;
}

.kp-team-venue-name {
    font-size: 16px;
    font-weight: 900;
    color: var(--ink);
    margin-bottom: 3px;
}

.kp-team-venue-city {
    font-size: 12.5px;
    color: var(--ink-3);
    font-weight: 600;
    margin-bottom: 12px;
}

.kp-team-venue-facts {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.kp-team-venue-fact {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.kp-team-venue-fact-lbl {
    font-size: 10px;
    color: var(--ink-3);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
}

.kp-team-venue-fact-val {
    font-size: 14px;
    font-weight: 800;
    color: var(--ink);
}

/* ═══════════════════════════════
   SQUAD GRID
═══════════════════════════════ */
.kp-team-pos-hd {
    font-size: 12px;
    font-weight: 800;
    color: var(--green400);
    text-transform: uppercase;
    letter-spacing: .6px;
    margin-bottom: 12px;
    padding-inline-start: 2px;
    display: flex;
    align-items: center;
    gap: 7px;
}

.kp-team-pos-hd::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green400);
    flex: none;
}

.kp-team-squad-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.kp-team-squad-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 14px 10px 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    text-decoration: none;
    transition: background .18s, border-color .18s, transform .15s;
    text-align: center;
}

a.kp-team-squad-card:hover {
    background: var(--surface-2);
    border-color: rgba(51,168,137,.3);
    transform: translateY(-2px);
}

.kp-team-squad-photo-wrap {
    position: relative;
    flex: none;
}

.kp-team-squad-photo-wrap .kp-avatar {
    width: 52px !important;
    height: 52px !important;
    border: 2px solid rgba(51,168,137,.2);
}

.kp-team-squad-num {
    position: absolute;
    bottom: -4px;
    inset-inline-end: -4px;
    width: 20px;
    height: 20px;
    border-radius: 6px;
    background: var(--green600, #015E47);
    border: 2px solid var(--navy800, #0E1D30);
    font-size: 10px;
    font-weight: 900;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kp-team-squad-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    width: 100%;
}

.kp-team-squad-name {
    font-size: 13px;
    font-weight: 800;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kp-team-squad-age {
    font-size: 11px;
    color: var(--ink-3);
    font-weight: 600;
}

/* ═══════════════════════════════
   PLAYER LIST (scorers/assists)
═══════════════════════════════ */
.kp-team-pl-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.kp-team-pl-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    text-decoration: none;
    transition: background .18s, border-color .18s;
}

a.kp-team-pl-row:hover {
    background: var(--surface-2);
    border-color: rgba(51,168,137,.28);
}

.kp-team-pl-rank {
    width: 22px;
    text-align: center;
    font-size: 12px;
    font-weight: 900;
    color: var(--ink-3);
    flex: none;
}

.kp-team-pl-row .kp-avatar {
    width: 40px !important;
    height: 40px !important;
    border: 1.5px solid rgba(51,168,137,.18);
}

.kp-team-pl-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.kp-team-pl-name {
    font-size: 14px;
    font-weight: 800;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 6px;
}

.kp-team-pl-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 5px;
    background: rgba(51,168,137,.1);
    border: 1px solid rgba(51,168,137,.28);
    font-size: 10px;
    font-weight: 900;
    color: var(--green300);
    flex: none;
}

.kp-team-pl-pos {
    font-size: 11.5px;
    color: var(--ink-3);
    font-weight: 600;
}

.kp-team-pl-val {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 44px;
    flex: none;
}

.kp-team-pl-val-n {
    font-size: 20px;
    font-weight: 900;
    color: var(--green300);
    line-height: 1;
}

.kp-team-pl-val-l {
    font-size: 10px;
    color: var(--ink-3);
    font-weight: 700;
}

/* ═══════════════════════════════
   TROPHIES
═══════════════════════════════ */
.kp-team-trophy-comp-hd {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.kp-team-trophy-ic {
    font-size: 18px;
    line-height: 1;
}

.kp-team-trophy-comp-name {
    font-size: 15px;
    font-weight: 800;
    color: var(--ink);
    flex: 1;
}

.kp-team-trophy-count {
    font-size: 12px;
    font-weight: 900;
    color: var(--green300);
    background: rgba(51,168,137,.12);
    border: 1px solid rgba(51,168,137,.28);
    border-radius: var(--pill);
    padding: 2px 9px;
}

.kp-team-trophy-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.kp-team-trophy-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
}

.kp-team-trophy-row.is-win {
    border-color: rgba(255,193,7,.18);
    background: rgba(255,193,7,.04);
}

.kp-team-trophy-season {
    font-size: 13px;
    font-weight: 800;
    color: var(--ink-2);
    min-width: 60px;
    direction: ltr;
}

.kp-team-trophy-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ink-3);
    flex: none;
}

.kp-team-trophy-dot-g { background: var(--green400); }

.kp-team-trophy-pos {
    font-size: 13px;
    color: var(--ink-3);
    font-weight: 700;
    flex: 1;
}

/* ═══════════════════════════════
   RESPONSIVE
═══════════════════════════════ */
@media (max-width: 640px) {
    .kp-team-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .kp-team-hdr-inner {
        padding: 16px;
        gap: 14px;
    }

    .kp-team-crest {
        width: 62px;
        height: 62px;
    }

    .kp-team-crest img.kp-logo,
    .kp-team-crest .kp-logo-ph {
        width: 48px !important;
        height: 48px !important;
    }

    .kp-team-squad-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .kp-team-comp-nums {
        gap: 5px;
    }

    .kp-team-venue-img-wrap {
        height: 120px;
    }
}

@media (max-width: 400px) {
    .kp-team-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .kp-team-squad-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
