* {
    box-sizing: border-box;
}

.calendario-wrapper {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 40px 20px;
    min-height: 400px;
}

.calendario-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0;
}

.calendario-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 30px 40px;
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.calendario-header h2 {
    margin: 0 0 10px 0;
    font-size: 36px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.calendario-header .subtitle {
    margin: 0;
    color: #666;
    font-size: 16px;
}

.filtro-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 25px 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    align-items: flex-end;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.filtro-group {
    flex: 1;
    min-width: 250px;
}

.filtro-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filtro-group label svg {
    color: #667eea;
}

.filtro-group select {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.filtro-group select:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.filtro-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.25);
}

#tabella-calendario {
    min-height: 200px;
}

.loading-spinner {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 60px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.spinner {
    border: 4px solid rgba(102, 126, 234, 0.2);
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.loading-spinner p {
    color: #666;
    font-size: 16px;
    margin: 0;
}

.no-data,
.error-message {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 60px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.no-data p,
.error-message p {
    font-size: 18px;
    color: #666;
    margin: 0;
}

.data-gruppo {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    margin-bottom: 30px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.data-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px 30px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.data-header h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
}

.partite-count {
    font-size: 14px;
    background: rgba(255, 255, 255, 0.2);
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 600;
}

.tabella-partite {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.tabella-partite thead tr {
    background: #2c3e50;
    color: white;
}

.tabella-partite th {
    padding: 15px 20px;
    text-align: left;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.tabella-partite th:last-child {
    border-right: none;
}

.tabella-partite tbody tr {
    border-bottom: 1px solid #e0e0e0;
    transition: background-color 0.2s ease;
}

.tabella-partite tbody tr:hover {
    background-color: #f8f9fa;
}

.tabella-partite tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

.tabella-partite tbody tr:nth-child(even):hover {
    background-color: #f0f0f0;
}

.tabella-partite td {
    padding: 15px 20px;
    font-size: 15px;
    border-right: 1px solid #e0e0e0;
    color: #333;
}

.tabella-partite td:last-child {
    border-right: none;
}

.col-competizione {
    font-weight: 700;
    color: #667eea;
    min-width: 180px;
}

.col-turno {
    font-weight: 600;
    color: #555;
    text-align: center;
    min-width: 120px;
}

.col-data {
    color: #666;
    font-family: 'Courier New', monospace;
    text-align: center;
    min-width: 110px;
}

.col-casa {
    font-weight: 600;
    color: #27ae60;
    min-width: 200px;
}

.col-trasferta {
    font-weight: 600;
    color: #e74c3c;
    min-width: 200px;
}

@media (max-width: 1200px) {
    .tabella-partite {
        font-size: 14px;
    }
    
    .tabella-partite th,
    .tabella-partite td {
        padding: 12px 15px;
    }
}

@media (max-width: 768px) {
    .calendario-wrapper {
        padding: 20px 10px;
    }
    
    .calendario-header {
        padding: 20px;
    }
    
    .calendario-header h2 {
        font-size: 28px;
    }
    
    .filtro-container {
        padding: 20px;
        gap: 20px;
    }
    
    .filtro-group {
        min-width: 100%;
    }
    
    .data-header {
        padding: 15px 20px;
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .data-header h3 {
        font-size: 18px;
    }
    
    .tabella-partite {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .tabella-partite th,
    .tabella-partite td {
        padding: 10px;
        font-size: 13px;
        white-space: nowrap;
    }
}

@media (max-width: 480px) {
    .calendario-header h2 {
        font-size: 24px;
    }
    
    .calendario-header .subtitle {
        font-size: 14px;
    }
    
    .tabella-partite th,
    .tabella-partite td {
        padding: 8px;
        font-size: 12px;
    }
}