﻿/*
===============================================================================
GEDIAN SPORTS
Manage Competition
===============================================================================
*/

.manage-competition-page {
    --mc-navy: #0f2747;
    --mc-navy-dark: #071a33;
    --mc-green: #5b8c3b;
    --mc-green-dark: #416d2b;
    --mc-border: #e2e9f0;
    --mc-muted: #6a7889;
    color: var(--mc-navy-dark);
}

.manage-competition-header {
    display: flex;
    min-height: 150px;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 24px 27px;
    border-radius: 22px;
    background: radial-gradient( circle at top right, rgba(255,255,255,.13), transparent 25rem), linear-gradient( 135deg, var(--mc-navy-dark), var(--mc-navy));
    color: #fff;
    box-shadow: 0 15px 38px rgba(7, 26, 51, .16);
}

.manage-competition-eyebrow {
    display: block;
    margin-bottom: 4px;
    color: #bdd9ad;
    font-size: .72rem;
    font-weight: 900;
}

.manage-competition-header h1 {
    margin: 0;
    font-size: clamp(1.5rem, 3vw, 2.15rem);
    font-weight: 950;
}

.manage-competition-header p {
    margin: 6px 0 0;
    color: #dbe5ef;
    font-size: .85rem;
    font-weight: 750;
}

.manage-competition-header-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 10px;
}

    .manage-competition-header-meta span {
        display: inline-flex;
        min-height: 27px;
        align-items: center;
        padding: 0 9px;
        border: 1px solid rgba(255,255,255,.18);
        border-radius: 999px;
        background: rgba(255,255,255,.08);
        color: #e2eaf2;
        font-size: .68rem;
        font-weight: 850;
    }

.manage-competition-header-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.manage-competition-section {
    margin-top: 22px;
    overflow: hidden;
    border: 1px solid var(--mc-border);
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 9px 28px rgba(7, 26, 51, .07);
}

.manage-competition-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 18px 21px;
    border-bottom: 1px solid var(--mc-border);
    background: linear-gradient( 135deg, rgba(91, 140, 59, .09), rgba(15, 39, 71, .025));
}

    .manage-competition-section-heading > div:first-child {
        display: flex;
        align-items: center;
        gap: 11px;
    }

        .manage-competition-section-heading > div:first-child > span {
            display: grid;
            width: 39px;
            height: 39px;
            flex: 0 0 39px;
            place-items: center;
            border-radius: 12px;
            background: var(--mc-navy);
            color: #fff;
            font-weight: 950;
        }

    .manage-competition-section-heading h2 {
        margin: 0;
        color: var(--mc-navy-dark);
        font-size: 1.08rem;
        font-weight: 950;
    }

    .manage-competition-section-heading p {
        margin: 4px 0 0;
        color: var(--mc-muted);
        font-size: .75rem;
    }

.manage-competition-empty,
.statistics-selection-empty {
    padding: 50px 20px;
    text-align: center;
}

    .manage-competition-empty > div,
    .statistics-selection-empty > div {
        font-size: 2.1rem;
    }

    .manage-competition-empty h3,
    .statistics-selection-empty h3 {
        margin: 10px 0 5px;
        font-size: 1rem;
        font-weight: 950;
    }

    .manage-competition-empty p,
    .statistics-selection-empty p {
        margin: 0 0 14px;
        color: var(--mc-muted);
        font-size: .79rem;
    }

.competition-club-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 15px;
    padding: 20px;
}

