/* Importa Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* Reset e base */
#statistiche-sfc-container * {
    box-sizing: border-box;
}

#statistiche-sfc-container {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

#statistiche-sfc-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 2px,
        rgba(255,255,255,0.03) 2px,
        rgba(255,255,255,0.03) 4px
    );
    pointer-events: none;
    animation: moveBackground 20s linear infinite;
}

@keyframes moveBackground {
    0% { transform: translate(0, 0); }
    100% { transform: translate(20px, 20px); }
}

/* Header */
.sfc-header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
    position: relative;
    z-index: 2;
}

.sfc-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 10px 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    background: linear-gradient(45deg, #fff, #f0f0f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sfc-header p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin: 0;
    font-weight: 400;
}

/* Tabs */
.sfc-tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 8px;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    z-index: 2;
}

.sfc-tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    padding: 15px 20px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    font-family: inherit;
}

.sfc-tab-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.sfc-tab-btn.active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.sfc-tab-btn.pressed {
    transform: translateY(0px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Tab Content */
.sfc-tab-content {
    display: none;
    position: relative;
    z-index: 2;
}

.sfc-tab-content.active {
    display: block;
    animation: fadeInUp 0.5s ease-out;
}

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

/* Cards */
.sfc-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.sfc-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

.sfc-card h3 {
    color: #2c3e50;
    font-size: 1.8rem;
    font-weight: 600;
    margin: 0 0 25px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Form Elements */
.sfc-form-group {
    margin-bottom: 25px;
}

.sfc-form-group label {
    display: block;
    font-weight: 500;
    color: #34495e;
    margin-bottom: 8px;
    font-size: 1rem;
}

.sfc-select {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #e1e8ed;
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    background: white;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 45px;
}

.sfc-select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Player Info */
.sfc-player-info {
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.sfc-player-card {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 25px;
    border-left: 5px solid #3498db;
}

.sfc-player-details h4 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 15px 0;
}

.sfc-player-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.sfc-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sfc-badge.ruolo-por {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
}

.sfc-badge.ruolo-dif {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
}

.sfc-badge.ruolo-cen {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

.sfc-badge.ruolo-att {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

/* Stats Grid */
.sfc-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.sfc-stat-item {
    background: white;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.sfc-stat-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border-color: #3498db;
}

.sfc-stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 5px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sfc-stat-label {
    font-size: 0.9rem;
    color: #7f8c8d;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Chart Container */
.sfc-chart-container {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin: 25px 0;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    height: 400px;
    position: relative;
}

/* Tables */
.sfc-table-container {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    margin-top: 25px;
}

.sfc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.sfc-table thead {
    background: linear-gradient(135deg, #34495e, #2c3e50);
    color: white;
}

.sfc-table th {
    padding: 18px 15px;
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.85rem;
}

.sfc-table td {
    padding: 15px;
    border-bottom: 1px solid #ecf0f1;
    transition: all 0.2s ease;
}

.sfc-table tr:hover {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    transform: scale(1.01);
}

.sfc-table tr.hover-effect {
    background: linear-gradient(135deg, #ebf3fd, #d6eaf8);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.2);
}

.sfc-position {
    display: inline-block;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    text-align: center;
    line-height: 30px;
    font-weight: 600;
    font-size: 0.9rem;
}

.sfc-rating {
    display: inline-block;
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Loading */
.sfc-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    color: white;
}

.sfc-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.sfc-loading p {
    font-size: 1.1rem;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    #statistiche-sfc-container {
        padding: 15px;
        margin: 10px;
        border-radius: 15px;
    }
    
    .sfc-header h2 {
        font-size: 2rem;
    }
    
    .sfc-tabs {
        flex-direction: column;
        gap: 5px;
    }
    
    .sfc-tab-btn {
        padding: 12px 15px;
        font-size: 0.9rem;
    }
    
    .sfc-card {
        padding: 20px;
    }
    
    .sfc-card h3 {
        font-size: 1.5rem;
    }
    
    .sfc-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .sfc-stat-value {
        font-size: 1.5rem;
    }
    
    .sfc-chart-container {
        height: 300px;
        padding: 15px;
    }
    
    .sfc-player-meta {
        justify-content: center;
    }
    
    .sfc-table {
        font-size: 0.85rem;
    }
    
    .sfc-table th,
    .sfc-table td {
        padding: 10px 8px;
    }
}

@media (max-width: 480px) {
    .sfc-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .sfc-header h2 {
        font-size: 1.8rem;
    }
    
    .sfc-chart-container {
        height: 250px;
        padding: 10px;
    }
}

/* Animazioni personalizzate */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.sfc-stat-item:hover .sfc-stat-value {
    animation: pulse 0.6s ease-in-out;
}

/* Effetti speciali per i grafici */
.sfc-chart-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3498db, #2ecc71, #f39c12, #e74c3c);
    border-radius: 15px 15px 0 0;
}

/* Stili per i badge personalizzati */
.sfc-badge:not([class*="ruolo-"]) {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    color: white;
}

/* Statistiche Generali */
.sfc-general-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.sfc-stat-box {
    background: linear-gradient(135deg, #fff, #f8f9fa);
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    border: 2px solid transparent;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.sfc-stat-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3498db, #2ecc71, #f39c12, #e74c3c);
    border-radius: 15px 15px 0 0;
}

.sfc-stat-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    border-color: #3498db;
}

.sfc-stat-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sfc-stat-box .sfc-stat-value {
    font-size: 2.2rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sfc-stat-box .sfc-stat-label {
    font-size: 0.9rem;
    color: #7f8c8d;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Top Bomber Section */
.sfc-top-bomber-section {
    margin: 30px 0;
    background: linear-gradient(135deg, #f39c12, #e67e22);
    border-radius: 15px;
    padding: 25px;
    color: white;
    text-align: center;
}

.sfc-top-bomber-section h4 {
    margin: 0 0 20px 0;
    font-size: 1.4rem;
    font-weight: 600;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.sfc-bomber-card {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.sfc-bomber-name {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.sfc-bomber-gol {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Animazioni per le statistiche */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sfc-stat-box .sfc-stat-value {
    animation: countUp 0.8s ease-out;
}

/* Effetti hover avanzati */
.sfc-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    border-radius: 20px;
}

.sfc-card:hover::after {
    opacity: 1;
}