/* ===== STILI GENERALI ===== */
#voti-settimanali-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    color: #333;
}

/* ===== HEADER ===== */
.voti-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.voti-header h2 {
    margin: 0;
    color: #2c3e50;
    font-size: 2.2em;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== CONTROLLI ===== */
.voti-controls {
    background: rgba(255, 255, 255, 0.95);
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.giornata-selector {
    text-align: center;
}

.giornata-selector label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 1.1em;
}

#giornata-select {
    padding: 12px 20px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: white;
    color: #333;
    min-width: 250px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

#giornata-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
    transform: translateY(-2px);
}

#giornata-select:hover {
    border-color: #667eea;
    transform: translateY(-1px);
}

/* ===== FILTRI ===== */
.voti-filters {
    background: rgba(255, 255, 255, 0.95);
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.filter-section h3 {
    margin: 0 0 20px 0;
    color: #2c3e50;
    font-size: 1.3em;
    font-weight: 600;
    text-align: center;
}

.filters-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    align-items: end;
}

.filter-item label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
    font-size: 0.9em;
}

.filter-item input[type="text"] {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
    box-sizing: border-box;
}

.filter-item input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.btn-clear {
    background: linear-gradient(45deg, #e74c3c, #c0392b);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(231, 76, 60, 0.3);
    width: 100%;
}

.btn-clear:hover {
    background: linear-gradient(45deg, #c0392b, #a93226);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(231, 76, 60, 0.4);
}

/* ===== LOADING SPINNER ===== */
#loading-spinner {
    text-align: center;
    padding: 40px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

#loading-spinner p {
    color: #666;
    font-weight: 500;
    margin: 0;
}

/* ===== RISULTATI ===== */
#voti-results {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.results-info {
    padding: 15px 20px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    font-weight: 600;
}

.results-count {
    font-size: 1.1em;
}

.table-container {
    overflow-x: auto;
    max-height: 600px;
    overflow-y: auto;
}

/* ===== TABELLA ===== */
.voti-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: white;
}

.voti-table thead {
    background: linear-gradient(45deg, #34495e, #2c3e50);
    color: white;
    position: sticky;
    top: 0;
    z-index: 10;
}

.voti-table th {
    padding: 15px 10px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #2c3e50;
    position: relative;
    white-space: nowrap;
}

.voti-table th.numeric {
    text-align: center;
}

.voti-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
}

.voti-table th.sortable:hover {
    background: rgba(255, 255, 255, 0.1);
}

.sort-icon {
    margin-left: 5px;
    font-size: 12px;
    opacity: 0.7;
}

.voti-table tbody tr {
    transition: all 0.2s ease;
    border-bottom: 1px solid #eee;
}

.voti-table tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

.voti-table tbody tr:hover,
.voti-table tbody tr.hover {
    background: linear-gradient(45deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    transform: scale(1.01);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.voti-table td {
    padding: 12px 10px;
    border-bottom: 1px solid #eee;
    transition: all 0.2s ease;
}

.voti-table td.numeric {
    text-align: center;
    font-weight: 500;
}

.player-name {
    font-weight: 600;
    color: #2c3e50;
}

/* ===== CLASSI VOTO ===== */
.voto-cell {
    font-weight: 700;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 1.1em;
}

.voto-high {
    background: linear-gradient(45deg, #27ae60, #2ecc71);
    color: white;
    box-shadow: 0 2px 8px rgba(46, 204, 113, 0.3);
}

.voto-medium {
    background: linear-gradient(45deg, #f39c12, #e67e22);
    color: white;
    box-shadow: 0 2px 8px rgba(243, 156, 18, 0.3);
}

.voto-low {
    background: linear-gradient(45deg, #e74c3c, #c0392b);
    color: white;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
}

.voto-very-low {
    background: linear-gradient(45deg, #8e44ad, #9b59b6);
    color: white;
    box-shadow: 0 2px 8px rgba(155, 89, 182, 0.3);
}

/* ===== MESSAGGI ===== */
.no-data {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
    font-size: 1.2em;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    margin: 0;
}

.error-message {
    background: linear-gradient(45deg, #e74c3c, #c0392b);
    color: white;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.error-message strong {
    display: block;
    margin-bottom: 10px;
    font-size: 1.1em;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    #voti-settimanali-container {
        padding: 15px;
        margin: 10px;
    }
    
    .voti-header h2 {
        font-size: 1.8em;
    }
    
    .filters-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .voti-table {
        font-size: 12px;
    }
    
    .voti-table th,
    .voti-table td {
        padding: 8px 6px;
    }
    
    .mobile-hidden {
        display: none !important;
    }
    
    .table-container {
        max-height: 400px;
    }
    
    .btn-clear {
        padding: 12px 20px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .voti-header {
        padding: 15px;
    }
    
    .voti-header h2 {
        font-size: 1.5em;
    }
    
    .voti-controls,
    .voti-filters {
        padding: 20px;
    }
    
    #giornata-select {
        min-width: 200px;
        font-size: 14px;
    }
    
    .voti-table {
        font-size: 11px;
    }
    
    .voto-cell {
        font-size: 1em;
        padding: 6px 8px;
    }
}

/* ===== ANIMAZIONI E TRANSIZIONI ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.voti-filters,
#voti-results {
    animation: fadeIn 0.5s ease-out;
}

/* ===== SCROLLBAR PERSONALIZZATA ===== */
.table-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.table-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, #667eea, #764ba2);
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, #5a6fd8, #6a4190);
}

/* ===== TOOLTIP STYLES ===== */
[title] {
    position: relative;
    cursor: help;
}

/* ===== ACCESSIBILITÀ ===== */
.voti-table:focus-within {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.sortable:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* ===== STAMPA ===== */
@media print {
    #voti-settimanali-container {
        background: white;
        box-shadow: none;
        color: black;
    }
    
    .voti-controls,
    .voti-filters {
        display: none;
    }
    
    .voti-table {
        font-size: 10px;
    }
    
    .voto-cell {
        background: #f0f0f0 !important;
        color: black !important;
        box-shadow: none !important;
    }
}