/* static/css/styles.css */

/* --------------------------------------------------- */
/*  1. IMPOSTAZIONI GLOBALI E TIPOGRAFIA (CSS Variables & Base)
/* --------------------------------------------------- */

/* Importa un font moderno da Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    /* Colori Base / Brand */
    --brand-primary: #28a745;       /* Verde StreetSport */
    --brand-primary-dark: #218838;  /* Verde più scuro per hover */
    --brand-secondary: #007bff;     /* Blu per elementi primari non-brand */
    --brand-secondary-dark: #0056b3;/* Blu più scuro */
    --brand-dark: #212529;          /* Scuro per navbar/footer */
    --brand-light: #f8f9fa;         /* Sfondo chiaro */
    
    /* Colori Contesto Bootstrap (per coerenza) */
    --bs-success: #28a745;
    --bs-primary: #0d6efd;
    --bs-warning: #ffc107;
    --bs-info: #0dcaf0;
    --bs-danger: #dc3545;
    --bs-secondary: #6c757d;
    --bs-white-rgb: 255, 255, 255; /* RGB per opacità */

    /* Tipografia */
    --font-family-base: 'Poppins', sans-serif;
    --text-color-dark: #212529;
    --text-color-muted: #6c757d;

    /* Bordi e Ombre */
    --border-radius-base: 0.75rem; /* Per card e bottoni */
    --box-shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --box-shadow-md: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --box-shadow-lg: 0 0.8rem 2rem rgba(0, 0, 0, 0.1);
}

html, body {
    height: 100%;
}

body {
    font-family: var(--font-family-base);
    background-color: var(--brand-light);
    color: var(--text-color-dark);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
}

.main-wrapper {
    flex: 1; /* Permette al main-wrapper di occupare lo spazio disponibile per sticky footer */
    display: flex;
    flex-direction: column;
}

main {
    flex-grow: 1; /* Permette al main content di occupare lo spazio disponibile */
    padding-top: 80px; /* Spazio per la navbar fixed */
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--text-color-dark);
}

p {
    line-height: 1.6;
}

a {
    color: var(--brand-primary);
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}
a:hover {
    color: var(--brand-primary-dark);
    text-decoration: underline;
}

.text-muted {
    color: var(--text-color-muted) !important;
}

/* --- 2. NAVBAR E HEADER --- */

.bg-dark-custom {
    background-color: var(--brand-dark) !important;
    box-shadow: var(--box-shadow-md);
}

.navbar-logo {
    height: 35px; /* Dimensione del logo */
    width: auto;
}

.profile-image-navbar {
    width: 38px;
    height: 38px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid var(--brand-primary);
    box-shadow: var(--box-shadow-sm);
}

.navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.8) !important;
    font-weight: 500;
    margin: 0 0.4rem;
    padding: 0.6rem 0.8rem;
    border-radius: var(--border-radius-base); /* Bordi arrotondati */
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
}

.navbar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.15);
    color: white !important;
}

.navbar-nav .nav-link.active {
    background-color: rgba(255, 255, 255, 0.25);
    color: white !important;
}

.notifications-badge {
    font-size: 0.7em;
    padding: 0.3em 0.6em;
    top: -0.5em !important;
    right: -0.5em !important;
}

.navbar-nav .dropdown-menu {
    background-color: var(--brand-dark); /* Sfondo scuro */
    border: none;
    border-radius: var(--border-radius-base);
    box-shadow: var(--box-shadow-md);
}
.navbar-nav .dropdown-item {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}
.navbar-nav .dropdown-item:hover {
    background-color: var(--brand-primary);
    color: white;
}

/* Navbar Login/Register Buttons */
.navbar-nav .btn {
    margin: 0 0.5rem;
    padding: 0.5rem 1.2rem;
    border-radius: var(--border-radius-base);
    font-weight: 600;
}
.navbar-nav .btn-outline-success {
    color: var(--brand-primary);
    border-color: var(--brand-primary);
    background-color: transparent;
}
.navbar-nav .btn-outline-success:hover {
    background-color: var(--brand-primary);
    color: white;
}
.navbar-nav .btn-success {
    background-color: var(--brand-primary);
    border-color: var(--brand-primary);
    color: white;
}
.navbar-nav .btn-success:hover {
    background-color: var(--brand-primary-dark);
    border-color: var(--brand-primary-dark);
}

/* --- 3. HERO SECTION --- */
.hero-section {
    background: linear-gradient(rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0.65)), url('../img/hero-background.jpg') no-repeat center center/cover; /* Assicurati che l'immagine esista */
    min-height: 65vh; /* Altezza maggiore */
    padding-top: 100px; /* Per compensare la navbar fixed */
    padding-bottom: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.hero-section h1 {
    font-size: 4.5rem;
    color: white;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
}

.hero-section .lead {
    font-size: 1.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
    max-width: 800px;
    margin: 0 auto 2.5rem;
}

.btn-success-custom { /* Pulsante custom per CTA nell'Hero */
    background-color: var(--brand-primary);
    border-color: var(--brand-primary);
    color: white;
    font-weight: 600;
    padding: 0.9rem 2.5rem;
    border-radius: 50px; /* Pill-shaped button */
    transition: all 0.3s ease;
    box-shadow: var(--box-shadow-md);
}
.btn-success-custom:hover {
    background-color: var(--brand-primary-dark);
    border-color: var(--brand-primary-dark);
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.btn-outline-light {
    font-weight: 600;
    padding: 0.9rem 2.5rem;
    border-radius: 50px; /* Pill-shaped button */
    transition: all 0.3s ease;
    box-shadow: var(--box-shadow-md);
}
.btn-outline-light:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

/* --- 4. SEZIONI CONTENUTO (generali) --- */
.container.mt-5 {
    padding-top: 2rem;
    padding-bottom: 2rem;
}

.section-title {
    color: var(--text-color-dark);
    position: relative;
    padding-bottom: 0.75rem;
    margin-bottom: 3rem;
    font-size: 2.5rem;
}
.section-title::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    height: 4px;
    width: 80px;
    background-color: var(--brand-primary);
    border-radius: 2px;
}

