/* ==========================================================================
   Virtual Football Tournament - Public Styles
   Dark theme professional - Champions League / World Cup inspired
   ========================================================================== */

:root {
    --vft-primary:      #1a3a5c;
    --vft-secondary:    #f0c040;
    --vft-accent:       #27ae60;
    --vft-danger:       #e74c3c;
    --vft-dark:         #0d1b2a;
    --vft-dark-card:    #152535;
    --vft-dark-border:  #1e3a52;
    --vft-text:         #e8edf2;
    --vft-text-muted:   #8ba3bc;
    --vft-white:        #ffffff;
    --vft-radius:       8px;
    --vft-shadow:       0 4px 20px rgba(0, 0, 0, 0.4);
    --vft-transition:   all 0.25s ease;
}

/* Base wrapper */
.vft-wrap {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--vft-dark);
    color: var(--vft-text);
    border-radius: var(--vft-radius);
    overflow: hidden;
    line-height: 1.5;
}

/* --------------------------------------------------------------------------
   Header / Tournament Banner
   -------------------------------------------------------------------------- */
.vft-header {
    background: linear-gradient(135deg, var(--vft-primary) 0%, #0d2035 100%);
    padding: 28px 24px;
    text-align: center;
    border-bottom: 3px solid var(--vft-secondary);
    position: relative;
    overflow: hidden;
}

.vft-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(240,192,64,.08) 0%, transparent 60%);
    pointer-events: none;
}

.vft-header h1 {
    margin: 0 0 6px;
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--vft-white);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.vft-header .vft-status-badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: .5px;
    text-transform: uppercase;
}

.vft-status-badge.active    { background: var(--vft-accent); color: #fff; }
.vft-status-badge.finished  { background: var(--vft-text-muted); color: #fff; }
.vft-status-badge.draft     { background: #555; color: #ccc; }

/* --------------------------------------------------------------------------
   Navigation Tabs
   -------------------------------------------------------------------------- */
.vft-tabs {
    display: flex;
    background: var(--vft-dark-card);
    border-bottom: 1px solid var(--vft-dark-border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.vft-tab-btn {
    flex: 1;
    min-width: 120px;
    padding: 14px 20px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--vft-text-muted);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--vft-transition);
    text-transform: uppercase;
    letter-spacing: .5px;
    white-space: nowrap;
}

.vft-tab-btn:hover {
    color: var(--vft-white);
    background: rgba(255,255,255,.04);
}

.vft-tab-btn.active {
    color: var(--vft-secondary);
    border-bottom-color: var(--vft-secondary);
}

.vft-tab-content {
    display: none;
    padding: 24px;
}

.vft-tab-content.active {
    display: block;
    animation: vftFadeIn .25s ease;
}

@keyframes vftFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* --------------------------------------------------------------------------
   Groups Section
   -------------------------------------------------------------------------- */
.vft-groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.vft-group-card {
    background: var(--vft-dark-card);
    border: 1px solid var(--vft-dark-border);
    border-radius: var(--vft-radius);
    overflow: hidden;
    box-shadow: var(--vft-shadow);
}

.vft-group-card-header {
    background: linear-gradient(90deg, var(--vft-primary), #1e4a6e);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.vft-group-card-header h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--vft-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* --------------------------------------------------------------------------
   Standings Table
   -------------------------------------------------------------------------- */
.vft-standings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.vft-standings-table thead th {
    padding: 8px 10px;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--vft-text-muted);
    text-transform: uppercase;
    letter-spacing: .5px;
    border-bottom: 1px solid var(--vft-dark-border);
    background: rgba(0,0,0,.2);
}

.vft-standings-table thead th:first-child {
    text-align: left;
    padding-left: 14px;
}

.vft-standings-table tbody tr {
    border-bottom: 1px solid rgba(255,255,255,.05);
    transition: var(--vft-transition);
}

.vft-standings-table tbody tr:hover {
    background: rgba(255,255,255,.04);
}

.vft-standings-table tbody tr:last-child {
    border-bottom: none;
}

.vft-standings-table tbody td {
    padding: 9px 10px;
    text-align: center;
    color: var(--vft-text);
}

.vft-standings-table tbody td:first-child {
    text-align: left;
    padding-left: 14px;
}

.vft-team-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.vft-team-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
    border-radius: 3px;
}

.vft-team-logo-placeholder {
    width: 24px;
    height: 24px;
    background: var(--vft-primary);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    color: var(--vft-secondary);
    flex-shrink: 0;
}

.vft-team-name {
    font-weight: 600;
}

.vft-position-1 { background: rgba(240,192,64,.08); }
.vft-position-2 { background: rgba(39,174,96,.06); }
.vft-position-last { background: rgba(231,76,60,.06); }

.vft-pts-cell {
    font-weight: 700;
    color: var(--vft-secondary);
}

/* --------------------------------------------------------------------------
   Matches Section
   -------------------------------------------------------------------------- */
.vft-matches-section { }

.vft-matches-group {
    margin-bottom: 24px;
}

.vft-matches-group-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--vft-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--vft-dark-border);
}

.vft-match-card {
    background: var(--vft-dark-card);
    border: 1px solid var(--vft-dark-border);
    border-radius: var(--vft-radius);
    padding: 14px 16px;
    margin-bottom: 8px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    transition: var(--vft-transition);
}

.vft-match-card:hover {
    border-color: rgba(240,192,64,.3);
    box-shadow: 0 2px 12px rgba(0,0,0,.3);
}

.vft-match-card.finished {
    border-left: 3px solid var(--vft-accent);
}

.vft-match-card.scheduled {
    border-left: 3px solid var(--vft-dark-border);
}

.vft-match-home,
.vft-match-away {
    display: flex;
    align-items: center;
    gap: 8px;
}

.vft-match-home {
    justify-content: flex-end;
    text-align: right;
}

.vft-match-away {
    justify-content: flex-start;
}

.vft-match-home .vft-team-logo,
.vft-match-home .vft-team-logo-placeholder {
    order: 2;
}

.vft-match-home .vft-team-name {
    order: 1;
}

.vft-match-score {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 80px;
}

.vft-score-box {
    background: var(--vft-primary);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--vft-white);
    min-width: 38px;
    text-align: center;
    line-height: 1;
}

