/**
 * Dashboard Utente - Stile Moderno & Clean
 */

:root {
    --ep-primary: #4f46e5;       /* Indigo 600 */
    --ep-primary-hover: #4338ca; /* Indigo 700 */
    --ep-bg-light: #f8fafc;      /* Slate 50 */
    --ep-surface: #ffffff;
    --ep-text-main: #1e293b;     /* Slate 800 */
    --ep-text-muted: #64748b;    /* Slate 500 */
    --ep-border: #e2e8f0;        /* Slate 200 */
    --ep-radius-lg: 16px;
    --ep-radius-md: 12px;
    --ep-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --ep-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

/* Container Principale */
.eprize-dashboard-modern-wrapper {
    max-width: 1024px;
    margin: 2rem auto;
    padding: 0 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--ep-text-main);
}

/* --- HEADER UTENTE --- */
.eprize-header-card {
    background: var(--ep-surface);
    border-radius: var(--ep-radius-lg);
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--ep-border);
    box-shadow: var(--ep-shadow-sm);
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 20px;
}

.eprize-user-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.eprize-user-avatar {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    color: var(--ep-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 800;
    position: relative;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.5);
}

.verified-check {
    position: absolute;
    bottom: 0;
    right: 0;
    background: #10b981; /* Emerald 500 */
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

.eprize-user-details h2 {
    margin: 0 0 4px 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ep-text-main);
}

.highlight-name {
    color: var(--ep-primary);
}

.eprize-id-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--ep-bg-light);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    color: var(--ep-text-muted);
    font-weight: 600;
    border: 1px solid var(--ep-border);
}

.eprize-logout-btn-modern {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: white;
    border: 1px solid var(--ep-border);
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ep-text-muted);
    text-decoration: none;
    transition: all 0.2s;
}

.eprize-logout-btn-modern:hover {
    background: #fef2f2;
    color: #ef4444;
    border-color: #fecaca;
    transform: translateY(-1px);
    box-shadow: var(--ep-shadow-sm);
}

/* --- NAVIGAZIONE TAB (Stile Pillole) --- */
.eprize-nav-container {
    margin-bottom: 2rem;
}

.eprize-nav-scroll-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    /* Nasconde scrollbar default ma permette scroll */
    scrollbar-width: none; 
    padding-bottom: 5px; /* Spazio per l'ombra focus */
    margin: 0 -20px; /* Estende ai bordi su mobile */
    padding: 0 20px 10px 20px; /* Padding interno */
}
.eprize-nav-scroll-wrapper::-webkit-scrollbar { display: none; }

.eprize-tabs-nav {
    display: flex;
    background: var(--ep-bg-light); /* Sfondo grigio chiaro */
    padding: 6px;
    border-radius: 14px;
    gap: 6px;
    list-style: none;
    margin: 0;
    min-width: min-content; /* Assicura che i tab non si schiaccino */
    border: 1px solid var(--ep-border);
}

.eprize-tabs-nav-item {
    flex: 1;
    text-align: center;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--ep-text-muted);
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap; /* No a capo */
}

.nav-item-inner {
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Stato Hover */
.eprize-tabs-nav-item:hover:not(.active) {
    background: rgba(0,0,0,0.03);
    color: var(--ep-text-main);
}

/* Stato Attivo (Effetto Card Bianca) */
.eprize-tabs-nav-item.active {
    background: white;
    color: var(--ep-primary);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.1);
}

.eprize-tabs-nav-item i {
    font-size: 1rem;
    transition: transform 0.2s;
}
.eprize-tabs-nav-item.active i {
    transform: scale(1.1);
}

/* --- CONTENUTO TAB --- */
.eprize-dashboard-content-area {
    min-height: 300px;
}

/* Nasconde tutti i tab non attivi */
.eprize-tab-content {
    display: none;
    animation: fadeInTab 0.3s ease-out;
}
.eprize-tab-content.active {
    display: block;
}

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

/* --- CARD INTERNE (Stile Dashboard Card) --- */
.eprize-dashboard-card {
    background: var(--ep-surface);
    border: 1px solid var(--ep-border);
    border-radius: var(--ep-radius-lg);
    padding: 30px;
    box-shadow: var(--ep-shadow-sm);
    margin-bottom: 2rem;
}

