/* ==================================================
   Týmy - detail
================================================== */

.team-league {
    display: inline-block;
    margin-top: 10px;
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary-color);
    background: #ebf2fa;
    border-radius: 999px;
}

/* ==================================================
   Sekundární menu / taby
================================================== */
.team-subnav {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 10px;
    background: #f3f6fa;
    border: 1px solid #dbe4f0;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 36, 82, 0.06);
}

.team-tab-btn {
    position: relative;
    appearance: none;
    border: 0;
    background: transparent;
    color: #4b5b70;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1;
    padding: 14px 20px;
    border-radius: 12px;
    cursor: pointer;
    transition:
        background-color 0.22s ease,
        color 0.22s ease,
        box-shadow 0.22s ease;
}

.team-tab-btn:hover {
    background: rgba(255, 255, 255, 0.72);
    color: var(--primary-color);
}

.team-tab-btn.active {
    background: var(--white);
    color: var(--primary-color);
    box-shadow: 0 4px 14px rgba(0, 36, 82, 0.08);
}

.team-tab-btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.team-tab-content {
    display: none;
}

.team-tab-content.active {
    display: block;
}

/* ==================================================
   Nadpisy sekcí
================================================== */
.matches-section h3,
.team-table-section h3,
.team-staff-section h3,
.team-roster-section h3,
.archive-section h3 {
    position: relative;
    margin-bottom: 18px;
    font-size: 1.8rem;
    color: var(--text-color);
}

.matches-section h3::after,
.team-table-section h3::after,
.team-staff-section h3::after,
.team-roster-section h3::after,
.archive-section h3::after {
    content: "";
    display: block;
    width: 70px;
    height: 4px;
    margin-top: 10px;
    border-radius: 999px;
    background-color: var(--primary-color);
}

/* ==================================================
   Zápasy
================================================== */
.matches-scroll {
    padding: 14px;
    border: 1px solid #dbe4f0;
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff 0%, #f7faff 100%);
    box-shadow: 0 8px 24px rgba(0, 36, 82, 0.08);
}

.match-card {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 14px;
    padding: 18px 20px;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    background-color: var(--white);
    border: 1px solid #e6edf7;
    border-left: 5px solid var(--primary-color);
    border-radius: 14px;
    box-shadow: 0 4px 14px rgba(0, 36, 82, 0.06);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    overflow: visible;
}

.match-card:last-child {
    margin-bottom: 0;
}

.match-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(0, 36, 82, 0.12);
}

.match-date {
    min-width: 120px;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--primary-color);
}

.match-info {
    flex: 1;
    min-width: 0;
}

.match-info strong {
    display: block;
    font-size: 1.02rem;
    line-height: 1.45;
    color: var(--text-color);
    word-break: break-word;
}

.match-info p {
    margin-top: 6px;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #5f6b7a;
}

.active-match {
    background: #eef5ff;
    border-color: #cfe0fb;
    border-left: 5px solid var(--primary-color);
    box-shadow: 0 6px 18px rgba(0, 74, 173, 0.12);
}

.active-match .match-date {
    color: #00357d;
}

.match-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    min-width: 90px;
    margin-left: auto;
    text-align: right;
}

.match-result-box {
    text-align: right;
}

.match-result {
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--primary-color);
    line-height: 1;
    white-space: nowrap;
}

.match-half {
    margin-top: 4px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #6b7280;
    white-space: nowrap;
}

/* ==================================================
   Report indikátor
================================================== */
.has-report {
    border-left: 5px solid #0f9d58;
}

.report-indicator {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 10px;
    height: 10px;
    background-color: #e53935;
    border: 2px solid #fff;
    border-radius: 50%;
    z-index: 10;
}

.report-indicator::after {
    content: "Zobrazit report";
    position: absolute;
    top: -34px;
    right: 0;
    background: #111;
    color: white;
    font-size: 0.7rem;
    padding: 4px 8px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.match-card.has-report:hover .report-indicator::after {
    opacity: 1;
}

.no-report {
    cursor: default;
    opacity: 0.96;
}

.no-report:hover {
    transform: none;
    box-shadow: 0 4px 14px rgba(0, 36, 82, 0.06);
}

/* ==================================================
   Tabulka soutěže
================================================== */
.highlight-team {
    background: #eef5ff;
    font-weight: 700;
}

.highlight-team td:first-child {
    border-left: 5px solid var(--primary-color);
}

.top-team td:first-child {
    border-left: 5px solid #d1d5db;
}

.top-1 td:first-child {
    border-left-color: #fbbf24;
}

.top-2 td:first-child {
    border-left-color: #9ca3af;
}

.top-3 td:first-child {
    border-left-color: #b45309;
}

tbody tr:nth-child(3) {
    border-bottom: 2px solid #dbe4f0;
}

/* ==================================================
   Soupiska / realizační tým
================================================== */
.team-roster-section {
    margin-top: 40px;
}

/* ==================================================
   Archiv
================================================== */
.archive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.archive-card {
    display: block;
    padding: 20px;
    border-radius: 14px;
    background: var(--white);
    border: 1px solid #e6edf7;
    text-decoration: none;
    color: var(--text-color);
    box-shadow: 0 4px 14px rgba(0, 36, 82, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.archive-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 36, 82, 0.12);
}

.archive-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
}

.archive-meta {
    margin-top: 6px;
    font-size: 0.9rem;
    color: #6b7280;
}

.archive-card.disabled {
    opacity: 0.6;
    pointer-events: none;
}