.card {
    border-radius: var(--border-radius-base);
    border: 1px solid rgba(0, 0, 0, 0.08); /* Bordo sottile */
    box-shadow: var(--box-shadow-md);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-lg);
}

.card-header {
    font-weight: 600;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    border-top-left-radius: var(--border-radius-base) !important;
    border-top-right-radius: var(--border-radius-base) !important;
    padding: 1.25rem 1.5rem;
    background-color: var(--brand-dark); /* Default scuro, poi sovrascritto */
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-header h2, .card-header h3, .card-header h4, .card-header h5 {
    color: white;
    margin-bottom: 0;
}
.card-header .btn-sm {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
    color: white;
    font-weight: 500;
}
.card-header .btn-sm:hover {
    background-color: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Colori specifici per le card header (custom overrides) */
.card .bg-primary-custom { background-color: var(--brand-secondary) !important; }
.card .bg-success-custom { background-color: var(--brand-primary) !important; }
.card .bg-warning-custom { background-color: var(--bs-warning) !important; color: var(--text-color-dark) !important;} /* Warning ha testo scuro */
.card .bg-info-custom   { background-color: var(--bs-info) !important; }
.card .bg-secondary-custom { background-color: var(--bs-secondary) !important; }


/* Search input with pills */
.rounded-pill-custom {
    border-radius: 50px !important;
    background-color: white;
    padding: 0.5rem 1rem;
    box-shadow: var(--box-shadow-md);
}
.rounded-pill-left {
    border-top-left-radius: 50px !important;
    border-bottom-left-radius: 50px !important;
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    border-right: none;
    font-size: 1.1rem;
    padding: 0.75rem 1.25rem;
}
.rounded-pill-right {
    border-top-right-radius: 50px !important;
    border-bottom-right-radius: 50px !important;
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}
.btn-primary-custom {
    background-color: var(--brand-secondary);
    border-color: var(--brand-secondary);
    color: white;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
}
.btn-primary-custom:hover {
    background-color: var(--brand-secondary-dark);
    border-color: var(--brand-secondary-dark);
}
.activity-type-filter {
    margin-top: 1rem;
}
.activity-type-filter .btn {
    border-radius: 50px;
    margin: 0 0.25rem;
    padding: 0.3rem 0.8rem;
    font-size: 0.85rem;
    border-color: var(--bs-secondary);
    color: var(--bs-secondary);
}
.activity-type-filter .btn.active {
    background-color: var(--brand-primary);
    border-color: var(--brand-primary);
    color: white;
}
.activity-type-filter .btn:hover:not(.active) {
    background-color: rgba(0, 0, 0, 0.05);
}

/* --- 5. MAPPA E ELEMENTI CORRELATI --- */
.map-card-custom {
    box-shadow: var(--box-shadow-lg);
}

.map-container {
    height: 550px; /* Altezza maggiore per la mappa */
    width: 100%;
    border-bottom-left-radius: var(--border-radius-base);
    border-bottom-right-radius: var(--border-radius-base);
    overflow: hidden; 
}

.map-overlay-instructions {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(255, 255, 255, 0.95);
    padding: 1rem;
    border-bottom-left-radius: var(--border-radius-base);
    border-bottom-right-radius: var(--border-radius-base);
    font-size: 0.9em;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
    z-index: 500; 
}

/* Modale per i dettagli del percorso su mobile */
.route-details-modal .modal-content {
    border-radius: var(--border-radius-base);
    box-shadow: var(--box-shadow-lg);
}
.route-details-modal .modal-header {
    border-top-left-radius: var(--border-radius-base);
    border-top-right-radius: var(--border-radius-base);
}
.route-details-modal .btn-close-white {
    filter: invert(1) grayscale(100%) brightness(200%); /* Rende la X bianca */
}


.text-success-custom { color: var(--brand-primary) !important; }
.btn-outline-success-custom {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}
.btn-outline-success-custom:hover {
    background-color: var(--brand-primary);
    color: white;
}

/* Leaflet Overrides for better integration */
.leaflet-container {
    border-radius: var(--border-radius-base); 
}
.leaflet-control-layers { 
    background: white; 
    padding: 10px; 
    border-radius: var(--border-radius-base); 
    box-shadow: var(--box-shadow-md); 
    z-index: 1000; 
    font-family: var(--font-family-base);
}
.leaflet-control-layers-selector { vertical-align: middle; margin-right: 5px; }
.leaflet-control-layers label { 
    display: flex; 
    align-items: center; 
    margin-bottom: 5px; 
    font-size: 0.9em; 
    cursor: pointer; 
    color: var(--text-color-dark);
}
.leaflet-control-layers-separator { margin: 5px 0; border-top: 1px solid #eee; }

/* King/Queen Highlight */
.king-queen-highlight {
    background-color: var(--bs-warning); /* Colore giallo */
    color: var(--text-color-dark);
    border-radius: var(--border-radius-base);
    padding: 1rem;
    font-weight: bold;
    text-align: center;
    box-shadow: var(--box-shadow-sm);
    border: 1px solid var(--bs-warning);
}
.king-queen-highlight h5 { color: var(--text-color-dark); }
.king-queen-highlight .user-link { color: var(--text-color-dark) !important; font-weight: bolder; text-decoration: underline; }
.king-queen-highlight .trophy-icon { font-size: 1.5em; color: #daa520; }
.list-group-small .list-group-item {
    padding: .5rem 1rem;
    font-size: .875em;
    white-space: nowrap;     /* Impedisce line-break */
    overflow: hidden;        /* Nasconde testo in eccesso */
    text-overflow: ellipsis; /* Mostra "..." se troppo lungo */
}
.leaderboard-card {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;  /* Evita scroll orizzontale */
}
.list-group-small .profile-image-small { width: 28px; height: 28px; object-fit: cover; border-radius: 50%; margin-right: 0.5em; border: 1px solid var(--brand-primary);}
.leaderboard-entry-current-user { 
    background-color: #e6ffed; /* Light green for current user */
    border-color: var(--brand-primary); 
    font-weight: bold; 
}
.leaderboard-entry-current-user .text-muted {
    color: var(--brand-primary-dark) !important;
}
.leaderboard-entry-current-user .user-link {
    color: var(--brand-primary-dark) !important;
}


/* --- 6. LISTE DATI E CARD (Classifiche, Sfide, Attività, Percorsi) --- */
.leaderboard-card .list-group-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    font-size: 0.95rem;
    border-color: rgba(0, 0, 0, 0.08);
}
.leaderboard-card .list-group-item:first-child {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}
.leaderboard-card .list-group-item:last-child {
    border-bottom-left-radius: var(--border-radius-base);
    border-bottom-right-radius: var(--border-radius-base);
}
.leaderboard-card .profile-image-small {
    width: 32px;
    height: 32px;
    object-fit: cover;
    border-radius: 50%;
    margin-right: 0.75em;
    border: 1px solid var(--brand-primary);
}
.leaderboard-card .position {
    font-weight: bold;
    color: var(--brand-secondary);
    margin-right: 1em;
}
.leaderboard-card .username {
    flex-grow: 1;
    font-weight: 500;
}
.leaderboard-card .value {
    font-weight: bold;
    color: var(--brand-primary);
}

/* ======================================================= */
/* CLASSIC ROUTES CARDS - STILI COMPLETI                 */
/* ======================================================= */

/* Colonna: permette alla card di “uscire” dal contenitore */
.col-12.col-md-6.col-lg-4.mb-4 {
    overflow: visible;
}

/* Card principale */
.route-card {
    border-radius: 0.75rem;
    overflow: hidden;
    transition: transform 0.35s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.35s ease;
    border: 1px solid rgba(0,0,0,0.05);
    background-color: #fff;
}

/* Hover: muove e solleva la card */
.col-12.col-md-6.col-lg-4.mb-4:hover .route-card {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 16px 32px rgba(0,0,0,0.2);
}

/* Immagine di copertina */
.route-card .route-card-img {
    height: 180px;
    object-fit: cover;
    border-bottom: 3px solid var(--bs-danger);
    transition: transform 0.3s ease, filter 0.3s ease;
}

/* Hover immagine: leggero zoom + oscuramento */
.col-12.col-md-6.col-lg-4.mb-4:hover .route-card .route-card-img {
    transform: scale(1.03);
    filter: brightness(0.95);
}

/* Card header */
.route-card .card-header {
    background-color: var(--bs-primary);
    color: #fff;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.route-card .card-title {
    font-size: 1.15rem;
}

/* Badge tipologia e difficoltà */
.badge-container .badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.3rem 0.6rem;
    border-radius: 0.4rem;
    transition: transform 0.2s;
}

.badge-container .badge:hover {
    transform: scale(1.1);
    cursor: default;
}

/* Gradient badge per difficoltà */
.badge.bg-warning-route {
    background: linear-gradient(45deg, #ffc107, #ff8c00) !important;
    color: white;
}

.badge.bg-success-route {
    background: linear-gradient(45deg, #198754, #0a5c33) !important;
    color: white;
}

.badge.bg-danger-route {
    background: linear-gradient(45deg, #dc3545, #b2001b) !important;
    color: white;
}

/* Card Body */
.route-card .card-body {
    padding: 1rem;
}

.route-card .card-text {
    font-size: 0.9rem;
    line-height: 1.4;
    color: #555;
}

/* Route details */
.route-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.85rem;
}

.route-details small {
    line-height: 1.2;
    color: #666;
}

.route-details i {
    width: 1.2rem;
}

/* Top 5 Tempi */
.top-times-section {
    background: #f8f9fa;
    border-radius: 0.5rem;
    padding: 0.5rem;
    border: 1px solid rgba(0,0,0,0.08);
    margin-bottom: 0.25rem;
    transition: box-shadow 0.2s;
}

.top-times-section:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.top-times-section h6 {
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.top-times-list {
    max-height: 120px;
    overflow-y: auto;
    padding-right: 4px;
}

.top-times-list::-webkit-scrollbar {
    width: 4px;
}

.top-times-list::-webkit-scrollbar-thumb {
    background: var(--bs-secondary);
    border-radius: 2px;
}

.top-times-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.2rem 0.4rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    border-radius: 0.25rem;
    transition: background-color 0.2s;
}

.top-times-list li:hover {
    background-color: rgba(0,123,255,0.05);
}

.top-times-list li img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    margin-right: 6px;
}

/* Pulsanti azione */
.action-buttons .btn {
    font-size: 0.8rem;
    padding: 0.5rem 0.8rem;
    white-space: nowrap;
    transition: transform 0.2s, box-shadow 0.2s;
}

.action-buttons .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.12);
}

/* Card Footer */
.route-card .card-footer {
    background-color: #f8f9fa;
    border-top: 1px solid rgba(0,0,0,0.05);
    font-size: 0.85rem;
    color: #666;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Layout responsive per pulsanti */
@media (max-width: 576px) {
    .action-buttons {
        flex-direction: row !important;
        gap: 0.4rem;
    }
    .action-buttons .btn {
        flex: 1;
    }
}

/* Hover lista challenge/attività */
.list-group-item {
    border-color: rgba(0,0,0,0.08);
    transition: background-color 0.2s ease;
}

.list-group-item:hover {
    background-color: rgba(0,123,255,0.05);
}

/* ===== STILI PER LE SCOMMESSE (BETTING) ===== */
.bet-card {
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
    border-radius: var(--border-radius-base);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: var(--box-shadow-sm);
}

.bet-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-md);
}

