/**
 * Gamification CSS - HarmonyDrop Theme
 * Design moderno, chiaro e mobile-responsive
 * Compatibile con day/night mode
 */

/* ========================================
   VARIABILI GLOBALI (Light Mode)
   ======================================== */
:root {
    --gam-primary: #8b5cf6;
    --gam-primary-dark: #7c3aed;
    --gam-secondary: #3b82f6;
    --gam-accent: #f98f1d;
    --gam-success: #10b981;
    --gam-warning: #f59e0b;
    --gam-danger: #ef4444;
    
    --gam-bg-main: #ffffff;
    --gam-bg-secondary: #f9fafb;
    --gam-bg-card: #ffffff;
    --gam-bg-hover: #f3f4f6;
    
    --gam-text-primary: #1f2937;
    --gam-text-secondary: #6b7280;
    --gam-text-muted: #9ca3af;
    
    --gam-border-color: #e5e7eb;
    --gam-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --gam-shadow-lg: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* ========================================
   CONTAINER E LAYOUT BASE
   ======================================== */
#gamification-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

.gamification-container {
    background: var(--gam-bg-main);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--gam-shadow);
}

/* ========================================
   USER STATS HEADER
   ======================================== */
.gamification-user-stats {
    background: linear-gradient(135deg, var(--gam-primary) 0%, var(--gam-secondary) 100%);
    border-radius: 12px;
    padding: 1.5rem;
    color: white;
    margin-bottom: 1.5rem;
}

.gamification-user-stats .user-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.gamification-user-stats .user-info {
    flex: 1;
}

.gamification-user-stats .user-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: white;
    line-height: 1.3;
}

.gamification-user-stats .user-level {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 0.25rem;
}

.gamification-user-stats .user-streak {
    text-align: right;
}

.gamification-user-stats .streak-number {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    line-height: 1.2;
}

.gamification-user-stats .streak-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.85);
    margin-top: 0.25rem;
}

.gamification-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.gamification-stat-card {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

.gamification-stat-card .stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    display: block;
}

.gamification-stat-card .stat-label {
    font-size: 0.75rem;
    opacity: 0.9;
    display: block;
    margin-top: 0.25rem;
    color: #ffffff;
}

/* Badge per evidenziare info importanti */
.gamification-badge-accent {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, var(--gam-primary), var(--gam-secondary));
    color: white;
    border-radius: 16px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

.gamification-highlight {
    color: var(--gam-accent);
    font-weight: 700;
}

/* ========================================
   NAVIGATION TABS
   ======================================== */
.gamification-tabs {
    background: var(--gam-bg-card);
    border-radius: 12px;
    padding: 0.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    box-shadow: var(--gam-shadow);
}

.gamification-tab-btn {
    flex: 1;
    min-width: 140px;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--gam-bg-secondary);
    color: var(--gam-text-secondary);
}

.gamification-tab-btn:hover {
    background: var(--gam-bg-hover);
}

.gamification-tab-btn.active {
    background: linear-gradient(135deg, var(--gam-primary) 0%, var(--gam-secondary) 100%);
    color: white;
    box-shadow: var(--gam-shadow-lg);
}

/* ========================================
   CARDS E CONTENUTI
   ======================================== */
.gamification-card {
    background: var(--gam-bg-card);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border: 1px solid var(--gam-border-color);
    transition: all 0.2s ease;
    line-height: 1.6;
    position: relative;
    overflow: visible;
}

.gamification-card:hover {
    box-shadow: var(--gam-shadow-lg);
    transform: translateY(-2px);
}

.gamification-card-header {
    margin-bottom: 1.25rem;
}

.gamification-card-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gam-text-primary);
    margin: 0 0 0.5rem 0;
}

.gamification-card-subtitle {
    font-size: 0.95rem;
    color: var(--gam-text-secondary);
    margin: 0;
}

/* ========================================
   FORM ELEMENTS
   ======================================== */
.gamification-form-group {
    margin-bottom: 1.25rem;
}

.gamification-label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--gam-text-primary);
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
}

.gamification-input,
.gamification-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--gam-border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: var(--gam-bg-main);
    color: var(--gam-text-primary);
}

