/* ==========================================================================
   DASHBOARD SPORTIVA - CALCETTO STATS (CLASSIFICHE PERSONALIZZATE)
   ========================================================================== */

/* Configurazione Base e Font di Sistema */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f1f5f9;
    color: #1e293b;
    margin: 0;
    padding: 0;
    line-height: 1.5;
}

/* Link del Menu Principale */
.site-header nav a {
    text-decoration: none;
    color: #475569;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.site-header nav a:hover {
    background-color: #e2e8f0;
    color: #0f172a;
}

/* Contenitori e Card Generali */
.card {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    border: 1px solid #e2e8f0;
}

.card h2 {
    margin-top: 0;
    color: #0f172a;
    font-size: 1.4em;
    border-bottom: 2px solid #ef4444;
    padding-bottom: 8px;
    display: inline-block;
    margin-bottom: 20px;
}

/* Griglia delle Statistiche (Home Page) */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

/* Box dei Singoli Contatori */
.stat-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: #cbd5e1;
}

.stat-card.wide {
    grid-column: 1 / -1;
    text-align: left;
}

.stat-label {
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    font-weight: 700;
    margin-bottom: 6px;
}

.stat-value {
    font-size: 2.2em;
    font-weight: 800;
    color: #ef4444;
}

.stat-list {
    font-size: 1em;
    font-weight: 600;
    color: #334155;
    line-height: 1.6;
}

/* Form dei Filtri */
.filters {
    background: #f8fafc;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    margin-bottom: 20px;
}

.filters label {
    font-weight: 600;
    font-size: 0.9em;
    color: #475569;
}

.filters select, .filters button {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background: #fff;
    font-size: 0.9em;
    outline: none;
}

.filters button {
    background: #ef4444;
    color: white;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.filters button:hover {
    background: #dc2626;
}

.btn-secondary {
    color: #64748b;
    text-decoration: none;
    font-size: 0.9em;
    font-weight: 600;
}

/* ==========================================================================
   TABELLE STRUTTURA BASE
   ========================================================================== */
.table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    font-size: 0.95em;
}

.table th {
    background-color: #0f172a;
    color: #ffffff;
    text-transform: uppercase;
    font-size: 0.8em;
    letter-spacing: 0.5px;
    padding: 12px 10px;
    font-weight: 700;
}

.table td {
    padding: 12px 10px;
    border-bottom: 1px solid #e2e8f0;
}

.table-centered th, .table-centered td {
    text-align: center;
}

/* Zebratura standard di base per le righe pari */
.table tbody tr:nth-of-type(even) {
    background-color: #f8fafc;
}

.num {
    font-weight: 600;
    color: #334155;
}

/* ==========================================================================
   GESTIONE SPECIFICA DELLE DUE CLASSIFICHE
   ========================================================================== */

/* --- 1. PRIMO ASSOLUTO (Valido per entrambe le classifiche) --- */
.table-ranking tr.top1 td,
.table-ranking tbody tr:first-child td {
    background-color: #fef2f2 !important; /* Sfondo rosso chiarissimo per il leader */
    color: #dc2626 !important;            /* Scritta rossa in evidenza */
    font-weight: 800 !important;
    font-size: 1.1em !important;          /* Carattere più grande e in bold */
}

/* --- 2. CLASSIFICA VITTORIE (Usa top2to4 per le posizioni dalla 2 alla 4) --- */
.table-ranking tr.top2to4 td {
    font-weight: 700 !important;          /* In grassetto */
    font-size: 1.1em !important;          /* Carattere più grande */
    color: #1e293b !important;
    background-color: #f8fafc !important; /* Sfondo grigio leggero di stacco */
}

/* Reset totale retrocessi/ultimi 4 (Cancellato sfondo rosso, ripristinato default) */
.table-ranking tr.bottom1 td,
.table-ranking tr.bottom2to4 td {
    background-color: transparent !important; 
    color: #1e293b !important;
    font-weight: normal !important;
    font-size: 0.95em !important;
}
/* Ripristina la corretta zebratura anche per le ultime righe che sono pari */
.table-ranking tr.bottom1:nth-of-type(even) td,
.table-ranking tr.bottom2to4:nth-of-type(even) td {
    background-color: #f8fafc !important;
}

/* --- 3. CLASSIFICA GOL (Usa top3 per le posizioni 2 e 3) --- */
.table-ranking tr.top3 td {
    font-weight: 700 !important;          /* In grassetto */
    font-size: 1.1em !important;          /* Carattere più grande */
    color: #1e293b !important;
    background-color: #f8fafc !important;
}


/* ==========================================================================
   PAGINA DELLE PARTITE
   ========================================================================== */
.team-col.winner {
    background-color: #f0fdf4;
    font-weight: bold;
    color: #16a34a;
}

.goal-cell strong {
    font-size: 1.1em;
}

.list-col {
    padding: 2px 0;
    font-size: 0.9em;
}

/* Note in calce */
.note {
    font-size: 0.85em;
    color: #64748b;
    margin-top: 15px;
    line-height: 1.6;
    background: #f1f5f9;
    padding: 10px;
    border-radius: 6px;
}