/* Header della Card interna */
.eprize-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--ep-border);
}

.eprize-card-header i {
    font-size: 24px;
    color: var(--ep-primary);
    background: #e0e7ff;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.eprize-card-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--ep-text-main);
    font-weight: 700;
}

/* --- FORM STYLES --- */
.eprize-form-row {
    margin-bottom: 20px;
}

.eprize-form-row label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--ep-text-main);
    font-size: 0.9rem;
}

.eprize-form-row input[type="text"],
.eprize-form-row input[type="email"],
.eprize-form-row input[type="password"],
.eprize-form-row input[type="date"],
.eprize-form-row select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--ep-border);
    border-radius: 10px;
    font-size: 1rem;
    color: var(--ep-text-main);
    background: var(--ep-bg-light);
    transition: all 0.2s;
    box-sizing: border-box;
}

.eprize-form-row input:focus,
.eprize-form-row select:focus {
    outline: none;
    border-color: var(--ep-primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Gruppi di campi (es. Nome e Cognome affiancati) */
.eprize-form-row-group {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}
.eprize-form-row-group .eprize-form-row {
    flex: 1;
    margin-bottom: 0;
}

/* Bottoni */
.eprize-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    border: none;
    line-height: 1.2;
}

.eprize-button-primary {
    background: var(--ep-primary);
    color: white !important;
    box-shadow: 0 4px 6px rgba(79, 70, 229, 0.2);
}

.eprize-button-primary:hover {
    background: var(--ep-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(79, 70, 229, 0.3);
}

.eprize-button-danger {
    background: #fee2e2;
    color: #ef4444 !important;
    border: 1px solid #fecaca;
}
.eprize-button-danger:hover {
    background: #fecaca;
    color: #dc2626 !important;
}

/* --- DANGER ZONE (Cancellazione Account) --- */
.eprize-danger-zone-card {
    margin-top: 3rem;
    border: 1px solid #fecaca;
    background: #fff5f5;
    border-radius: var(--ep-radius-lg);
    padding: 24px;
}

.eprize-danger-zone-header {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #b91c1c;
    margin-bottom: 16px;
}
.eprize-danger-zone-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
}

/* --- RESPONSIVE MOBILE --- */
@media (max-width: 768px) {
    .eprize-header-card {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }
    
    .eprize-user-info {
        flex-direction: column;
        gap: 12px;
    }
    
    .eprize-form-row-group {
        flex-direction: column;
        gap: 15px;
    }
    
    .eprize-dashboard-card {
        padding: 20px; /* Meno padding su mobile */
    }
    
    /* Il menu scorre orizzontalmente, quindi non serve altro CSS specifico */
    .eprize-tabs-nav-item {
        padding: 0; /* Il padding è dentro .nav-item-inner */
    }
    .nav-item-inner {
        padding: 10px 16px; /* Bottoni leggermente più compatti */
        font-size: 0.85rem;
    }
}
/* =========================================
   TAB PARTECIPAZIONI - STYLE CARDS
   ========================================= */

.eprize-participations-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Card Singola Partecipazione */
.eprize-participation-card {
    background: #ffffff;
    border: 1px solid var(--ep-border);
    border-radius: var(--ep-radius-md);
    padding: 24px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.eprize-participation-card:hover {
    box-shadow: var(--ep-shadow-md);
    transform: translateY(-2px);
    border-color: #cbd5e1;
}

/* Variante Vincitore */
.eprize-participation-card.winner {
    background: linear-gradient(to bottom right, #ffffff, #fffbeb); /* Sfondo leggermente ambrato */
    border-color: #fcd34d; /* Bordo dorato */
    box-shadow: 0 4px 6px -1px rgba(251, 191, 36, 0.1), 0 2px 4px -1px rgba(251, 191, 36, 0.06);
}

.eprize-participation-card.winner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: #f59e0b; /* Striscia laterale oro */
}

/* Header della Card */
.eprize-participation-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    gap: 15px;
    flex-wrap: wrap;
}

.eprize-contest-info h4 {
    margin: 0 0 6px 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--ep-text-main);
}