.gamification-input:focus,
.gamification-select:focus {
    outline: none;
    border-color: var(--gam-primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

/* ========================================
   BUTTONS
   ======================================== */
.gamification-btn {
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-block;
    text-align: center;
    text-decoration: none;
}

.gamification-btn-primary {
    background: linear-gradient(135deg, var(--gam-primary) 0%, var(--gam-secondary) 100%);
    color: white;
    box-shadow: var(--gam-shadow-lg);
}

.gamification-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.gamification-btn-block {
    width: 100%;
    display: block;
}

.gamification-btn-lg {
    padding: 1.125rem 2rem;
    font-size: 1.125rem;
}

/* ========================================
   PREDICTIONS
   ======================================== */
.prediction-item {
    background: var(--gam-bg-card);
    border: 2px solid var(--gam-border-color);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    transition: all 0.2s ease;
}

.prediction-item:hover {
    box-shadow: var(--gam-shadow-lg);
}

.prediction-item.correct {
    border-color: var(--gam-success);
    background: linear-gradient(to right, rgba(16, 185, 129, 0.05), transparent);
}

.prediction-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.prediction-dj-name {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gam-text-primary);
}

.prediction-status {
    padding: 0.375rem 0.875rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

.prediction-status.pending {
    background: #fef3c7;
    color: #92400e;
}

.prediction-status.correct {
    background: #d1fae5;
    color: #065f46;
}

.prediction-status.close {
    background: #dbeafe;
    color: #1e40af;
}

.prediction-status.wrong {
    background: #fee2e2;
    color: #991b1b;
}

.prediction-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 1rem;
}

.prediction-detail-item {
    text-align: left;
}

.prediction-detail-label {
    font-size: 0.875rem;
    color: var(--gam-text-secondary);
    display: block;
    margin-bottom: 0.25rem;
}

.prediction-detail-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gam-text-primary);
}

.prediction-points {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gam-border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.prediction-points-earned {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gam-success);
}

/* ========================================
   FANTASY LEAGUE
   ======================================== */
.fantasy-team-card {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(59, 130, 246, 0.1));
    border: 2px solid var(--gam-primary);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.fantasy-team-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.fantasy-team-header h3 {
    font-size: 2rem;
    font-weight: 700;
    color: #1a1a1a !important;
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
    display: block !important;
    visibility: visible !important;
}

.fantasy-team-header p {
    color: #6b7280 !important;
    margin: 0;
    display: block !important;
    visibility: visible !important;
    font-size: 1rem;
    line-height: 1.5;
}

#dj-selector {
    max-height: 600px;
    overflow-y: auto;
    padding-right: 0.5rem;
    display: block !important;
    visibility: visible !important;
    position: relative;
    width: 100%;
    margin: 0;
    clear: both;
}

/* DJ SELECTOR ITEMS */
.dj-selector-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #ffffff;
    position: relative;
}

.dj-selector-item:hover {
    border-color: #8b5cf6;
    background: rgba(139, 92, 246, 0.05);
    transform: translateX(4px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.dj-selector-item.selected {
    border-color: #8b5cf6;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(59, 130, 246, 0.1));
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
}

.dj-selector-item .dj-checkbox,
.dj-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    flex-shrink: 0;
    margin: 0;
    accent-color: #8b5cf6;
    position: relative !important;
}

.dj-selector-item .dj-avatar,
.dj-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e5e7eb;
    flex-shrink: 0;
    position: relative !important;
}

.dj-selector-item .dj-info,
#dj-selector .dj-info {
    flex: 1;
    min-width: 0;
    display: flex !important;
    flex-direction: column;
    gap: 4px;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    z-index: auto !important;
}

.dj-selector-item .dj-header,
#dj-selector .dj-header {
    display: flex !important;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    visibility: visible !important;
}

.dj-selector-item .dj-name,
#dj-selector .dj-name {
    font-weight: 700;
    font-size: 16px;
    color: #1f2937 !important;
    line-height: 1.3;
    display: inline-block !important;
    visibility: visible !important;
    text-shadow: none !important;
    margin: 0 !important;
}

.dj-selector-item .top-badge,
#dj-selector .top-badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    color: #1f2937;
    display: inline-block !important;
}

.top-badge.top-1 {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
}

.top-badge.top-2 {
    background: linear-gradient(135deg, #c0c0c0, #e8e8e8);
}

.top-badge.top-3 {
    background: linear-gradient(135deg, #cd7f32, #d4a574);
}

.dj-selector-item .dj-meta,
#dj-selector .dj-meta {
    display: flex !important;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #6b7280 !important;
    visibility: visible !important;
}

.dj-selector-item .dj-country,
#dj-selector .dj-country {
    color: #6b7280 !important;
    display: inline-block !important;
}