.bet-won { border-left: 4px solid var(--bs-success); }
.bet-lost { border-left: 4px solid var(--bs-danger); }
.bet-pending { border-left: 4px solid var(--bs-warning); }

.bet-paid {
    opacity: 0.7;
    background-color: rgba(var(--bs-white-rgb), 1); 
}

.bet-badge {
    font-size: 1.1em;
    padding: 0.5rem 1rem;
    border-radius: 50px; 
    font-weight: 600;
    display: inline-flex;
    align-items: center;
}

.bet-beer { background: linear-gradient(45deg, #FFD700, #FFA500); color: var(--text-color-dark); border: 2px solid #FFA500; }
.bet-coffee { background: linear-gradient(45deg, #8B4513, #A0522D); color: white; border: 2px solid #A0522D; }
.bet-dinner { background: linear-gradient(45deg, var(--bs-danger), #E83E8C); color: white; border: 2px solid #E83E8C; }
.bet-custom { background: linear-gradient(45deg, var(--bs-info), #20c997); color: white; border: 2px solid #20c997; }

.bet-icon {
    font-size: 1.5em;
    margin-right: 8px;
}

.status-badge {
    font-size: 0.9em;
    padding: 0.4rem 0.8rem;
    border-radius: 50px;
    font-weight: 600;
}

/* --- 7. ANIMAZIONI --- */

/* Animazione di entrata per le card */
@keyframes slideInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Animazione pulse per elementi importanti */
@keyframes gentlePulse {
    0%, 100% { transform: scale(1); box-shadow: var(--box-shadow-sm); }
    50% { transform: scale(1.02); box-shadow: var(--box-shadow-md); }
}

/* Animazione per vittorie */
@keyframes victoryGlow {
    0% { box-shadow: 0 0 0 0 rgba(var(--bs-success-rgb), 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(var(--bs-success-rgb), 0); }
    100% { box-shadow: 0 0 0 0 rgba(var(--bs-success-rgb), 0); }
}

/* Animazione per sconfitte */
@keyframes defeatShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Animazione per nuovi elementi */
@keyframes newItemHighlight {
    0% { background-color: rgba(var(--bs-warning-rgb), 0.3); }
    50% { background-color: rgba(var(--bs-warning-rgb), 0.1); }
    100% { background-color: transparent; }
}

/* APPLICAZIONE DELLE ANIMAZIONI */
.card, .list-group-item { /* Applica animazione di entrata a card e list item */
    animation: slideInUp 0.6s ease-out;
    animation-fill-mode: both;
}

/* Ritardo progressivo per le card */
.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.1s; }
.card:nth-child(3) { animation-delay: 0.15s; }
.card:nth-child(4) { animation-delay: 0.2s; }
.card:nth-child(5) { animation-delay: 0.25s; }

/* Hover effects avanzati */
.bet-card:hover {
    animation: gentlePulse 2s infinite; 
    transform: translateY(-5px) scale(1.01);
}

.bet-won:hover { animation: gentlePulse 2s infinite, victoryGlow 2s infinite; }
.bet-lost:hover { animation: gentlePulse 2s infinite, defeatShake 0.6s ease; } 

/* Animazione per scommesse nuove (prime 24h) */
.bet-new { animation: newItemHighlight 3s ease-in-out forwards; } 
.bet-new::before { 
    content: 'NUOVO';
    position: absolute;
    top: 10px;
    right: -35px;
    background: linear-gradient(45deg, #ff6b6b, var(--bs-warning));
    color: white;
    padding: 5px 35px;
    font-size: 0.7em;
    font-weight: bold;
    transform: rotate(45deg);
    box-shadow: var(--box-shadow-md);
    z-index: 10;
}

/* Animazione per pagamento completato */
.bet-paid { position: relative; transition: all 0.5s ease; }
.bet-paid::after { 
    content: '✅ PAGATA';
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--bs-success);
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.7em;
    font-weight: bold;
    animation: gentlePulse 3s infinite;
    z-index: 5;
}

/* Animazione per badge scommesse */
.bet-badge {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.bet-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.5s;
}

.bet-badge:hover::before {
    left: 100%;
}

.bet-badge:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

/* Animazioni per i pulsanti di azione */
.btn-bet-action {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-bet-action::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.btn-bet-action:hover::before {
    width: 100%;
    height: 100%;
}

.btn-bet-action:active { transform: scale(0.95); }

/* Animazione per le statistiche */
.stats-card {
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.stats-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.6s;
}

.stats-card:hover::before {
    left: 100%;
}

.stats-card:hover {
    transform: translateY(-5px) scale(1.01);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

/* Animazione per notifiche */
.notification-item {
    transition: all 0.3s ease;
    position: relative;
}

.notification-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, rgba(var(--bs-info-rgb),0.1), transparent);
    transition: width 0.3s ease;
}

.notification-item:hover::before { width: 100%; }

/* ==========================
   SEZIONE NEWS / COMMUNITY
   ========================== */
.news-feed-card {
  border: none;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  margin-bottom: 2rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.news-feed-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.news-feed-card .card-header {
  background-color: #fff;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e9ecef;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.news-feed-card .card-header h4 {
  margin: 0;
  font-weight: 600;
  font-size: 1.15rem;
  color: #1a1a1a;
}

.news-feed-card .card-body {
  padding: 1.25rem;
  background: #fff;
}

.news-item {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #f2f2f2;
}

.news-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.news-item-avatar img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #0d6efd;
}

.news-item-content {
  flex: 1;
}

.news-item-content p {
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
  line-height: 1.6;
  color: #444;
}

.news-item-content strong {
  color: #212529;
  font-size: 1rem;
}

.news-item-content a.text-primary {
  font-weight: 500;
}

.news-item-content .text-muted.small {
  font-size: 0.8rem;
  color: #999 !important;
}

.news-item-content img.img-fluid {
  width: 100%;
  max-height: 350px;
  object-fit: cover;
  border-radius: 10px;
  margin-top: 10px;
  transition: transform 0.3s ease;
}

.news-item-content img.img-fluid:hover {
  transform: scale(1.03);
}

.news-action-icons {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
  font-size: 0.9rem;
  color: #6c757d;
}

.news-action-icons a {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
  transition: color 0.2s ease;
}

.news-action-icons a:hover {
  color: #0d6efd;
}

.news-action-icons i {
  margin-right: 5px;
  font-size: 1.1rem;
}

.news-feed-card .card-footer {
  background-color: #f8f9fa;
  border-top: 1px solid #e0e0e0;
  padding: 1rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.news-feed-card .card-footer .btn {
  border-radius: 25px;
  font-weight: 500;
  padding: 0.5rem 1.25rem;
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* ==========================
   RESPONSIVE DESIGN
   ========================== */
@media (max-width: 768px) {
  .news-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .news-item-avatar img {
    width: 40px;
    height: 40px;
    margin-bottom: 10px;
  }

  .news-feed-card .card-header h4 {
    font-size: 1rem;
  }

  .news-item-content img.img-fluid {
    max-height: 250px;
  }

  .news-action-icons {
    font-size: 0.85rem;
  }
}


/* Loading animation per azioni */
@keyframes loadingSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(var(--bs-white-rgb),0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: loadingSpin 1s linear infinite;
}

/* Animazione per transizioni di stato */
.status-transition { transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94); }
.status-transition.pending-to-paid { animation: victoryGlow 1s ease-out; }


/* --- 8. FOOTER --- */
.footer {
    background-color: var(--brand-dark) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: rgba(255, 255, 255, 0.6) !important;
    flex-shrink: 0; /* Per sticky footer */
}

.footer h6 {
    color: white;
    margin-bottom: 0.8rem;
}

.footer a {
    color: rgba(255, 255, 255, 0.6);
}
.footer a:hover {
    color: white;
}

.social-icons a {
    font-size: 1.2rem;
    margin-right: 0.75rem;
    transition: color 0.3s ease;
}
.social-icons a:hover {
    color: var(--brand-primary) !important;
}


/* --- 9. MEDIA QUERIES (Responsiveness) --- */
@media (max-width: 991.98px) { /* Schermi medi e piccoli */
    .navbar-brand {
        font-size: 1.2rem;
    }
    .navbar-nav .nav-item {
        margin: 0.25rem 0;
    }
    .navbar-nav .nav-link {
        padding: 0.5rem 1rem;
    }
    .hero-section {
        min-height: 50vh;
        padding-top: 60px;
    }
    .hero-section h1 {
        font-size: 2.8rem;
    }
    .hero-section .lead {
        font-size: 1.2rem;
    }
    .map-container {
        height: 400px;
    }
    .section-title {
        font-size: 2rem;
    }

    /* Mappa e overlay su mobile */
    .map-card-custom {
        margin-bottom: 2rem !important; /* Più spazio sotto la mappa su mobile */
    }
    .map-overlay-instructions {
        position: static; /* Non più in overlay */
        border-radius: var(--border-radius-base);
        margin: 0 1rem 1rem 1rem; /* Margini per separarlo dalla mappa */
        box-shadow: var(--box-shadow-sm);
    }
    .route-details-overlay { /* Questa classe non dovrebbe più essere usata per la modale */
        position: static; 
        max-width: 100%;
        margin: 15px auto;
        box-shadow: none;
    }
    .route-details-modal .modal-dialog.modal-lg {
        margin: 0.5rem; /* Margine minore per la modale */
    }


    .activity-type-filter .btn {
        margin-bottom: 0.5rem;
    }
    .section-title {
        font-size: 2rem;
        margin-bottom: 2rem;
    }
    .tab-content .tab-pane.fade.d-lg-block {
        display: none !important; /* Nasconde le tab content su mobile */
    }
    .tab-content .tab-pane.fade.show.active.d-lg-block {
        display: block !important; /* Mostra la tab attiva su mobile */
    }
    .nav-pills .nav-link {
        font-size: 0.9rem;
        padding: 0.8rem 0.5rem;
    }

}

/* Stile per il pulsante principale a forma di pillola */
    .create-post-pill-btn {
        border-radius: 50px; /* Arrotondamento massimo per la forma a pillola */
        border: 1px solid #ced4da;
        color: #6c757d;
        background-color: #fff;
        font-weight: 600;
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
        transition: background-color 0.2s;
    }
    .create-post-pill-btn:hover {
        background-color: #f1f1f1;
    }

    /* Stile per i pulsanti azione (Video, Foto, Articolo) */
    .create-post-action-btn {
        border: none;
        font-weight: 600;
        color: #555;
        background-color: transparent;
        border-radius: 6px;
        padding: 0.5rem 1rem;
        transition: background-color 0.2s ease-in-out;
    }
    .create-post-action-btn:hover {
        background-color: #e9ecef; /* Grigio chiaro al passaggio del mouse */
    }
    .create-post-action-btn i {
        font-size: 1.3rem; /* Icone leggermente più grandi */
        vertical-align: middle;
    }


     /*
     * STILE PER LE STATISTICHE INTEGRATE NELLA HERO SECTION
     */
    .hero-stats-container {
        /* Linea di separazione sottile e semi-trasparente */
        border-top: 1px solid rgba(255, 255, 255, 0.2);
    }

    .stat-card-hero {
        /* Nessuno sfondo o bordo, si integra direttamente */
        background: transparent;
        padding: 10px 0;
    }

    /* La classe .stat-number è la stessa per far funzionare il JS */
    .stat-number {
        font-size: 2.5rem;
        font-weight: 700;
        line-height: 1.1;
        /* Il colore è già 'text-white' ereditato dalla section */
    }

    .stat-label-hero {
        font-size: 0.8rem;
        font-weight: 400;
        text-transform: uppercase;
        letter-spacing: 1px;
        color: rgba(255, 255, 255, 0.8);
    }
/* 🎨 VARIABILI CSS PERSONALIZZATE */ :root { --gold-gradient: linear-gradient(135deg, #FFD700, #FF6B00, #FFD700); --silver-gradient: linear-gradient(135deg, #C0C0C0, #E8E8E8, #C0C0C0); --bronze-gradient: linear-gradient(135deg, #CD7F32, #FFA500, #CD7F32); --galaxy-gradient: linear-gradient(135deg, #667eea, #764ba2, #667eea); --neon-glow: 0 0 20px rgba(255, 255, 255, 0.5); } /* 🚀 ITEM PRINCIPALE */ .epic-leaderboard-item { position: relative; background: rgba(255, 255, 255, 0.1); backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 20px; margin: 15px 0; padding: 20px; overflow: hidden; transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); transform-style: preserve-3d; } .epic-leaderboard-item::before { content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent); transition: left 0.6s; } .epic-leaderboard-item:hover::before { left: 100%; } /* 👑 RANK BADGE ANIMATO */ .rank-badge { position: relative; width: 60px; height: 60px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 1.2rem; box-shadow: 0 0 30px rgba(255, 215, 0, 0.4); animation: float 3s ease-in-out infinite; } .rank-1 { background: var(--gold-gradient); } .rank-2 { background: var(--silver-gradient); } .rank-3 { background: var(--bronze-gradient); } .rank-other { background: var(--galaxy-gradient); } .rank-shine { position: absolute; top: -50%; left: -50%; width: 200%; height: 200%; background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.3) 50%, transparent 70%); animation: shine 3s infinite; } .rank-crown { position: absolute; top: -10px; font-size: 1.5rem; animation: bounce 2s infinite; } /* 🎭 AVATAR CON EFFETTI */ .avatar-container { position: relative; margin-right: 20px; } .animated-avatar { width: 60px; height: 60px; border-radius: 50%; border: 3px solid transparent; background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1) border-box; -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0); -webkit-mask-composite: xor; mask-composite: exclude; animation: avatarGlow 2s ease-in-out infinite alternate; } .avatar-glow { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 70px; height: 70px; border-radius: 50%; background: conic-gradient(from 0deg, #ff6b6b, #4ecdc4, #45b7d1, #ff6b6b); opacity: 0.3; filter: blur(10px); animation: rotate 4s linear infinite; } /* ✨ ANIMAZIONI */ @keyframes float { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-10px) rotate(5deg); } } @keyframes shine { 0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); } 100% { transform: translateX(100%) translateY(100%) rotate(45deg); } } @keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } } @keyframes avatarGlow { 0% { box-shadow: 0 0 20px rgba(255, 107, 107, 0.5); } 100% { box-shadow: 0 0 30px rgba(69, 183, 209, 0.8); } } @keyframes rotate { 0% { transform: translate(-50%, -50%) rotate(0deg); } 100% { transform: translate(-50%, -50%) rotate(360deg); } } /* 🌌 STATO VUOTO EPICO */ .epic-empty-state { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); border: none; border-radius: 25px; color: white; text-align: center; padding: 60px 40px; position: relative; overflow: hidden; } .floating-astronaut { font-size: 4rem; animation: float 3s ease-in-out infinite; margin-bottom: 20px; } .btn-galaxy { background: linear-gradient(135deg, #ff6b6b, #4ecdc4); border: none; border-radius: 50px; padding: 12px 30px; color: white; font-weight: bold; position: relative; overflow: hidden; transition: all 0.3s ease; } .btn-glow { position: absolute; top: 0; left: -100%; width: 100%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent); transition: left 0.5s; } .btn-galaxy:hover .btn-glow { left: 100%; } /* 💫 PARTICELLE */ .particle-field { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; } .particle { position: absolute; width: 4px; height: 4px; background: gold; border-radius: 50%; top: 50%; left: 50%; opacity: 1; } /* 📱 LAYOUT MODERNO */ .item-content { display: flex; align-items: center; justify-content: space-between; position: relative; z-index: 2; } .user-details { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; flex: 1; min-width: 0; /* Permette al testo di truncare */ } .username-link { color: #2c3e50; text-decoration: none; font-weight: 700; font-size: 1.1rem; margin-bottom: 4px; transition: all 0.3s ease; display: block; width: 100%; } .username-link:hover { color: #3498db; transform: translateX(3px); } .username-text { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; } .distance-value { font-size: 0.9rem; font-weight: 600; color: #27ae60; background: rgba(39, 174, 96, 0.1); padding: 4px 12px; border-radius: 20px; border: 1px solid rgba(39, 174, 96, 0.2); animation: pulseSubtle 2s infinite; } /* Versione mobile */ @media (max-width: 768px) { .username-text { max-width: 150px; font-size: 1rem; } .distance-value { font-size: 0.8rem; padding: 3px 10px; } } @media (max-width: 480px) { .username-text { max-width: 120px; } } @keyframes pulseSubtle { 0%, 100% { opacity: 1; } 50% { opacity: 0.8; } } .achievement-value { font-size: 1.2rem; font-weight: bold; position: relative; } .pulse-icon { animation: pulse 1.5s infinite; } @keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } } .avatar-container { position: relative; margin-right: 15px; /* Disabilita 3D su mobile per performance */ perspective: none; } .avatar-wrapper { position: relative; width: 60px; /* Ridotto per mobile */ height: 60px; border-radius: 50%; /* Transizione semplificata */ transition: transform 0.3s ease; will-change: transform; } /* DISABILITA ANIMAZIONI COMPLESSE SU MOBILE LENTI */ @media (max-width: 768px) and (prefers-reduced-motion: reduce) { .avatar-wrapper { transition: none; } } .avatar-wrapper:hover { transform: scale(1.05); /* Effetto semplificato */ } /* SFONDO GRADIENTE - RIDOTTO */ .avatar-background-glow { position: absolute; top: -3px; left: -3px; width: 66px; height: 66px; border-radius: 50%; background: conic-gradient( from 0deg at 50% 50%, #ff0080, #0070f3, #00f260, #ff0080 ); /* Animazione semplificata */ animation: rotateGradientMobile 6s linear infinite; filter: blur(5px); opacity: 0.6; z-index: 1; } /* BORDO OTTIMIZZATO */ .avatar-border-animation { position: absolute; top: -2px; left: -2px; width: 64px; height: 64px; border-radius: 50%; background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1); background-size: 200% 200%; /* Ridotto per performance */ animation: borderFlowMobile 4s ease infinite; z-index: 2; padding: 1px; mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); mask-composite: subtract; /* Disabilita su device lenti */ @media (prefers-reduced-motion: reduce) { animation: none; background: linear-gradient(45deg, #ff6b6b, #4ecdc4); } } .epic-avatar { position: relative; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; z-index: 3; border: 2px solid rgba(255, 255, 255, 0.1); background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); /* Filter pesante disabilitato su mobile */ filter: none; transition: border-color 0.3s ease; } /* GLOW SEMPLIFICATO */ .avatar-glow-effect { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 70px; height: 70px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%); opacity: 0; z-index: 2; animation: pulseGlowMobile 3s ease-in-out infinite alternate; } /* PARTICELLE CONDIZIONALI */ .floating-particles { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border-radius: 50%; z-index: 4; /* Disabilita particelle su mobile base */ @media (max-width: 768px) and (max-resolution: 1.5dppx) { display: none; } } .particle { position: absolute; width: 3px; height: 3px; background: gold; border-radius: 50%; opacity: 0; } /* BADGE OTTIMIZZATO */ .premium-rank-badge { position: absolute; bottom: -3px; right: -3px; width: 24px; /* Ridotto */ height: 24px; border-radius: 50%; z-index: 5; transform: scale(0); animation: badgeAppearMobile 0.4s ease-out 0.5s forwards; } .badge-inner { position: relative; width: 100%; height: 100%; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.7rem; /* Ridotto */ animation: badgeFloatMobile 3s ease-in-out infinite; } /* ANIMAZIONI OTTIMIZZATE PER MOBILE */ @keyframes rotateGradientMobile { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } @keyframes borderFlowMobile { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } } @keyframes pulseGlowMobile { 0% { transform: translate(-50%, -50%) scale(0.95); opacity: 0.2; } 100% { transform: translate(-50%, -50%) scale(1.05); opacity: 0.4; } } @keyframes badgeAppearMobile { 0% { transform: scale(0); } 80% { transform: scale(1.1); } 100% { transform: scale(1); } } @keyframes badgeFloatMobile { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px); } } /* OTTIMIZZAZIONI SPECIFICHE PER DISPOSITIVI */ @media (max-width: 480px) { .avatar-wrapper { width: 50px; height: 50px; } .avatar-background-glow { width: 56px; height: 56px; animation-duration: 8s; /* Più lento su device piccoli */ } .avatar-border-animation { width: 54px; height: 54px; } .premium-rank-badge { width: 20px; height: 20px; bottom: -2px; right: -2px; } .badge-inner { font-size: 0.6rem; } } /* OTTIMIZZAZIONI PER TABLET */ @media (min-width: 769px) and (max-width: 1024px) { .avatar-wrapper { width: 70px; height: 70px; } .avatar-background-glow { width: 76px; height: 76px; } .avatar-border-animation { width: 74px; height: 74px; } } /* DISABILITA COMPLETAMENTE ANIMAZIONI SE RICHIESTO */ @media (prefers-reduced-motion: reduce) { .avatar-background-glow, .avatar-border-animation, .avatar-glow-effect, .floating-particles, .premium-rank-badge { animation: none !important; } .avatar-wrapper { transition: none !important; } } /* OTTIMIZZAZIONE PER RETINE DISPLAY */ @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) { .avatar-wrapper { width: 65px; height: 65px; } .epic-avatar { border-width: 1.5px; /* Bordo più sottile */ } } /* OTTIMIZZAZIONE PERFORMANCE */ .avatar-container { /* Abilita accelerazione GPU */ transform: translateZ(0); backface-visibility: hidden; } /* CARICAMENTO PROGRESSIVO */ .epic-avatar { background-color: #f0f0f0; /* Colore di fallback */ background-image: linear-gradient(90deg, #f0f0f0 0px, #e0e0e0 40px, #f0f0f0 80px); background-size: 200% 100%; animation: loadingShine 1.5s infinite; } @keyframes loadingShine { 0% { background-position: -100px; } 100% { background-position: 100px; } } .epic-avatar[src] { background: none; animation: none; } .epic-leaderboard-item { position: relative; background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 20px; margin: 12px 0; padding: 18px; overflow: hidden; transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1); } .item-content { display: flex; align-items: flex-start; position: relative; z-index: 2; gap: 15px; } .user-info { display: flex; align-items: flex-start; flex: 1; gap: 15px; } .user-details { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; } .username-link { color: #2c3e50; text-decoration: none; font-weight: 700; font-size: 1.2rem; transition: all 0.3s ease; display: block; } .username-link:hover { color: #3498db; transform: translateX(5px); } .username-text { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .achievement-value { display: inline-flex; align-items: center; gap: 8px; font-size: 1rem; font-weight: 600; color: #27ae60; background: rgba(39, 174, 96, 0.1); padding: 6px 12px; border-radius: 20px; border: 2px solid rgba(39, 174, 96, 0.2); animation: pulseSubtle 2s infinite; width: fit-content; } .value-display { display: flex; align-items: center; gap: 6px; } .pulse-icon { font-size: 0.9rem; animation: pulse 1.5s infinite; } .progress-sparkle { display: none; /* Nascondi per versione compatta */ } @keyframes pulseSubtle { 0%, 100% { transform: scale(1); box-shadow: 0 0 0 rgba(39, 174, 96, 0.4); } 50% { transform: scale(1.02); box-shadow: 0 0 15px rgba(39, 174, 96, 0.6); } } /* Responsive */ @media (max-width: 768px) { .item-content { gap: 12px; } .user-info { gap: 12px; } .user-details { gap: 6px; } .username-link { font-size: 1.1rem; } .achievement-value { font-size: 0.9rem; padding: 5px 10px; } .value-display { gap: 4px; } } @media (max-width: 480px) { .username-text { max-width: 150px; } .achievement-value { font-size: 0.85rem; padding: 4px 8px; } .pulse-icon { font-size: 0.8rem; } } /* Ottimizzazioni mobile */ @media (max-width: 768px) { .avatar-background-glow, .avatar-border-animation, .avatar-glow-effect, .floating-particles, .rank-shine { display: none; } .epic-leaderboard-item { padding: 15px; backdrop-filter: none; background: white; } }
/* 👑 CONTENITORE REALE */
.king-queen-highlight {
    position: relative;
    border-radius: 25px;
    overflow: hidden;
    margin: 20px 0;
    box-shadow: 0 15px 50px rgba(255, 215, 0, 0.3);
}

.royal-container {
    position: relative;
    background: linear-gradient(135deg, 
        rgba(255, 215, 0, 0.15) 0%,
        rgba(255, 165, 0, 0.2) 50%,
        rgba(255, 215, 0, 0.15) 100%);
    backdrop-filter: blur(15px);
    border: 2px solid transparent;
    padding: 30px 25px;
    border-radius: 25px;
}

/* 🌟 SFONDO ANIMATO */
.royal-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(255, 215, 0, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 165, 0, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    animation: royalBackgroundShift 8s ease-in-out infinite;
    z-index: 1;
}

.royal-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
}

.royal-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: gold;
    border-radius: 50%;
    animation: royalParticleFloat 6s infinite;
}

/* 👑 CORONA FLUTTUANTE */
.floating-crown {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 4rem;
    filter: drop-shadow(0 0 20px gold);
    animation: crownBounce 3s ease-in-out infinite;
    z-index: 10;
}

/* 🎭 CONTENUTO PRINCIPALE */
.royal-content {
    position: relative;
    z-index: 3;
}

.royal-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
}

.royal-crown-icon {
    font-size: 2rem;
    color: gold;
    animation: iconPulse 2s ease-in-out infinite;
}

.royal-title {
    color: #8B4513;
    font-weight: 800;
    font-size: 1.8rem;
    text-align: center;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    background: linear-gradient(45deg, #8B4513, #D2691E, #8B4513);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 200% 200%;
    animation: royalTitleShine 3s ease-in-out infinite;
}

/* 👤 INFO UTENTE REALE */
.royal-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.royal-avatar-container {
    position: relative;
    flex-shrink: 0;
}

.royal-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid gold;
    object-fit: cover;
    position: relative;
    z-index: 2;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
}

.royal-avatar-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: radial-gradient(circle, gold 0%, transparent 70%);
    opacity: 0.4;
    animation: avatarGlowPulse 2s ease-in-out infinite;
    z-index: 1;
}

.royal-avatar-sparkles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.sparkle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
    animation: sparkleTwinkle 2s infinite;
}

.s1 { top: 10%; left: 20%; animation-delay: 0s; }
.s2 { top: 70%; left: 80%; animation-delay: 0.7s; }
.s3 { top: 40%; left: 10%; animation-delay: 1.4s; }

/* 📝 DETTAGLI TESTUALI */
.royal-details {
    flex: 1;
}

.royal-holder, .royal-duration {
    margin-bottom: 12px;
    font-size: 1.1rem;
}

.royal-label {
    color: #8B4513;
    font-weight: 600;
}

.royal-username {
    color: #D2691E;
    font-size: 1.3rem;
    background: linear-gradient(45deg, #D2691E, #FF8C00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.royal-duration-value {
    color: #B8860B;
    font-size: 1.2rem;
}

.royal-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 15px;
}

.btn-royal-action {
    background: linear-gradient(45deg, #FFD700, #FFA500);
    color: #8B4513 !important;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 15px rgba(255, 165, 0, 0.3);
}

.btn-royal-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 165, 0, 0.5);
    color: #8B4513;
}

.royal-date {
    color: #A0522D;
    font-style: italic;
}

/* 🎞️ ANIMAZIONI */
@keyframes royalBackgroundShift {
    0%, 100% { 
        background-position: 0% 0%, 100% 100%, 50% 50%;
    }
    50% { 
        background-position: 100% 100%, 0% 0%, 80% 80%;
    }
}

@keyframes crownBounce {
    0%, 100% { 
        transform: translateX(-50%) translateY(0px) rotate(-5deg);
        filter: drop-shadow(0 0 20px gold) brightness(1);
    }
    50% { 
        transform: translateX(-50%) translateY(-10px) rotate(5deg);
        filter: drop-shadow(0 0 30px #FFD700) brightness(1.3);
    }
}

@keyframes iconPulse {
    0%, 100% { 
        transform: scale(1) rotate(0deg);
        color: gold;
    }
    50% { 
        transform: scale(1.1) rotate(10deg);
        color: #FFA500;
    }
}

@keyframes royalTitleShine {
    0%, 100% { 
        background-position: 0% 50%;
    }
    50% { 
        background-position: 100% 50%;
    }
}

@keyframes avatarGlowPulse {
    0%, 100% { 
        opacity: 0.3;
        transform: translate(-50%, -50%) scale(1);
    }
    50% { 
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

@keyframes sparkleTwinkle {
    0%, 100% { 
        opacity: 0;
        transform: scale(0);
    }
    50% { 
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes royalParticleFloat {
    0% { 
        transform: translate(0, 0);
        opacity: 0;
    }
    10% { 
        opacity: 1;
    }
    90% { 
        opacity: 1;
    }
    100% { 
        transform: translate(100px, -100px);
        opacity: 0;
    }
}

/* 🎯 EFFETTI BORDO */
.royal-border {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 25px;
    background: linear-gradient(45deg, gold, #FFA500, gold, #FFA500);
    background-size: 400% 400%;
    animation: borderFlow 4s linear infinite;
    z-index: -1;
    padding: 3px;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: subtract;
}

.royal-shine {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.4) 50%, transparent 70%);
    animation: royalShine 6s infinite;
    z-index: 2;
}

@keyframes borderFlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes royalShine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

/* 📱 RESPONSIVE */
@media (max-width: 768px) {
    .royal-info {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .royal-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .royal-title {
        font-size: 1.5rem;
    }
    
    .royal-avatar {
        width: 70px;
        height: 70px;
    }
    
    .floating-crown {
        font-size: 3rem;
        top: -20px;
    }
    
    .royal-actions {
        flex-direction: column;
        gap: 10px;
    }
}

/* ⚡ OTTIMIZZAZIONI PERFORMANCE */
@media (prefers-reduced-motion: reduce) {
    .royal-background,
    .floating-crown,
    .royal-crown-icon,
    .royal-avatar-glow,
    .sparkle,
    .royal-border,
    .royal-shine {
        animation: none !important;
    }
}