/* ============================================================
   Football Auto Posts — Frontend Styles (Redesign)
   ============================================================ */

:root {
    --fap-primary: #1f2937;
    --fap-accent: #2563eb;
    --fap-accent-light: #eff6ff;
    --fap-text: #111827;
    --fap-text-secondary: #6b7280;
    --fap-border: #e5e7eb;
    --fap-border-light: #f3f4f6;
}

.fap-block {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    max-width: 900px;
    margin: 2.5rem auto;
    padding: 0 16px;
}

.fap-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 2rem 0;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--fap-accent);
    color: var(--fap-text);
    letter-spacing: -0.3px;
}

/* ===== Resultados / Prévia / Resumo ===== */
.fap-matches-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.fap-match {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1.25rem;
    padding: 1.25rem 1.5rem;
    border: 1px solid var(--fap-border);
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.95) 100%);
    backdrop-filter: blur(10px);
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.fap-match:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    border-left-color: var(--fap-accent);
    transform: translateY(-1px);
}

.fap-match--finished {
    border-color: #dbeafe;
    background: linear-gradient(135deg, rgba(240, 249, 255, 0.8) 0%, rgba(224, 242, 254, 0.8) 100%);
}

.fap-match--finished:hover {
    border-left-color: #0284c7;
}

.fap-match--scheduled {
    border-color: #fef3c7;
    background: linear-gradient(135deg, rgba(255, 251, 235, 0.8) 0%, rgba(254, 243, 199, 0.8) 100%);
}

.fap-match--scheduled:hover {
    border-left-color: #d97706;
}

/* Teams */
.fap-team {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
    flex: 1;
}

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

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

.fap-team--winner .fap-team-name {
    font-weight: 700;
    color: #059669;
}

.fap-crest {
    width: 32px;
    height: 32px;
    object-fit: contain;
    flex-shrink: 0;
    opacity: 0.9;
}

.fap-crest-sm {
    width: 18px;
    height: 18px;
    object-fit: contain;
    vertical-align: middle;
    margin-right: 4px;
    opacity: 0.85;
}

.fap-team-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--fap-text);
    line-height: 1.3;
}

.fap-team--home .fap-team-name {
    text-align: right;
}

.fap-team--away .fap-team-name {
    text-align: left;
}

/* Score */
.fap-score {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--fap-text);
    flex: 0 0 auto;
    min-width: 80px;
}

.fap-score-sep {
    color: var(--fap-text-secondary);
    font-size: 1rem;
    font-weight: 600;
    opacity: 0.6;
}

.fap-vs {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--fap-text-secondary);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* Match meta (horário, rodada) */
.fap-match-meta {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--fap-text-secondary);
    margin-bottom: 0.75rem;
    gap: 1rem;
}

.fap-matchday {
    font-weight: 600;
    color: var(--fap-accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.fap-kickoff {
    color: var(--fap-accent);
    font-weight: 700;
    font-size: 0.9rem;
}

.fap-match-time {
    grid-column: 1 / -1;
    text-align: center;
    font-size: 0.75rem;
    color: var(--fap-text-secondary);
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--fap-border-light);
}

/* ===== Tabelas ===== */
.fap-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    margin-bottom: 2rem;
    border: 1px solid var(--fap-border);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.fap-table thead {
    background: linear-gradient(135deg, var(--fap-primary) 0%, #374151 100%);
    color: #ffffff;
}

.fap-table thead th {
    padding: 12px 14px;
    text-align: center;
    font-weight: 700;
    letter-spacing: 0.3px;
    font-size: 0.8rem;
    text-transform: uppercase;
}

.fap-table thead th:nth-child(2) {
    text-align: left;
}

.fap-table tbody td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--fap-border-light);
    text-align: center;
}

.fap-table tbody td:nth-child(2) {
    text-align: left;
}

.fap-table tbody tr {
    transition: background-color 0.15s ease;
}

.fap-table tbody tr:hover {
    background: var(--fap-accent-light);
}

.fap-table tbody tr:last-child td {
    border-bottom: none;
}

/* Posição / ranking */
.fap-pos {
    font-weight: 700;
    color: var(--fap-accent);
    width: 40px;
    text-align: center;
}

/* Pontos */
.fap-pts {
    font-weight: 800;
    color: var(--fap-accent);
    font-size: 1.05rem;
}

/* Gols (artilheiros) */
.fap-goals {
    color: #dc2626;
    font-weight: 800;
    font-size: 1.1rem;
}

/* Row highlighting */
.fap-row--champions {
    background: rgba(37, 99, 235, 0.06);
    border-left: 3px solid #2563eb;
}

.fap-row--europa {
    background: rgba(234, 88, 12, 0.06);
    border-left: 3px solid #ea580c;
}

.fap-row--conference {
    background: rgba(34, 197, 94, 0.06);
    border-left: 3px solid #22c55e;
}