.dj-selector-item .dj-genre,
#dj-selector .dj-genre {
    color: #8b5cf6 !important;
    font-weight: 500;
    display: inline-block !important;
}

.dj-selector-item .dj-stats,
#dj-selector .dj-stats {
    display: flex !important;
    align-items: center;
    gap: 8px;
    visibility: visible !important;
}

.dj-selector-item .dj-points,
#dj-selector .dj-points {
    padding: 3px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    color: white !important;
    display: inline-block !important;
    visibility: visible !important;
}

.dj-selector-item .dj-points.points-high,
#dj-selector .dj-points.points-high {
    background: #10b981 !important;
}

.dj-selector-item .dj-points.points-medium,
#dj-selector .dj-points.points-medium {
    background: #3b82f6 !important;
}

.dj-selector-item .dj-points.points-low,
#dj-selector .dj-points.points-low {
    background: #8b5cf6 !important;
}

.dj-selector-item .dj-points.points-default,
#dj-selector .dj-points.points-default {
    background: #6b7280 !important;
}

.dj-selector-item .dj-rank,
#dj-selector .dj-rank {
    color: #8b5cf6 !important;
    font-weight: 700;
    font-size: 13px;
    display: inline-block !important;
    visibility: visible !important;
}

#dj-selector::-webkit-scrollbar {
    width: 8px;
}

#dj-selector::-webkit-scrollbar-track {
    background: #f9fafb;
    border-radius: 4px;
}

#dj-selector::-webkit-scrollbar-thumb {
    background: #e5e7eb;
    border-radius: 4px;
}

#dj-selector::-webkit-scrollbar-thumb:hover {
    background: #8b5cf6;
}

/* ========================================
   ACHIEVEMENTS
   ======================================== */
.achievement-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.achievement-item {
    background: var(--gam-bg-card);
    border: 2px solid var(--gam-border-color);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.2s ease;
}

.achievement-item:hover {
    box-shadow: var(--gam-shadow-lg);
    transform: translateY(-2px);
}

.achievement-item.unlocked {
    border-color: var(--gam-success);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05), transparent);
}

.achievement-item.locked {
    opacity: 0.6;
    filter: grayscale(50%);
}

.achievement-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.achievement-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gam-text-primary);
    margin-bottom: 0.5rem;
}

.achievement-description {
    font-size: 0.875rem;
    color: var(--gam-text-secondary);
    margin-bottom: 1rem;
}

.achievement-badge {
    display: inline-block;
    padding: 0.375rem 0.875rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.achievement-badge.unlocked {
    background: #d1fae5;
    color: #065f46;
}

.achievement-badge.locked {
    background: var(--gam-bg-secondary);
    color: var(--gam-text-muted);
}

/* ========================================
   EMPTY STATES
   ======================================== */
.gamification-empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--gam-text-secondary);
}

.gamification-empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.gamification-empty-state-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.gamification-empty-state-description {
    font-size: 0.95rem;
}

/* ========================================
   RESPONSIVE - MOBILE
   ======================================== */
@media (max-width: 768px) {
    #gamification-content {
        padding: 0.75rem;
    }
    
    .gamification-container {
        padding: 1rem;
    }
    
    .gamification-user-stats {
        padding: 1.25rem;
    }
    
    .gamification-card {
        padding: 1.25rem;
        line-height: 1.7;
    }
    
    .gamification-card-title {
        font-size: 1.25rem;
        line-height: 1.4;
    }
    
    .gamification-card-subtitle {
        font-size: 0.9rem;
        line-height: 1.5;
    }
    
    .gamification-user-stats .user-header {
        flex-direction: column;
        text-align: center;
    }
    
    .gamification-user-stats .user-streak {
        margin-top: 1rem;
        text-align: center;
    }
    
    .gamification-stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .gamification-tabs {
        flex-direction: column;
    }
    
    .gamification-tab-btn {
        width: 100%;
        min-width: 0;
    }
    
    .prediction-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .leaderboard-item {
        padding: 1rem;
    }
    
    .achievement-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   UTILITIES
   ======================================== */
.gamification-text-center {
    text-align: center;
}

.gamification-mb-4 {
    margin-bottom: 1.5rem;
}

.gamification-mt-4 {
    margin-top: 1.5rem;
}

.gamification-hidden {
    display: none !important;
}
