﻿/* ═══════════════════════════════════════════════════════════
   team.css — Team Page Styles
   Uses CSS custom properties set at runtime by team.js:
     --team-bg      (backgroundColor from API)
     --team-border  (borderColor from API)
   ═══════════════════════════════════════════════════════════ */

:root {
    --team-bg: royalblue;
    --team-border: #333;
}

body {
    background-color: #f0f2f5 !important;
}

/* ── Typography Classes ──────────────────────────────────── */
.t-display {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
}

.t-heading {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 600;
}

.t-body {
    font-family: 'Barlow', sans-serif;
}

/* ── Hero Header ─────────────────────────────────────────── */
.team-hero {
    position: relative;
    overflow: hidden;
    color: white;
}

.team-hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center 30%;
    opacity: 0.2;
    filter: blur(2px);
}

.team-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0.55) 60%, rgba(0,0,0,0.75) 100%);
}

.team-hero-accent {
    position: absolute;
    top: 0;
    right: 0;
    width: 40%;
    height: 100%;
    background: linear-gradient(135deg, transparent 0%, rgba(255,255,255,0.04) 100%);
    clip-path: polygon(30% 0, 100% 0, 100% 100%, 0 100%);
}

.team-hero-content {
    position: relative;
    z-index: 2;
}

/* ── Identity ────────────────────────────────────────────── */
.team-identity {
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 28px 0 24px;
}

.team-emblem-wrap {
    width: 110px;
    height: 110px;
    border-radius: 12px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 24px rgba(0,0,0,0.3);
    overflow: hidden;
}

    .team-emblem-wrap img {
        max-width: 100px;
        max-height: 100px;
        object-fit: contain;
    }

.team-meta-label {
    font-size: 13px;
    color: rgba(255,255,255,0.45);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.team-name-display {
    font-size: 38px;
    line-height: 1.1;
    letter-spacing: -0.5px;
}

.team-pill {
    display: inline-block;
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.8);
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 12px;
    margin-right: 8px;
    margin-top: 10px;
    border: 1px solid rgba(255,255,255,0.08);
}

.team-coach-line {
    font-size: 13px;
    color: rgba(255,255,255,0.5);
    margin-top: 10px;
}

    .team-coach-line a,
    .team-coach-line span {
        color: rgba(255,255,255,0.85);
        text-decoration: none;
    }

/* ── Record Strip ────────────────────────────────────────── */
.record-strip {
    display: flex;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.record-item {
    flex: 1;
    text-align: center;
    padding: 16px 0;
    border-right: 1px solid rgba(255,255,255,0.06);
}

    .record-item:last-child {
        border-right: none;
    }

.record-value {
    font-size: 30px;
    line-height: 1;
}

.record-label {
    font-size: 11px;
    color: rgba(255,255,255,0.4);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-top: 4px;
}

.rv-wins {
    color: #4ade80;
}

.rv-losses {
    color: #f87171;
}

.rv-ties {
    color: #fbbf24;
}

.rv-pct {
    color: white;
}

/* ── Team Photo Banner ───────────────────────────────────── */
.team-photo-banner img {
    width: 100%;
    height: 260px;
    object-fit: cover;
    object-position: center 25%;
    display: block;
}

/* ── Section Cards ───────────────────────────────────────── */
.section-card {
    background: white;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    margin-bottom: 20px;
    overflow: hidden;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid #e5e7eb;
    flex-wrap: wrap;
    gap: 8px;
    background: linear-gradient(135deg, var(--team-border) 0%, var(--team-bg) 100%);
}

.section-title {
    font-size: 20px;
    color: white;
    display: flex;
    align-items: center;
    gap: 8px;
}

    .section-title i,
    .section-title svg {
        color: white;
        stroke: white;
    }

.section-body {
    padding: 20px 24px;
}

/* ── Spotlight Cards ─────────────────────────────────────── */
.spotlight-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.spotlight-card {
    background: #f9fafb;
    border-radius: 8px;
    padding: 16px 18px;
}

.spotlight-card-next {
    border-left: 4px solid var(--team-bg);
}

.spotlight-label {
    font-size: 11px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #9ca3af;
    margin-bottom: 8px;
}

.spotlight-label-next {
    color: var(--team-bg);
}

.spotlight-opponent {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
}

.spotlight-detail {
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
}

.spotlight-score {
    font-size: 22px;
}

/* ── Schedule Table ──────────────────────────────────────── */
.schedule-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

    .schedule-table thead th {
        text-align: left;
        padding: 10px 12px;
        font-weight: 600;
        font-size: 11px;
        color: #6b7280;
        letter-spacing: 0.5px;
        text-transform: uppercase;
        background: #f9fafb;
        border-bottom: 1px solid #e5e7eb;
    }

    .schedule-table tbody tr {
        border-bottom: 1px solid #f3f4f6;
        transition: background 0.15s;
    }

        .schedule-table tbody tr:hover {
            background: #f9fafb;
        }

        .schedule-table tbody tr.row-alt {
            background: #fafaf8;
        }

    .schedule-table tbody td {
        padding: 10px 12px;
        color: #374151;
    }

.opponent-link {
    color: var(--team-bg);
    text-decoration: none;
    font-weight: 500;
}

    .opponent-link:hover {
        text-decoration: underline;
    }

.location-link {
    color: #2563eb;
    text-decoration: none;
    font-size: 12px;
}

    .location-link:hover {
        text-decoration: underline;
    }

/* ── Result Pills ────────────────────────────────────────── */
.result-pill {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
}

.rp-win {
    background: #dcfce7;
    color: #166534;
}

.rp-loss {
    background: #fee2e2;
    color: #991b1b;
}

.rp-tie {
    background: #fef3c7;
    color: #92400e;
}

.rp-cancel {
    background: #fee2e2;
    color: #dc2626;
    font-size: 11px;
}

.result-link {
    text-decoration: none;
}

    .result-link:hover .result-pill {
        filter: brightness(0.92);
        box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    }

/* ── Buttons ─────────────────────────────────────────────── */
.btn-team {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    background: white;
    color: #374151;
    font-family: 'Barlow', sans-serif;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s;
}

    .btn-team:hover {
        background: #f9fafb;
        border-color: #9ca3af;
    }

/* Button variant on gradient headers — white outline */
.section-header .btn-team {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.3);
    color: white;
}

    .section-header .btn-team:hover {
        background: rgba(255,255,255,0.25);
        border-color: rgba(255,255,255,0.5);
    }