.eprize-date {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--ep-text-muted);
}

/* Badge Stato */
.eprize-status-badge span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-participant {
    background: var(--ep-bg-light);
    color: var(--ep-text-muted);
    border: 1px solid var(--ep-border);
}

.badge-winner {
    background: #fef3c7;
    color: #d97706;
    border: 1px solid #fcd34d;
}

/* Lista Vincite */
.eprize-wins-container {
    background: rgba(255, 255, 255, 0.6);
    border-top: 1px dashed #e2e8f0;
    padding-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.eprize-win-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px;
    background: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: 10px;
}

.eprize-win-icon {
    width: 40px;
    height: 40px;
    background: #fff7ed;
    color: #f97316;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.eprize-win-details {
    flex: 1;
}

.eprize-win-details p {
    margin: 0;
    line-height: 1.4;
}

.prize-name {
    font-weight: 700;
    color: var(--ep-text-main);
    font-size: 0.95rem;
}

.win-date {
    color: var(--ep-text-muted);
    font-size: 0.8rem;
}

/* Messaggi e Codici */
.eprize-alert-box {
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
}
.eprize-alert-box.warning { background: #fffbeb; color: #b45309; }
.eprize-alert-box.info { background: #eff6ff; color: #1d4ed8; }
.eprize-alert-box.success { background: #f0fdf4; color: #15803d; }

.eprize-code-box {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.code-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ep-text-muted);
}

.digital-code {
    background: #1e293b;
    color: #22d3ee;
    padding: 6px 12px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-weight: 700;
    letter-spacing: 1px;
    font-size: 0.9rem;
    user-select: all; /* Facilita la copia */
}

/* Stato Vuoto */
.eprize-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--ep-text-muted);
}
.eprize-empty-state i {
    font-size: 3rem;
    margin-bottom: 20px;
    color: #cbd5e1;
}
.eprize-empty-state p {
    font-size: 1.1rem;
    margin-bottom: 24px;
}

/* Responsive */
@media (max-width: 640px) {
    .eprize-participation-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .eprize-status-badge {
        align-self: flex-start;
    }
    
    .eprize-win-item {
        align-items: flex-start;
    }
    
    .eprize-win-icon {
        margin-top: 2px;
    }
}
/* =========================================
   TAB VERIFICA IDENTITÀ
   ========================================= */

.eprize-identity-content {
    margin-top: 10px;
}

/* Box di Stato (Verificato / In Attesa) */
.eprize-status-box {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 24px;
    border-radius: var(--ep-radius-md);
    margin-bottom: 24px;
}

.eprize-status-box.success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.eprize-status-box.pending {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

.eprize-status-box .status-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.eprize-status-box.success .status-icon {
    background: #dcfce7;
    color: #16a34a;
}

.eprize-status-box.pending .status-icon {
    background: #fef3c7;
    color: #d97706;
}

.status-info h4 {
    margin: 0 0 6px 0;
    font-size: 1.1rem;
    font-weight: 700;
}
.status-info p {
    margin: 0;
    opacity: 0.9;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Stato Vuoto (Nessuna Verifica Necessaria) */
.eprize-empty-verification-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--ep-bg-light);
    border-radius: var(--ep-radius-md);
    border: 2px dashed var(--ep-border);
}

.eprize-empty-icon {
    width: 80px;
    height: 80px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px auto;
    font-size: 2.5rem;
    color: #cbd5e1;
    box-shadow: var(--ep-shadow-sm);
}

.eprize-empty-verification-state h4 {
    margin: 0 0 10px 0;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--ep-text-main);
}

.eprize-empty-verification-state p {
    margin: 0 auto;
    max-width: 500px;
    color: var(--ep-text-muted);
    line-height: 1.6;
}

/* Upload File Personalizzato */
.eprize-file-upload-wrapper {
    position: relative;
    width: 100%;
}