.fap-row--relegation {
    background: rgba(239, 68, 68, 0.06);
    border-left: 3px solid #ef4444;
}

.fap-row--champions td:first-child,
.fap-row--europa td:first-child,
.fap-row--conference td:first-child,
.fap-row--relegation td:first-child {
    padding-left: 12px;
}

/* ===== Artilheiros Table ===== */
.fap-scorers-table {
    margin-top: 1.5rem;
}

.fap-player-name {
    text-align: left;
    font-weight: 600;
    color: var(--fap-text);
}

.fap-team-cell {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ===== Stats Summary ===== */
.fap-stats-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
    padding: 1.25rem;
    background: linear-gradient(135deg, rgba(229, 231, 235, 0.3) 0%, rgba(243, 244, 246, 0.3) 100%);
    border: 1px solid var(--fap-border);
    border-radius: 10px;
    font-size: 0.9rem;
    color: var(--fap-text-secondary);
}

.fap-stats-summary span {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.fap-stats-summary strong {
    color: var(--fap-accent);
    font-weight: 800;
    font-size: 1.2rem;
}

/* ===== Labels & Info ===== */
.fap-matchday-label {
    font-size: 0.8rem;
    color: var(--fap-text-secondary);
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--fap-border-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.fap-source {
    font-size: 0.7rem;
    color: var(--fap-text-secondary);
    text-align: right;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--fap-border-light);
    opacity: 0.7;
}

/* ===== Tablet (768px) ===== */
@media (max-width: 768px) {
    .fap-block {
        margin: 1.5rem auto;
    }

    .fap-title {
        font-size: 1.3rem;
        margin-bottom: 1.5rem;
    }

    .fap-match {
        padding: 1rem 1.25rem;
        gap: 1rem;
    }

    .fap-table {
        font-size: 0.8rem;
    }

    .fap-table thead th,
    .fap-table tbody td {
        padding: 9px 10px;
    }
}

/* ===== Mobile (640px) ===== */
@media (max-width: 640px) {
    :root {
        --fap-accent: #3b82f6;
    }

    .fap-block {
        padding: 0 12px;
        margin: 1.5rem auto;
    }

    .fap-title {
        font-size: 1.15rem;
        margin-bottom: 1.25rem;
        padding-bottom: 0.75rem;
    }

    .fap-matches-list {
        gap: 0.5rem;
        margin-bottom: 1.5rem;
    }

    .fap-match {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        padding: 1rem;
        border-radius: 8px;
    }

    .fap-match--finished {
        border-color: #bfdbfe;
    }

    .fap-team {
        grid-column: 1;
        justify-content: center;
        gap: 0.5rem;
    }

    .fap-team--home,
    .fap-team--away {
        justify-content: center;
    }

    .fap-team-name {
        font-size: 0.85rem;
        text-align: center;
    }

    .fap-team--home .fap-team-name,
    .fap-team--away .fap-team-name {
        text-align: center;
    }

    .fap-crest {
        width: 28px;
        height: 28px;
    }

    .fap-score {
        grid-column: 1;
        font-size: 1.4rem;
    }

    .fap-vs {
        display: none;
    }

    .fap-match-meta {
        grid-column: 1;
        flex-direction: column;
        gap: 0.4rem;
        margin-bottom: 0.5rem;
    }

    .fap-kickoff {
        font-size: 0.85rem;
    }

    .fap-match-time {
        margin-top: 0.5rem;
        padding-top: 0.5rem;
    }

    /* Tabelas em mobile */
    .fap-table {
        font-size: 0.75rem;
        margin-bottom: 1.25rem;
    }

    .fap-table thead th,
    .fap-table tbody td {
        padding: 8px 6px;
    }

    .fap-table thead th {
        font-size: 0.7rem;
    }

    .fap-crest-sm {
        width: 16px;
        height: 16px;
    }

    .fap-stats-summary {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        padding: 1rem;
        margin: 1.5rem 0;
    }

    .fap-stats-summary span {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .fap-source {
        margin-top: 1.5rem;
        padding-top: 1rem;
    }
}

/* ===== Extra small (480px) ===== */
@media (max-width: 480px) {
    .fap-match {
        padding: 0.85rem;
        gap: 0.4rem;
    }

    .fap-score {
        font-size: 1.3rem;
    }

    .fap-team-name {
        font-size: 0.8rem;
    }

    .fap-crest {
        width: 26px;
        height: 26px;
    }
}

/* ===== Print styles ===== */
@media print {
    .fap-block {
        page-break-inside: avoid;
    }

    .fap-match,
    .fap-table tbody tr {
        page-break-inside: avoid;
    }

    .fap-match:hover,
    .fap-table tbody tr:hover {
        background: inherit;
        box-shadow: none;
        border-left-color: transparent;
        transform: none;
    }

    .fap-source {
        display: none;
    }
}