/* ==================================================
   RESPONSIVE - TABLET
================================================== */
@media (max-width: 850px) {
    .team-subnav {
        padding: 5px;
        border-radius: 14px;
    }

    .team-tab-btn {
        padding: 12px 15px;
        font-size: 0.9rem;
        border-radius: 10px;
    }

    .matches-section h3,
    .team-table-section h3,
    .team-staff-section h3,
    .team-roster-section h3,
    .archive-section h3 {
        font-size: 1.5rem;
    }

    .matches-scroll {
        padding: 10px;
        border-radius: 12px;
    }

    .match-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 16px;
        border-radius: 12px;
    }

    .match-date {
        flex: none;
        min-width: auto;
        font-size: 0.92rem;
    }

    .match-info {
        width: 100%;
    }

    .match-info strong {
        font-size: 0.98rem;
    }

    .match-info p {
        font-size: 0.92rem;
    }

    .match-side {
        display: flex;
        width: 100%;
        min-width: auto;
        margin-left: 0;
        align-items: flex-start;
        justify-content: flex-start;
        text-align: left;
    }

    .match-result-box {
        text-align: left;
        margin-bottom: 0;
    }

    .match-result {
        font-size: 1.5rem;
    }

    .match-half {
        font-size: 0.8rem;
    }

    .team-roster-section {
        margin-top: 32px;
    }

    .report-indicator {
        top: 12px;
        right: 12px;
    }

    .report-indicator::after {
        display: none;
    }

    .archive-grid {
        gap: 16px;
    }
}

/* ==================================================
   RESPONSIVE - MOBIL
================================================== */
@media (max-width: 600px) {
    /* ----------------------------------------------
       Taby
    ---------------------------------------------- */
    .team-subnav {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        scroll-snap-type: x proximity;
        gap: 8px;
        padding: 6px;
        border-radius: 14px;
    }

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

    .team-tab-btn {
        flex: 0 0 auto;
        white-space: nowrap;
        scroll-snap-align: start;
        padding: 10px 14px;
        font-size: 0.86rem;
        border-radius: 999px;
    }

    /* ----------------------------------------------
       Nadpisy sekcí
    ---------------------------------------------- */
    .matches-section h3,
    .team-table-section h3,
    .team-staff-section h3,
    .team-roster-section h3,
    .archive-section h3 {
        margin-bottom: 16px;
        font-size: 1.3rem;
    }

    /* ----------------------------------------------
       Zápasy
    ---------------------------------------------- */
    .matches-scroll {
        padding: 8px;
    }

    .match-card {
        position: relative;
        padding: 14px 14px 12px;
        gap: 6px;
        border-radius: 12px;
    }

    .match-date {
        min-width: auto;
        font-size: 0.84rem;
        line-height: 1.35;
    }

    .match-info {
        width: 100%;
        padding-right: 64px;
    }

    .match-info strong {
        font-size: 0.95rem;
        line-height: 1.35;
    }

    .match-info p {
        margin-top: 4px;
        font-size: 0.88rem;
        line-height: 1.45;
    }

    .match-side {
        position: absolute;
        top: 12px;
        right: 14px;
        width: auto;
        min-width: 0;
        margin-left: 0;
        align-items: flex-end;
        justify-content: flex-start;
        text-align: right;
        gap: 4px;
    }

    .match-result-box {
        text-align: right;
    }

    .match-result {
        font-size: 1.3rem;
        line-height: 1;
    }

    .match-half {
        margin-top: 2px;
        font-size: 0.72rem;
    }

    .report-indicator {
        top: 14px;
        right: 48px;
    }

    /* ----------------------------------------------
       Tabulka soutěže
    ---------------------------------------------- */
    .team-table-section .table-wrapper table {
        min-width: 340px;
}

    .team-table-section .table-wrapper th,
    .team-table-section .table-wrapper td {
        padding: 9px 8px;
        font-size: 0.8rem;
    }

    .team-table-section .table-wrapper th:nth-child(2),
    .team-table-section .table-wrapper td:nth-child(2) {
        padding-left: 8px;
        padding-right: 8px;
    }

    .team-table-section th:nth-child(4),
    .team-table-section td:nth-child(4),
    .team-table-section th:nth-child(5),
    .team-table-section td:nth-child(5),
    .team-table-section th:nth-child(6),
    .team-table-section td:nth-child(6) {
        display: none;
    }

    /* ----------------------------------------------
       Realizační tým
    ---------------------------------------------- */
    
    .team-staff-section .table-wrapper table {
        min-width: 340px;
    }

    .team-staff-section .table-wrapper th,
    .team-staff-section .table-wrapper td {
        padding: 11px 10px;
        font-size: 0.88rem;
    }

    /* ----------------------------------------------
       Soupiska hráčů - card layout
    ---------------------------------------------- */
.team-roster-section .table-wrapper {
    overflow-x: auto;
}

.team-roster-section .table-wrapper table {
    min-width: 340px;
}

.team-roster-section .table-wrapper th,
.team-roster-section .table-wrapper td {
    padding: 8px 6px;
    font-size: 0.8rem;
    white-space: nowrap;
}

/* Jméno necháme flexibilní */
.team-roster-section .table-wrapper td:nth-child(3) {
    white-space: normal;
    font-weight: 600;
}

/* Číslo + rok menší */
.team-roster-section .table-wrapper td:nth-child(1),
.team-roster-section .table-wrapper td:nth-child(4) {
    font-size: 0.75rem;
    color: #6b7280;
}

    /* ----------------------------------------------
       Archiv
    ---------------------------------------------- */
    .archive-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .archive-card {
        padding: 16px;
    }
}