/* CSS per il Sistema di Classifiche Multiple */

.analytics-section {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
}

.analytics-header {
    text-align: center;
    margin-bottom: 24px;
}

/* Stili per i tab integrati nella classifica mensile */
.ranking-tab-btn {
    transition: all 0.3s ease;
    border-radius: 6px 6px 0 0;
    position: relative;
    min-width: 120px;
    text-align: center;
}

.ranking-tab-btn.active {
    border-color: #3b82f6 !important;
    color: #3b82f6 !important;
    background-color: #f8fafc;
}

.ranking-tab-btn:hover:not(.active) {
    background-color: #f9fafb;
    border-color: #9ca3af !important;
    color: #374151 !important;
}

.ranking-content {
    transition: all 0.3s ease-in-out;
}

.ranking-content.hidden {
    display: none;
}

.analytics-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    justify-content: center;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 12px;
}

.analytics-tab {
    padding: 10px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
    color: #374151;
    position: relative;
    overflow: hidden;
}

.analytics-tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(218, 165, 32, 0.1), transparent);
    transition: left 0.5s;
}

.analytics-tab:hover::before {
    left: 100%;
}

.analytics-tab:hover {
    border-color: #daa520;
    background: #fffbeb;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(218, 165, 32, 0.2);
}

.analytics-tab.active {
    border-color: #daa520;
    background: linear-gradient(135deg, #daa520, #b8860b);
    color: white;
    box-shadow: 0 6px 12px rgba(218, 165, 32, 0.4);
    transform: translateY(-2px);
}

.analytics-tab.active:hover {
    background: linear-gradient(135deg, #b8860b, #996f1a);
}

.ranking-card {
    background: white;
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 12px;
    margin-top: 0px; /* Spazio per i tooltip che si estendono verso l'alto */
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
    position: relative;
    overflow: visible; /* Permette ai tooltip di essere visibili */
}

/* Prima ranking-card ha margine superiore maggiore */
.ranking-card:first-child {
    margin-top: opx; /* Spazio extra per il primo elemento */
}

.ranking-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #daa520, #ffd700, #daa520);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.ranking-card:hover::before {
    transform: scaleX(1);
}

.ranking-card:hover {
    border-color: #daa520;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.ranking-position {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    position: relative;
}

.ranking-position.top-3 {
    background: linear-gradient(135deg, #daa520, #ffd700);
    animation: pulse-gold 2s infinite;
}

.ranking-position.top-10 {
    background: linear-gradient(135deg, #cd7f32, #d2691e);
}

.ranking-position.regular {
    background: linear-gradient(135deg, #6b7280, #9ca3af);
}

@keyframes pulse-gold {
    0%, 100% { box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
    50% { box-shadow: 0 4px 8px rgba(218, 165, 32, 0.6); }
}

.dj-avatar {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #e5e7eb;
    transition: all 0.3s ease;
}

.ranking-card:hover .dj-avatar {
    border-color: #daa520;
    transform: scale(1.05);
}

.trend-indicator {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 12px;
    margin-left: 8px;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

.trend-up {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    color: #166534;
    border: 1px solid #16a34a;
}

.trend-down {
    background: linear-gradient(135deg, #fef2f2, #fecaca);
    color: #dc2626;
    border: 1px solid #ef4444;
}

.trend-stable {
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    color: #475569;
    border: 1px solid #64748b;
}

.genre-section {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 10px;
    padding: 18px;
    margin-bottom: 20px;
    border-left: 4px solid #daa520;
    transition: all 0.3s ease;
}

.genre-section:hover {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border-left-color: #b8860b;
    transform: translateX(4px);
}

.age-category {
    margin-bottom: 28px;
}

.age-category h4 {
    background: linear-gradient(135deg, #374151, #4b5563);
    color: white;
    padding: 12px 16px;
    border-radius: 8px 8px 0 0;
    margin-bottom: 0;
    font-size: 16px;
    font-weight: 600;
}

.hall-of-fame-card {
    background: linear-gradient(135deg, #fffbeb, #fef3c7, #fbbf24);
    border: 3px solid #daa520;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
}

.hall-of-fame-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: rotate(45deg);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.legend-badge {
    background: linear-gradient(45deg, #daa520, #ffd700);
    color: white;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(218, 165, 32, 0.4);
}

.analytics-filters {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 10px;
    padding: 16px;
    margin-top: 24px;
    border: 1px solid #e5e7eb;
}

.filter-button {
    padding: 8px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    margin: 4px;
    transition: all 0.2s ease;
}

.filter-button:hover {
    border-color: #daa520;
    background: #fffbeb;
}

.filter-button.active {
    border-color: #daa520;
    background: #daa520;
    color: white;
}

.score-display {
    font-size: 20px;
    font-weight: bold;
    background: linear-gradient(135deg, #daa520, #ffd700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #daa520;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.no-data-message {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
    font-size: 16px;
    background: linear-gradient(135deg, #f9fafb, #f3f4f6);
    border-radius: 12px;
    border: 2px dashed #d1d5db;
}

.ranking-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
}

.stat-card:hover {
    border-color: #daa520;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.stat-number {
    font-size: 24px;
    font-weight: bold;
    color: #daa520;
}

.stat-label {
    font-size: 12px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .analytics-tabs {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 8px;
        scrollbar-width: thin;
        scrollbar-color: #daa520 #f1f1f1;
    }
    
    .analytics-tabs::-webkit-scrollbar {
        height: 4px;
    }
    
    .analytics-tabs::-webkit-scrollbar-track {
        background: #f1f1f1;
    }
    
    .analytics-tabs::-webkit-scrollbar-thumb {
        background: #daa520;
        border-radius: 2px;
    }
    
    .analytics-tab {
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .ranking-card {
        padding: 12px;
    }
    
    .ranking-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .analytics-section {
        padding: 12px;
        margin: 12px 0;
    }
    
    .ranking-stats {
        grid-template-columns: 1fr;
    }
    
    .analytics-tab {
        font-size: 11px;
        padding: 8px 12px;
    }
}

/* Stili per bandiere con tooltip */
.flag-container {
    position: relative;
    display: inline-block;
}

.flag-container:hover .flag-tooltip {
    opacity: 1 !important;
}

.artist-flag {
    transition: transform 0.2s ease;
}

.flag-container:hover .artist-flag {
    transform: scale(1.1);
}

.flag-tooltip {
    z-index: 1000;
}