.competition-club-card {
    position: relative;
    display: flex;
    min-width: 0;
    overflow: hidden;
    flex-direction: column;
    border: 1px solid var(--mc-border);
    border-radius: 18px;
    background: #fff;
    cursor: pointer;
    box-shadow: 0 7px 20px rgba(7, 26, 51, .055);
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

    .competition-club-card:hover,
    .competition-club-card:focus-visible {
        transform: translateY(-4px);
        border-color: rgba(91, 140, 59, .58);
        outline: none;
        box-shadow: 0 13px 28px rgba(7, 26, 51, .11);
    }

    .competition-club-card.is-selected {
        border-color: var(--mc-green);
        box-shadow: inset 0 4px 0 var(--mc-green), 0 11px 28px rgba(91, 140, 59, .13);
    }

.competition-club-card-top {
    position: relative;
    display: flex;
    min-height: 113px;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: radial-gradient( circle at top right, rgba(91, 140, 59, .12), transparent 11rem), #f6f9fb;
}

.competition-club-logo {
    display: grid;
    width: 84px;
    height: 84px;
    overflow: hidden;
    place-items: center;
    border: 4px solid #fff;
    border-radius: 50%;
    background: #e8f1e3;
    color: var(--mc-green-dark);
    font-size: 1.45rem;
    font-weight: 950;
    box-shadow: 0 7px 18px rgba(7, 26, 51, .13);
}

    .competition-club-logo img {
        width: 100%;
        height: 100%;
        padding: 5px;
        object-fit: contain;
        background: #fff;
    }

.competition-club-status {
    position: absolute;
    top: 10px;
    inset-inline-end: 10px;
    display: inline-flex;
    min-height: 24px;
    align-items: center;
    padding: 0 8px;
    border-radius: 999px;
    font-size: .59rem;
    font-weight: 900;
}

    .competition-club-status.is-registered {
        background: #eaf2fb;
        color: #2f6394;
    }

    .competition-club-status.is-participating {
        background: #e7f4e0;
        color: #3f7027;
    }

    .competition-club-status.is-eliminated,
    .competition-club-status.is-completed {
        background: #eef1f4;
        color: #596775;
    }

    .competition-club-status.is-withdrawn {
        background: #fff1d8;
        color: #8b5d08;
    }

    .competition-club-status.is-disqualified {
        background: #fde9e9;
        color: #a33434;
    }

.competition-club-card-body {
    flex: 1;
    padding: 15px 15px 13px;
    text-align: center;
}

.competition-club-card h3 {
    margin: 0;
    color: var(--mc-navy-dark);
    font-size: .98rem;
    font-weight: 950;
}

.competition-club-name-en {
    margin-top: 3px;
    color: var(--mc-muted);
    font-size: .67rem;
    text-align: center;
}

.competition-club-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
    min-height: 27px;
    margin-top: 10px;
}

    .competition-club-tags span {
        padding: 4px 7px;
        border-radius: 8px;
        background: #f0f4f7;
        color: #667487;
        font-size: .59rem;
        font-weight: 800;
    }

.competition-club-mini-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
    margin-top: 13px;
}

    .competition-club-mini-stats > div {
        padding: 7px 4px;
        border: 1px solid #edf1f5;
        border-radius: 10px;
        background: #fbfcfd;
    }

    .competition-club-mini-stats strong,
    .competition-club-mini-stats span {
        display: block;
    }

    .competition-club-mini-stats strong {
        color: var(--mc-navy);
        font-size: .88rem;
        font-weight: 950;
    }

    .competition-club-mini-stats span {
        margin-top: 1px;
        color: var(--mc-muted);
        font-size: .56rem;
    }

.competition-club-score-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 10px;
}

    .competition-club-score-line span,
    .competition-club-score-line strong {
        padding: 4px 7px;
        border-radius: 8px;
        font-size: .6rem;
    }

    .competition-club-score-line span {
        background: #f2f5f8;
        color: #657386;
    }

    .competition-club-score-line strong {
        background: #e8f3e2;
        color: var(--mc-green-dark);
    }

.competition-club-card-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
    padding: 10px;
    border-top: 1px solid var(--mc-border);
    background: #fbfcfd;
}

    .competition-club-card-actions form {
        margin: 0;
    }

.competition-club-form-body,
.statistics-form-body {
    padding: 21px;
}

.competition-club-form .form-control,
.competition-club-form .form-select,
.competition-statistics-form .form-control,
.competition-statistics-form .form-select {
    min-height: 45px;
    border-color: #d8e1eb;
    border-radius: 10px;
}

.competition-club-form textarea.form-control,
.competition-statistics-form textarea.form-control {
    min-height: auto;
}

.competition-club-form .form-control:focus,
.competition-club-form .form-select:focus,
.competition-statistics-form .form-control:focus,
.competition-statistics-form .form-select:focus {
    border-color: var(--mc-green);
    box-shadow: 0 0 0 .2rem rgba(91, 140, 59, .12);
}