.vft-score-vs {
    color: var(--vft-text-muted);
    font-size: 0.8rem;
    font-weight: 600;
}

.vft-score-separator {
    color: var(--vft-text-muted);
    font-weight: 700;
}

/* --------------------------------------------------------------------------
   Bracket / Chaveamento
   -------------------------------------------------------------------------- */
.vft-bracket-wrap {
    overflow-x: auto;
    padding-bottom: 16px;
}

.vft-bracket {
    display: flex;
    gap: 0;
    min-width: max-content;
}

.vft-bracket-round {
    display: flex;
    flex-direction: column;
    min-width: 200px;
    position: relative;
}

.vft-bracket-round-matches {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    flex-grow: 1;
}

.vft-bracket-round + .vft-bracket-round {
    border-left: none;
}

.vft-bracket-round-title {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--vft-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 10px;
    background: rgba(240,192,64,.06);
    border-bottom: 1px solid var(--vft-dark-border);
    margin-bottom: 10px;
}

.vft-bracket-match {
    background: var(--vft-dark-card);
    border: 1px solid var(--vft-dark-border);
    border-radius: var(--vft-radius);
    overflow: hidden;
    margin: 8px 8px;
    position: relative;
}

.vft-bracket-team {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: var(--vft-transition);
}

.vft-bracket-team:first-child {
    border-bottom: 1px solid var(--vft-dark-border);
}

.vft-bracket-team.winner {
    background: rgba(39,174,96,.15);
    color: var(--vft-white);
}

.vft-bracket-team.loser {
    opacity: .5;
}

.vft-bracket-team-score {
    margin-left: auto;
    font-weight: 700;
    color: var(--vft-secondary);
    min-width: 20px;
    text-align: right;
}

.vft-bracket-empty {
    color: var(--vft-text-muted);
    font-style: italic;
    font-size: 0.8rem;
}

/* --------------------------------------------------------------------------
   Cards / Fair Play
   -------------------------------------------------------------------------- */
.vft-card-yellow {
    display: inline-block;
    width: 10px;
    height: 14px;
    background: #f0c040;
    border-radius: 2px;
    vertical-align: middle;
    margin-right: 2px;
}

.vft-card-red {
    display: inline-block;
    width: 10px;
    height: 14px;
    background: #e74c3c;
    border-radius: 2px;
    vertical-align: middle;
    margin-right: 2px;
}

/* --------------------------------------------------------------------------
   Loading / Error States
   -------------------------------------------------------------------------- */
.vft-loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--vft-text-muted);
}

.vft-loading-spinner {
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 3px solid var(--vft-dark-border);
    border-top-color: var(--vft-secondary);
    border-radius: 50%;
    animation: vftSpin .7s linear infinite;
    margin-bottom: 12px;
}

@keyframes vftSpin {
    to { transform: rotate(360deg); }
}

.vft-error {
    background: rgba(231,76,60,.1);
    border: 1px solid rgba(231,76,60,.3);
    border-radius: var(--vft-radius);
    color: #e74c3c;
    padding: 14px 18px;
    font-size: 0.9rem;
}

.vft-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--vft-text-muted);
}

.vft-empty-state svg {
    opacity: .3;
    margin-bottom: 12px;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .vft-header h1 {
        font-size: 1.4rem;
    }

    .vft-tab-btn {
        min-width: 90px;
        padding: 12px 14px;
        font-size: 0.8rem;
    }

    .vft-tab-content {
        padding: 16px;
    }

    .vft-groups-grid {
        grid-template-columns: 1fr;
    }

    .vft-match-card {
        grid-template-columns: 1fr auto 1fr;
        gap: 8px;
        padding: 10px 12px;
    }

    .vft-team-name {
        font-size: 0.8rem;
    }

    .vft-score-box {
        font-size: 1rem;
        padding: 5px 8px;
        min-width: 28px;
    }

    .vft-standings-table {
        font-size: 0.78rem;
    }

    .vft-bracket-round {
        min-width: 160px;
    }
}

@media (max-width: 480px) {
    .vft-match-card {
        grid-template-columns: 1fr 60px 1fr;
    }

    .vft-standings-table thead th:nth-child(n+7) {
        display: none;
    }

    .vft-standings-table tbody td:nth-child(n+7) {
        display: none;
    }
}