.eprize-file-upload-wrapper input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.eprize-file-custom-trigger {
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: var(--ep-radius-md);
    padding: 30px;
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.eprize-file-upload-wrapper:hover .eprize-file-custom-trigger,
.eprize-file-upload-wrapper input[type="file"]:focus + .eprize-file-custom-trigger {
    border-color: var(--ep-primary);
    background: #f5f3ff;
}

.eprize-file-custom-trigger i {
    font-size: 2.5rem;
    color: #94a3b8;
    margin-bottom: 5px;
    transition: color 0.3s;
}

.eprize-file-upload-wrapper:hover .eprize-file-custom-trigger i {
    color: var(--ep-primary);
}

.upload-text {
    font-weight: 600;
    color: var(--ep-text-main);
    font-size: 1rem;
}

.upload-hint {
    font-size: 0.85rem;
    color: var(--ep-text-muted);
}

/* Responsive */
@media (max-width: 640px) {
    .eprize-status-box {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 15px;
    }
}
/* =========================================
   DANGER ZONE (Cancellazione Account)
   ========================================= */

.eprize-danger-zone-card {
    border: 1px solid #fee2e2;
    background: #fef2f2;
    overflow: hidden;
}

.eprize-danger-zone-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #fecaca;
}

.eprize-danger-icon {
    width: 48px;
    height: 48px;
    background: #fee2e2;
    color: #ef4444;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.eprize-danger-title h3 {
    margin: 0;
    color: #991b1b;
    font-size: 1.25rem;
    font-weight: 700;
}
.eprize-danger-title p {
    margin: 4px 0 0 0;
    color: #b91c1c;
    font-size: 0.9rem;
}

.eprize-danger-zone-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.eprize-danger-content h4 {
    margin: 0 0 8px 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #7f1d1d;
}
.eprize-danger-content p {
    margin: 0;
    color: #991b1b;
    font-size: 0.9rem;
    max-width: 600px;
}

/* Bottone Danger */
.eprize-button-danger {
    background: white;
    border: 1px solid #ef4444;
    color: #dc2626 !important;
}

.eprize-button-danger:hover {
    background: #dc2626;
    color: white !important;
    border-color: #dc2626;
}


/* =========================================
   MODALE CANCELLAZIONE (Overlay)
   ========================================= */

.eprize-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6); /* Sfondo scuro semi-trasparente */
    backdrop-filter: blur(4px); /* Effetto sfocatura sfondo */
    z-index: 99999; /* Sopra tutto */
    display: flex; /* Flexbox per centrare */
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.eprize-modal-glass {
    background: white;
    border-radius: 20px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
    animation: modalSlideUp 0.3s ease-out;
}

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

.eprize-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: #64748b;
    cursor: pointer;
    z-index: 10;
    padding: 5px;
    line-height: 1;
}
.eprize-modal-close:hover {
    color: #0f172a;
}

/* Header Modale */
.eprize-modal-header-glass {
    background: #fef2f2; /* Rosso chiaro */
    padding: 24px;
    text-align: center;
    border-bottom: 1px solid #fee2e2;
}

.eprize-modal-icon.danger {
    width: 60px;
    height: 60px;
    background: #fee2e2;
    color: #ef4444;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin: 0 auto 16px auto;
}

.eprize-modal-header-glass h3 {
    margin: 0;
    color: #991b1b;
    font-size: 1.5rem;
    font-weight: 800;
}

/* Body Modale */
.eprize-modal-body {
    padding: 24px;
}

.eprize-alert-text {
    text-align: center;
    color: var(--ep-text-muted);
    margin-bottom: 24px;
    line-height: 1.6;
}

.eprize-alert-text strong {
    color: #dc2626;
    display: block;
    margin-bottom: 5px;
}

/* Bottoni Azione Modale */
.eprize-modal-actions-grid {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.eprize-button-secondary {
    background: white;
    border: 1px solid var(--ep-border);
    color: var(--ep-text-main) !important;
    flex: 1;
}
.eprize-button-secondary:hover {
    background: var(--ep-bg-light);
}

.eprize-button-danger-full {
    background: #ef4444;
    color: white !important;
    border: none;
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}
.eprize-button-danger-full:hover {
    background: #dc2626;
}