/* ── Roster ──────────────────────────────────────────────── */
.roster-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 10px;
}

.roster-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f9fafb;
    border-radius: 8px;
    padding: 10px 14px;
    transition: all 0.15s;
    border: 1px solid transparent;
}

    .roster-card:hover {
        border-color: #e5e7eb;
        background: white;
        box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    }

.roster-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--team-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    flex-shrink: 0;
}

.roster-name a {
    color: var(--team-bg);
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
}

    .roster-name a:hover {
        text-decoration: underline;
    }

.roster-detail {
    font-size: 11px;
    color: #9ca3af;
}

.roster-tab {
    padding: 5px 14px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    background: white;
    color: #374151;
    font-family: 'Barlow', sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}

    .roster-tab.active {
        background: var(--team-bg);
        color: white;
        border-color: var(--team-bg);
    }

/* Roster tabs inside gradient header — white styling */
.section-header .roster-tab {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.3);
    color: white;
}

    .section-header .roster-tab:hover {
        background: rgba(255,255,255,0.25);
    }

    .section-header .roster-tab.active {
        background: white;
        color: var(--team-bg);
        border-color: white;
    }

/* Stats tabs inside gradient header */
.section-header .stats-tab {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.3);
    color: white;
}

    .section-header .stats-tab:hover {
        background: rgba(255,255,255,0.25);
    }

    .section-header .stats-tab.active {
        background: white;
        color: var(--team-bg);
        border-color: white;
    }

/* ── Stats ───────────────────────────────────────────────── */
.stats-tab {
    padding: 8px 20px;
    border: 1px solid #d1d5db;
    background: white;
    color: var(--team-bg);
    font-family: 'Barlow', sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    margin-right: 4px;
}

    .stats-tab.active {
        background: var(--team-bg);
        color: white;
        border-color: var(--team-bg);
    }

.stats-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Barlow', sans-serif;
    font-size: 13px;
}

    .stats-table thead th {
        padding: 10px 8px;
        font-weight: 600;
        font-size: 11px;
        color: #6b7280;
        letter-spacing: 0.3px;
        text-transform: uppercase;
        background: #f9fafb;
        border-bottom: 2px solid #cc0000;
        text-align: center;
        white-space: nowrap;
    }

        .stats-table thead th:nth-child(2) {
            text-align: left;
        }

    .stats-table tbody tr {
        border-bottom: 1px solid #f3f4f6;
    }

        .stats-table tbody tr:nth-child(even) {
            background: cornsilk;
        }

    .stats-table tbody td {
        padding: 8px;
        text-align: center;
    }

        .stats-table tbody td:nth-child(2) {
            text-align: left;
        }

        .stats-table tbody td a {
            color: var(--team-bg);
            text-decoration: none;
            font-weight: 500;
        }

            .stats-table tbody td a:hover {
                text-decoration: underline;
            }

/* ── Team-level stat chips ───────────────────────────────── */
.team-stat-chip {
    background: #f9fafb;
    border-radius: 8px;
    padding: 10px 16px;
}

    .team-stat-chip .chip-label {
        font-size: 11px;
        color: #6b7280;
        text-transform: uppercase;
    }

    .team-stat-chip .chip-value {
        font-size: 18px;
        margin-left: 6px;
    }

/* ── Loading & Error ─────────────────────────────────────── */
.team-loading {
    text-align: center;
    padding: 80px 20px;
}

.team-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e5e7eb;
    border-top-color: #6b7280;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.team-error {
    display: none;
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
    .team-identity {
        gap: 16px;
        padding: 20px 0 16px;
    }

    .team-emblem-wrap {
        width: 72px;
        height: 72px;
    }

        .team-emblem-wrap img {
            max-width: 64px;
            max-height: 64px;
        }

    .team-name-display {
        font-size: 24px;
    }

    .team-meta-label {
        font-size: 11px;
        letter-spacing: 1.5px;
    }

    .team-pill {
        font-size: 11px;
        padding: 3px 10px;
    }

    .team-coach-line {
        font-size: 12px;
    }

    .record-value {
        font-size: 24px;
    }

    .record-item {
        padding: 12px 0;
    }

    .team-photo-banner img {
        height: 180px;
    }

    .spotlight-row {
        grid-template-columns: 1fr;
    }

    .section-header {
        padding: 12px 16px;
    }

    .section-body {
        padding: 14px 16px;
    }

    .schedule-table .col-hide-mobile {
        display: none;
    }

    .schedule-table thead th,
    .schedule-table tbody td {
        padding: 8px 6px;
        font-size: 12px;
    }

    .roster-grid {
        grid-template-columns: 1fr;
    }

    .roster-card {
        padding: 8px 10px;
    }

    .roster-number {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }

    .stats-table {
        font-size: 11px;
    }

        .stats-table thead th {
            padding: 8px 4px;
            font-size: 10px;
        }

        .stats-table tbody td {
            padding: 6px 4px;
        }
}
