/**
 * CSS per mod_calcio_statistiche v3.0.0
 * Statistiche Complete Campionato
 */

.mod-calcio-statistiche {
    margin: 20px 0;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

.mod-calcio-statistiche *,
.mod-calcio-statistiche *::before,
.mod-calcio-statistiche *::after {
    box-sizing: border-box;
}

.stats-card {
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    width: 100%;
    max-width: 100%;
}

/* HEADER */
.stats-header {
    padding: 15px 20px;
    text-align: center;
    border-bottom: 1px dashed rgba(0, 0, 0, 0.1);
}

.stats-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
}

/* CONTAINER */
.stats-container {
    padding: 20px;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

/* ERRORE */
.stats-error {
    text-align: center;
    padding: 30px 20px;
}

.error-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.error-message {
    font-size: 15px;
    color: #dc3545;
}

/* ========================================
   SUMMARY CAMPIONATO
   ======================================== */
.campionato-summary {
    margin-bottom: 25px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border-left: 4px solid #ff6600;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.summary-title {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stats-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 15px;
    width: 100%;
}

.summary-item {
    text-align: center;
    padding: 15px 10px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.summary-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.summary-value {
    font-size: 24px;
    font-weight: 700;
    color: #000;
    margin-bottom: 3px;
}

.summary-label {
    font-size: 11px;
    color: #666;
    text-transform: uppercase;
    font-weight: 600;
}

/* Extra stats campionato */
.campionato-extra-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding-top: 15px;
    border-top: 1px dashed rgba(0, 0, 0, 0.1);
}

.extra-stat-group {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.extra-stat-label {
    color: #666;
    font-weight: 500;
}

.extra-stat-value {
    font-weight: 700;
    color: #333;
}

.extra-stat-separator {
    color: #ccc;
}

.risultati-frequenti-camp {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.risultato-freq-badge {
    display: inline-block;
    padding: 3px 10px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
    color: #333;
}

/* ========================================
   MARCATORI LIST
   ======================================== */
.marcatori-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.marcatore-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 8px;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.marcatore-item:hover {
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-left-color: #ff6600;
}

.marcatore-rank {
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ff6600 0%, #ff8533 100%);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    border-radius: 50%;
    flex-shrink: 0;
}

.marcatore-photo,
.marcatore-photo-placeholder {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
}

.marcatore-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.marcatore-photo-placeholder {
    font-size: 24px;
}

.marcatore-info {
    flex: 1;
    min-width: 0;
}

.marcatore-nome {
    font-size: 16px;
    font-weight: 600;
    color: #000;
    margin-bottom: 3px;
}

.marcatore-details {
    font-size: 13px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ruolo {
    font-weight: 500;
}

.separator {
    color: #ccc;
}

.squadra {
    color: #888;
}

.marcatore-reti {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 12px;
    background: linear-gradient(135deg, rgba(255, 102, 0, 0.1) 0%, rgba(255, 133, 51, 0.1) 100%);
    border-radius: 6px;
    flex-shrink: 0;
}

.reti-numero {
    font-size: 20px;
    font-weight: 700;
    color: #ff6600;
}

.reti-label {
    font-size: 10px;
    color: #666;
    text-transform: uppercase;
}

/* ========================================
   STATISTICHE SQUADRE
   ======================================== */
.squadre-stats-table {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.squadra-stats-item {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.squadra-stats-item:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

/* Header Squadra */
.squadra-stats-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 3px solid #ff6600;
}

.posizione {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ff6600 0%, #ff8533 100%);
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(255, 102, 0, 0.3);
}

.squadra-nome-stats {
    flex: 1;
    font-size: 18px;
    font-weight: 700;
    color: #000;
}

.punti-badge {
    padding: 8px 18px;
    background: linear-gradient(135deg, #28a745 0%, #34ce57 100%);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

/* Grid Statistiche */
.squadra-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    padding: 20px;
    background: #fafafa;
}

.stat-col {
    padding: 15px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.stat-title {
    font-size: 12px;
    font-weight: 700;
    color: #555;
    text-transform: uppercase;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #ff6600;
    letter-spacing: 0.5px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    font-size: 13px;
}

.stat-row.sub {
    padding-left: 12px;
    font-size: 12px;
    color: #777;
}

.stat-row.muted {
    opacity: 0.7;
    font-size: 12px;
}

.stat-label {
    font-weight: 500;
    color: #444;
}

.stat-value {
    font-weight: 700;
    color: #000;
}

.stat-value.small {
    font-size: 11px;
    font-weight: 600;
}

.stat-value.positive {
    color: #28a745;
}

.stat-value.negative {
    color: #dc3545;
}

.stat-detail {
    font-size: 10px;
    color: #999;
    margin-left: 5px;
}

/* Colori per tipi di statistiche */
.stat-row.vittorie .stat-value {
    color: #28a745;
}

.stat-row.pareggi .stat-value {
    color: #ffc107;
}

.stat-row.sconfitte .stat-value {
    color: #dc3545;
}

.stat-row.gol-fatti .stat-value {
    color: #007bff;
}

.stat-row.gol-subiti .stat-value {
    color: #dc3545;
}

.stat-row.diff-reti .stat-value {
    color: #ff6600;
    font-size: 15px;
}

.stat-value.cleansheet {
    color: #17a2b8;
}

.stat-row.over .stat-value {
    color: #28a745;
}

.stat-row.under .stat-value {
    color: #6c757d;
}

.stat-row.goal .stat-value {
    color: #28a745;
}

.stat-row.nogoal .stat-value {
    color: #6c757d;
}

.stat-row.record-win .stat-value {
    color: #28a745;
}

.stat-row.record-loss .stat-value {
    color: #dc3545;
}

.stat-value.serie-pos {
    color: #28a745;
}

.stat-value.serie-neg {
    color: #dc3545;
}

.stat-row.punti-perc .stat-value {
    color: #ff6600;
    font-weight: 800;
}

.risultato-badge-inline {
    display: inline-block;
    padding: 2px 8px;
    background: #f0f0f0;
    border-radius: 4px;
    font-weight: 700;
}

/* ========================================
   TREND SECTION
   ======================================== */
.trend-section {
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
}

.trend-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 12px;
}

.ultimi-5,
.ultimi-10 {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ultimi-label {
    font-size: 12px;
    font-weight: 600;
    color: #666;
    min-width: 70px;
}

.ultimi-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    max-width: 160px;
}

.risultato-badge {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    border-radius: 50%;
    color: #fff;
}

.risultato-v {
    background: linear-gradient(135deg, #28a745 0%, #34ce57 100%);
}

.risultato-p {
    background: linear-gradient(135deg, #ffc107 0%, #ffcd39 100%);
    color: #333;
}

.risultato-s {
    background: linear-gradient(135deg, #dc3545 0%, #e4606d 100%);
}

.punti-trend {
    font-size: 12px;
    font-weight: 700;
    color: #ff6600;
    margin-left: 5px;
}

/* Punti Casa vs Trasferta */
.punti-location {
    display: flex;
    align-items: center;
    gap: 15px;
    padding-top: 10px;
    border-top: 1px dashed #ddd;
}

.punti-loc-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.punti-loc-icon {
    font-size: 14px;
}

.punti-loc-value {
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

.punti-loc-separator {
    color: #ccc;
}

/* ========================================
   FILTRI FRONTEND
   ======================================== */
.stats-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0 0 20px;
    padding: 15px;
    border-radius: 10px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
}

.stats-filter-row {
    display: flex;
    flex-direction: column;
    min-width: 180px;
    flex: 1 1 220px;
}

.stats-filter-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 5px;
    color: #666;
}

.stats-filter-mode,
.stats-filter-teams {
    border-radius: 8px;
    border: 1px solid #ddd;
    padding: 8px 12px;
    font-size: 13px;
    outline: none;
    background: #fff;
    transition: border-color 0.2s;
}

.stats-filter-mode:focus,
.stats-filter-teams:focus {
    border-color: #ff6600;
}

.stats-filter-teams {
    min-height: 80px;
}

.stats-filter-help {
    margin-top: 5px;
    font-size: 10px;
    color: #999;
}

/* ========================================
   NO DATA
   ======================================== */
.no-data {
    text-align: center;
    padding: 60px 20px;
}

.no-data-icon {
    font-size: 64px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.no-data-message {
    font-size: 16px;
    color: #999;
}

/* ========================================
   ANIMAZIONI
   ======================================== */
.animate-stat {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.5s ease forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-stat[data-delay="0"] { animation-delay: 0s; }
.animate-stat[data-delay="50"] { animation-delay: 0.05s; }
.animate-stat[data-delay="100"] { animation-delay: 0.1s; }
.animate-stat[data-delay="150"] { animation-delay: 0.15s; }
.animate-stat[data-delay="200"] { animation-delay: 0.2s; }
.animate-stat[data-delay="250"] { animation-delay: 0.25s; }
.animate-stat[data-delay="300"] { animation-delay: 0.3s; }
.animate-stat[data-delay="350"] { animation-delay: 0.35s; }
.animate-stat[data-delay="400"] { animation-delay: 0.4s; }
.animate-stat[data-delay="450"] { animation-delay: 0.45s; }
.animate-stat[data-delay="500"] { animation-delay: 0.5s; }
.animate-stat[data-delay="550"] { animation-delay: 0.55s; }
.animate-stat[data-delay="600"] { animation-delay: 0.6s; }
.animate-stat[data-delay="650"] { animation-delay: 0.65s; }
.animate-stat[data-delay="700"] { animation-delay: 0.7s; }
.animate-stat[data-delay="750"] { animation-delay: 0.75s; }
.animate-stat[data-delay="800"] { animation-delay: 0.8s; }

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 1200px) {
    .squadra-stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .squadra-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .trend-row {
        flex-direction: column;
        gap: 12px;
    }
}

@media (max-width: 768px) {
    .stats-summary {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .summary-item {
        padding: 12px 8px;
    }
    
    .summary-icon {
        font-size: 24px;
        margin-bottom: 5px;
    }
    
    .summary-value {
        font-size: 22px;
    }
    
    .summary-label {
        font-size: 10px;
    }
    
    .squadra-stats-header {
        flex-wrap: wrap;
    }
    
    .squadra-nome-stats {
        width: calc(100% - 100px);
    }
    
    .squadra-stats-grid {
        grid-template-columns: 1fr;
        padding: 15px;
    }
    
    .campionato-extra-stats {
        flex-direction: column;
        gap: 10px;
    }
    
    .punti-location {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .punti-loc-separator {
        display: none;
    }
}

@media (max-width: 480px) {
    .stats-container {
        padding: 12px;
    }
    
    .campionato-summary {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .summary-title {
        font-size: 14px;
        margin-bottom: 12px;
    }
    
    .stats-header h3 {
        font-size: 18px;
    }
    
    .stats-summary {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .summary-item {
        padding: 10px 5px;
    }
    
    .summary-icon {
        font-size: 20px;
        margin-bottom: 4px;
    }
    
    .summary-value {
        font-size: 20px;
    }
    
    .summary-label {
        font-size: 9px;
    }
    
    .squadra-stats-header {
        padding: 12px 15px;
    }
    
    .squadra-nome-stats {
        font-size: 16px;
        width: 100%;
        margin-bottom: 10px;
    }
    
    .punti-badge {
        padding: 6px 14px;
        font-size: 14px;
    }
    
    .stat-col {
        padding: 12px;
    }
    
    .ultimi-5,
    .ultimi-10 {
        flex-wrap: wrap;
        width: 100%;
    }
    
    .ultimi-label {
        width: 100%;
        margin-bottom: 5px;
    }
    
    .ultimi-badges {
        max-width: 100%;
    }
    
    .ultimi-10 .ultimi-badges {
        max-width: 155px;
    }
    
    .risultato-badge {
        width: 24px;
        height: 24px;
        font-size: 10px;
    }
    
    .punti-trend {
        width: 100%;
        margin-left: 0;
        margin-top: 5px;
    }
    
    .extra-stat-group {
        font-size: 12px;
    }
    
    .risultati-frequenti-camp {
        flex-wrap: wrap;
    }
    
    .risultato-freq-badge {
        font-size: 11px;
        padding: 2px 8px;
    }
}
