/**
 * Styles for team sub-pages (Resultados, Calendário, Elenco)
 */

/* Results Page */
.team-results-page,
.team-calendar-page,
.team-squad-page {
    margin-top: 1.25rem;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 2rem;
}

.matches-results-list,
.matches-calendar-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.match-result-item,
.match-fixture-item {
    padding: 1rem 1.25rem;
    transition: box-shadow 0.3s;
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

/* Goal.com-like results list (light theme) */
.goal-results-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.goal-result-row {
    display: grid;
    grid-template-columns: 92px 1fr auto 1fr;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: #fff;
}

.goal-result-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    color: #64748b;
    font-size: 0.85rem;
}

.goal-result-status {
    font-weight: 800;
    color: #111827;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 0.75rem;
}

.goal-result-date {
    font-variant-numeric: tabular-nums;
}

.goal-result-team {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
    text-decoration: none;
    color: #111827;
}

.goal-result-team:hover,
.goal-result-team:focus-visible {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.goal-home {
    justify-content: flex-end;
    text-align: right;
}

.goal-away {
    justify-content: flex-start;
    text-align: left;
}

.goal-team-logo {
    width: 26px;
    height: 26px;
    object-fit: contain;
    flex: 0 0 auto;
}

.goal-team-name {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.goal-result-score {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0 0.15rem;
    font-variant-numeric: tabular-nums;
}

.goal-result-score .score-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.55em;
    padding: 0.22rem 0.42rem;
    border-radius: 8px;
    background: #0b1220;
    color: #fff;
    font-weight: 700;
    line-height: 1;
}

@media (max-width: 640px) {
    .goal-result-row {
        grid-template-columns: 60px 1fr auto 1fr;
        padding: 0.75rem 0.75rem;
        gap: 0.5rem;
    }
    .goal-team-logo {
        width: 28px;
        height: 28px;
    }
    /* Hide team names - show only logos on mobile */
    .goal-team-name {
        display: none;
    }
    .goal-result-team {
        gap: 0;
        justify-content: center;
    }
}

.match-result-item:hover,
.match-fixture-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.match-result-date,
.fixture-date-time {
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 0;
}

.match-fixture-item {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 1rem;
    align-items: center;
}

.fixture-date-time {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 0.5rem;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    gap: 0.35rem;
}

.fixture-datetime {
    font-size: 0.95rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.1;
    text-align: center;
}

.match-result-content,
.fixture-content {
    /* Only the matchup lives here now; keep it perfectly centered */
    display: flex;
    align-items: center;
    justify-content: center;
}

.match-result-teams,
.fixture-teams {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    column-gap: 0.75rem;
    align-self: center;
}

.match-team-result,
.fixture-team {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.team-logo-small {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.team-name {
    font-weight: 500;
    color: #1a1a1a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.team-score {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1976d2;
    margin-left: auto;
}

.vs-separator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: #fff;
    color: #64748b;
    font-weight: 700;
    font-size: 0.9rem;
    line-height: 1;
    transform: translateY(-1px);
}

.fixture-team.is-home {
    justify-content: flex-end;
}

.fixture-team.is-away {
    justify-content: flex-start;
}

/* Clickable team links in fixtures list (Calendário) */
.fixture-team-link {
    text-decoration: none;
    color: #111827; /* keep team names black */
}

.fixture-team-link:hover .team-name,
.fixture-team-link:focus-visible .team-name {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.match-result-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.875rem;
    align-self: flex-start;
}

.match-result-badge.win {
    background: #4caf50;
    color: white;
}

.match-result-badge.loss {
    background: #f44336;
    color: white;
}

.match-result-badge.draw {
    background: #ff9800;
    color: white;
}

.home-badge,
.away-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0;
}

.home-badge {
    background: #e3f2fd;
    color: #1976d2;
}

.away-badge {
    background: #fff3e0;
    color: #f57c00;
}

.fixture-venue {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #64748b;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    text-align: center;
    justify-content: center;
}

/* Venue inside the left date/time box (often wraps on narrow widths) */
.fixture-date-time .fixture-venue {
    margin-top: 0;
    font-size: 0.8rem;
    line-height: 1.15;
    text-wrap: balance;
}

.calendar-month-header {
    margin: 1.5rem 0 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.calendar-month-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
}

@media (max-width: 768px) {
    /* Remove gap - using border-bottom for separation instead */
    .matches-results-list,
    .matches-calendar-list {
        gap: 0;
    }
    
    /* Remove border and full width on mobile for fixture items */
    .match-fixture-item,
    .match-result-item {
        border: none;
        border-radius: 0;
        margin-left: -1rem;
        margin-right: -1rem;
        padding: 0.9rem 1rem;
        box-shadow: none;
        border-bottom: 1px solid var(--border-color, #e0e0e0);
    }
    
    .match-fixture-item:last-child,
    .match-result-item:last-child {
        border-bottom: none;
    }
    
    .match-fixture-item:hover,
    .match-result-item:hover {
        box-shadow: none;
    }
    
    .match-fixture-item {
        grid-template-columns: 84px 1fr;
    }

    .team-logo-small {
        width: 34px;
        height: 34px;
    }
    
    /* Calendar month headers - full width on mobile */
    .calendar-month-header {
        margin-left: -1rem;
        margin-right: -1rem;
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

@media (max-width: 520px) {
    .match-fixture-item {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .fixture-date-time {
        flex-direction: row;
        gap: 0.75rem;
        justify-content: flex-start;
    }

    /* Micro-align venue text within the compact date/time row on mobile */
    .fixture-date-time .fixture-venue {
        transform: translateY(1px);
    }

    .fixture-teams {
        grid-template-columns: 1fr;
        row-gap: 0.5rem;
    }

    .vs-separator {
        width: 28px;
        height: 28px;
        padding: 0;
        border-radius: 50%;
        justify-self: center;
        font-size: 0.75rem;
        flex-shrink: 0;
    }

    .fixture-team.is-home,
    .fixture-team.is-away {
        justify-content: flex-start;
    }
    
}

/* Squad Page */
.squad-position-section {
    margin-bottom: 3rem;
}

.position-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e0e0e0;
}

.players-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.player-card {
    text-align: center;
    padding: 1.5rem;
    transition: transform 0.3s, box-shadow 0.3s;
}

.player-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.player-photo {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    overflow: hidden;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.player-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1976d2;
    color: white;
    font-size: 3rem;
    font-weight: 700;
}

.player-number {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 32px;
    height: 32px;
    background: #1976d2;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    border: 2px solid white;
}

.player-info {
    margin-top: 1rem;
}

.player-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 0.5rem 0;
}

.player-position {
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 0.25rem;
}

.player-age,
.player-nationality {
    font-size: 0.75rem;
    color: #999;
    margin-bottom: 0.25rem;
}

.no-results {
    text-align: center;
    padding: 3rem;
    color: #666;
    font-size: 1.125rem;
}

/* Responsive */
@media (max-width: 768px) {
    .match-result-teams,
    .fixture-teams {
        flex-direction: column;
        align-items: stretch;
    }
    
    .match-team-result,
    .fixture-team {
        min-width: auto;
    }
    
    .players-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}