.manage-competition-advanced {
    overflow: hidden;
    border: 1px solid var(--mc-border);
    border-radius: 13px;
    background: #fafcfd;
}

    .manage-competition-advanced summary {
        padding: 12px 14px;
        color: var(--mc-navy);
        font-size: .78rem;
        font-weight: 900;
        cursor: pointer;
        user-select: none;
    }

    .manage-competition-advanced[open] summary {
        border-bottom: 1px solid var(--mc-border);
        background: #f4f8fb;
    }

    .manage-competition-advanced > .row {
        padding: 0 14px 15px;
    }

.competition-club-form-actions,
.statistics-form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 16px 21px;
    border-top: 1px solid var(--mc-border);
    background: #fbfcfd;
    color: var(--mc-muted);
    font-size: .72rem;
    line-height: 1.7;
}

    .competition-club-form-actions strong {
        color: var(--mc-navy);
    }

.selected-statistics-club {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 21px;
    border-bottom: 1px solid var(--mc-border);
    background: linear-gradient( 135deg, rgba(91, 140, 59, .11), rgba(15, 39, 71, .02));
}

.selected-statistics-club-logo {
    display: grid;
    width: 62px;
    height: 62px;
    flex: 0 0 62px;
    overflow: hidden;
    place-items: center;
    border: 3px solid #fff;
    border-radius: 50%;
    background: #e8f1e3;
    color: var(--mc-green-dark);
    font-size: 1.1rem;
    font-weight: 950;
    box-shadow: 0 5px 13px rgba(7, 26, 51, .11);
}

    .selected-statistics-club-logo img {
        width: 100%;
        height: 100%;
        padding: 4px;
        object-fit: contain;
        background: #fff;
    }

.selected-statistics-club > div:nth-child(2) {
    min-width: 0;
    flex: 1;
}

    .selected-statistics-club > div:nth-child(2) > span {
        color: var(--mc-green-dark);
        font-size: .65rem;
        font-weight: 900;
    }

.selected-statistics-club h3 {
    margin: 2px 0 0;
    color: var(--mc-navy-dark);
    font-size: 1rem;
    font-weight: 950;
}

.selected-statistics-club p {
    margin: 2px 0 0;
    color: var(--mc-muted);
    font-size: .66rem;
    text-align: start;
}

.selected-statistics-points {
    min-width: 105px;
    padding: 10px 12px;
    border-radius: 13px;
    background: var(--mc-navy);
    color: #fff;
    text-align: center;
}

    .selected-statistics-points small,
    .selected-statistics-points strong,
    .selected-statistics-points span {
        display: block;
    }

    .selected-statistics-points small {
        color: #cbd8e5;
        font-size: .58rem;
    }

    .selected-statistics-points strong {
        margin-top: 2px;
        font-size: 1.35rem;
        font-weight: 950;
    }

    .selected-statistics-points span {
        margin-top: 2px;
        color: #bdd9ad;
        font-size: .55rem;
    }

.statistics-live-summary {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 8px;
}

    .statistics-live-summary > div {
        padding: 10px 7px;
        border: 1px solid var(--mc-border);
        border-radius: 11px;
        background: #f8fafc;
        text-align: center;
    }

    .statistics-live-summary strong,
    .statistics-live-summary span {
        display: block;
    }

    .statistics-live-summary strong {
        color: var(--mc-navy);
        font-size: 1rem;
        font-weight: 950;
    }

    .statistics-live-summary span {
        margin-top: 2px;
        color: var(--mc-muted);
        font-size: .57rem;
    }

.statistics-block {
    height: 100%;
    padding: 15px;
    border: 1px solid var(--mc-border);
    border-radius: 14px;
    background: #fbfcfd;
}

    .statistics-block h4 {
        margin: 0 0 14px;
        padding-bottom: 9px;
        border-bottom: 1px solid var(--mc-border);
        color: var(--mc-navy);
        font-size: .83rem;
        font-weight: 950;
    }

    .statistics-block .form-label {
        color: #536174;
        font-size: .68rem;
        font-weight: 800;
    }

@media (max-width: 1199.98px) {
    .competition-club-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .statistics-live-summary {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 991.98px) {
    .manage-competition-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .manage-competition-header-actions {
        width: 100%;
    }

    .competition-club-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .competition-club-form-actions,
    .statistics-form-actions {
        align-items: stretch;
        flex-direction: column;
    }
}

@media (max-width: 575.98px) {
    .manage-competition-header {
        min-height: auto;
        padding: 19px;
        border-radius: 17px;
    }

    .manage-competition-header-actions,
    .manage-competition-header-actions .btn {
        width: 100%;
    }

    .manage-competition-section-heading {
        align-items: flex-start;
        flex-direction: column;
        padding: 16px;
    }

        .manage-competition-section-heading .btn {
            width: 100%;
        }

    .competition-club-grid {
        grid-template-columns: 1fr;
        padding: 15px;
    }

    .competition-club-form-body,
    .statistics-form-body {
        padding: 16px;
    }

    .selected-statistics-club {
        align-items: flex-start;
        flex-wrap: wrap;
        padding: 16px;
    }

    .selected-statistics-points {
        width: 100%;
    }

    .statistics-live-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .competition-club-form-actions,
    .statistics-form-actions {
        padding: 15px 16px;
    }

        .competition-club-form-actions > div:last-child,
        .competition-club-form-actions > div:last-child .btn,
        .statistics-form-actions .btn {
            width: 100%;
        }
}


/* ==========================================================================
   GROUPED COMPETITION CLUBS
   ========================================================================== */

.competition-groups-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.competition-group-block {
    padding: 0;
    border-bottom: 1px solid var(--mc-border);
}

    .competition-group-block:last-child {
        border-bottom: 0;
    }

.competition-group-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 15px 20px 4px;
}

    .competition-group-heading > div:first-child {
        display: flex;
        align-items: center;
        gap: 8px;
    }

.competition-group-label {
    display: inline-flex;
    min-height: 31px;
    align-items: center;
    padding: 0 12px;
    border-radius: 999px;
    background: var(--mc-navy);
    color: #fff;
    font-size: .76rem;
    font-weight: 950;
}

.competition-group-heading small {
    color: var(--mc-muted);
    font-size: .66rem;
    font-weight: 800;
}

.competition-group-order-note {
    color: #7d8998;
    font-size: .62rem;
    font-weight: 750;
}

.competition-club-rank {
    position: absolute;
    top: 10px;
    inset-inline-start: 10px;
    display: grid;
    min-width: 48px;
    min-height: 46px;
    place-items: center;
    padding: 4px 7px;
    border: 1px solid rgba(91, 140, 59, .20);
    border-radius: 12px;
    background: #fff;
    color: var(--mc-green-dark);
    box-shadow: 0 5px 13px rgba(7, 26, 51, .08);
}

    .competition-club-rank small,
    .competition-club-rank strong {
        display: block;
        line-height: 1;
    }

    .competition-club-rank small {
        color: var(--mc-muted);
        font-size: .5rem;
        font-weight: 800;
    }

    .competition-club-rank strong {
        margin-top: 3px;
        font-size: 1rem;
        font-weight: 950;
    }


/* ==========================================================================
   VISUAL CLUB PICKER
   ========================================================================== */

.selected-club-control {
    display: flex;
    min-height: 64px;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border: 1px solid #d8e1eb;
    border-radius: 13px;
    background: #fbfcfd;
}

.selected-club-preview {
    display: flex;
    min-width: 0;
    flex: 1;
    align-items: center;
    gap: 10px;
}

    .selected-club-preview > div:last-child {
        min-width: 0;
    }

    .selected-club-preview strong,
    .selected-club-preview small {
        display: block;
    }

    .selected-club-preview strong {
        overflow: hidden;
        color: var(--mc-navy-dark);
        font-size: .82rem;
        font-weight: 950;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .selected-club-preview small {
        margin-top: 3px;
        overflow: hidden;
        color: var(--mc-muted);
        font-size: .62rem;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

.selected-club-preview-logo {
    display: grid;
    width: 45px;
    height: 45px;
    flex: 0 0 45px;
    overflow: hidden;
    place-items: center;
    border: 1px solid var(--mc-border);
    border-radius: 11px;
    background: #fff;
    color: var(--mc-green-dark);
    font-weight: 950;
}

    .selected-club-preview-logo.is-empty {
        background: #f3f6f8;
        color: #8290a0;
    }

    .selected-club-preview-logo img {
        width: 100%;
        height: 100%;
        padding: 3px;
        object-fit: contain;
    }

.club-picker-panel {
    margin-top: 18px;
    overflow: hidden;
    border: 1px solid rgba(91, 140, 59, .32);
    border-radius: 17px;
    background: #fff;
    box-shadow: 0 14px 34px rgba(7, 26, 51, .11);
}

.club-picker-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--mc-border);
    background: linear-gradient( 135deg, rgba(91, 140, 59, .11), rgba(15, 39, 71, .03));
}

    .club-picker-header h3 {
        margin: 0;
        color: var(--mc-navy-dark);
        font-size: .97rem;
        font-weight: 950;
    }

    .club-picker-header p {
        margin: 4px 0 0;
        color: var(--mc-muted);
        font-size: .69rem;
    }

.club-picker-close {
    display: grid;
    width: 35px;
    height: 35px;
    flex: 0 0 35px;
    place-items: center;
    border: 1px solid var(--mc-border);
    border-radius: 10px;
    background: #fff;
    color: var(--mc-navy);
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

    .club-picker-close:hover {
        border-color: #cbd6e0;
        background: #f1f5f8;
    }

.club-picker-filters {
    display: grid;
    grid-template-columns: minmax(210px, .8fr) minmax(280px, 1.5fr) 90px;
    gap: 12px;
    align-items: end;
    padding: 16px 18px;
    border-bottom: 1px solid var(--mc-border);
    background: #fbfcfd;
}

.club-picker-result-counter {
    display: grid;
    min-height: 45px;
    place-items: center;
    padding: 5px 9px;
    border: 1px solid #d8e1eb;
    border-radius: 10px;
    background: #fff;
    text-align: center;
}

    .club-picker-result-counter small,
    .club-picker-result-counter strong {
        display: block;
    }

    .club-picker-result-counter small {
        color: var(--mc-muted);
        font-size: .55rem;
    }

    .club-picker-result-counter strong {
        color: var(--mc-green-dark);
        font-size: 1rem;
        font-weight: 950;
    }

.club-picker-table-wrap {
    position: relative;
    max-height: 430px;
    overflow: auto;
}

.club-picker-table {
    min-width: 760px;
}

    .club-picker-table thead {
        position: sticky;
        top: 0;
        z-index: 3;
    }

        .club-picker-table thead th {
            padding: 11px 10px;
            border-bottom: 1px solid #dce4ec;
            background: #f1f5f8;
            color: var(--mc-navy);
            font-size: .68rem;
            font-weight: 950;
            text-align: center;
            white-space: nowrap;
        }

    .club-picker-table tbody td {
        padding: 9px 10px;
        border-color: #edf1f5;
        color: #435166;
        font-size: .7rem;
        text-align: center;
        vertical-align: middle;
    }

.club-picker-row {
    transition: background-color .15s ease, box-shadow .15s ease;
}

    .club-picker-row:hover {
        background: #f4f9f1;
        box-shadow: inset -3px 0 0 var(--mc-green);
    }

.club-picker-logo {
    display: grid;
    width: 42px;
    height: 42px;
    margin-inline: auto;
    overflow: hidden;
    place-items: center;
    border: 1px solid var(--mc-border);
    border-radius: 10px;
    background: #fff;
    color: var(--mc-green-dark);
    font-weight: 950;
}

    .club-picker-logo img {
        width: 100%;
        height: 100%;
        padding: 3px;
        object-fit: contain;
    }

.club-picker-no-results {
    padding: 35px 20px;
    text-align: center;
}

    .club-picker-no-results strong,
    .club-picker-no-results span {
        display: block;
    }

    .club-picker-no-results strong {
        color: var(--mc-navy-dark);
        font-size: .85rem;
        font-weight: 950;
    }

    .club-picker-no-results span {
        margin-top: 4px;
        color: var(--mc-muted);
        font-size: .68rem;
    }

@media (max-width: 767.98px) {
    .club-picker-filters {
        grid-template-columns: 1fr;
    }

    .club-picker-result-counter {
        display: flex;
        justify-content: space-between;
        padding-inline: 13px;
    }

    .selected-club-control {
        align-items: stretch;
        flex-direction: column;
    }

        .selected-club-control > .btn {
            width: 100%;
        }

    .competition-group-heading {
        align-items: flex-start;
        flex-direction: column;
    }
}
