/* ============================================
   DASHBOARD STATISTICHE - MODERN DESIGN
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ============================================
   VARIABILI CSS - REGOLA QUI LE DIMENSIONI BASE
   ============================================ */
:root {
    /* Colori principali */
    --primary: #ff6b35;
    --secondary: #004e89;
    --success: #06d6a0;
    --warning: #ffd23f;
    --danger: #ef233c;

    /* Sfondi */
    --bg-dark: #0a0e27;
    --bg-header: #333333;
    --bg-card: rgba(255, 255, 255, 0.08);
    --bg-card-hover: rgba(255, 255, 255, 0.12);

    /* Testi */
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.5);

    /* Dimensioni - REGOLA QUI per cambiare dimensioni globali */
    --border-radius: 8px;
    --border-radius-sm: 4px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.2);

    /* Spacing - REGOLA QUI gli spazi tra elementi */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 12px;
    --spacing-lg: 16px;
    --spacing-xl: 24px;
}

/* ============================================
   BODY - DIMENSIONI BASE DESKTOP
   REGOLA font-size per cambiare dimensione generale
   ============================================ */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #0a0e27 0%, #1a1f3a 100%);
    min-height: 100vh;
    color: var(--text-primary);
    padding: var(--spacing-sm);
    overflow-x: hidden;
    font-size: 12px; /* REGOLA QUI: dimensione font base desktop */
    line-height: 1.4;
}

/* ============================================
   HEADER
   ============================================ */

.dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
}

.dashboard-header {
    background: #333333;
    border: 2px solid var(--primary);
    border-radius: var(--border-radius);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
    text-align: center;
    animation: fadeInDown 0.6s ease-out;
    box-shadow: 0 0 20px rgba(255, 107, 53, 0.3);
    max-width: 1150px;
    margin-left: auto;
    margin-right: auto;
}

/* REGOLA QUI: dimensioni titolo header */
.dashboard-header h1 {
    font-size: clamp(1.2rem, 4vw, 1.6rem); /* min, responsive, max */
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary) 0%, var(--warning) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 6px;
    line-height: 1.2;
}

/* REGOLA QUI: dimensione sottotitolo header */
.dashboard-header .subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* ============================================
   HERO CARDS GRID - ANALISI IA (3x3)
   REGOLA QUI le dimensioni delle card hero
   ============================================ */

.hero-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* ← CAMBIATO DA 2 A 3 */
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
    max-width: 1150px;
    margin-left: auto;
    margin-right: auto;
}

.hero-card-link {
    display: block;
    text-decoration: none;
}

.hero-card-ai {
    background: linear-gradient(135deg, rgba(255, 166, 0, 0.15) 0%, rgba(255, 204, 0, 0.1) 100%);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 2px solid rgba(255, 166, 0, 0.4);
    border-radius: 16px;
    padding: 24px; /* REGOLA QUI: padding interno card hero */
    display: flex;
    align-items: center;
    gap: 20px;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow:
        0 10px 40px rgba(255, 166, 0, 0.2),
        0 0 60px rgba(255, 166, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: heroSlideIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Gradient animato background */
.hero-card-ai::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        circle at center,
        rgba(255, 166, 0, 0.2) 0%,
        rgba(255, 204, 0, 0.1) 40%,
        transparent 70%
    );
    animation: heroRotate 20s linear infinite;
    pointer-events: none;
}

@keyframes heroRotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes heroSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.hero-card-ai:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 166, 0, 0.6);
    box-shadow:
        0 15px 60px rgba(255, 166, 0, 0.4),
        0 0 80px rgba(255, 166, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.hero-card-ai:active {
    transform: translateY(-2px) scale(0.98);
}

/* Variante Advanced (seconda card) */
.hero-card-advanced {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.15) 0%, rgba(239, 35, 60, 0.1) 100%);
    border-color: rgba(255, 107, 53, 0.4);
    box-shadow:
        0 10px 40px rgba(255, 107, 53, 0.2),
        0 0 60px rgba(255, 107, 53, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.hero-card-advanced::before {
    background: radial-gradient(
        circle at center,
        rgba(255, 107, 53, 0.2) 0%,
        rgba(239, 35, 60, 0.1) 40%,
        transparent 70%
    );
}

.hero-card-advanced:hover {
    border-color: rgba(255, 107, 53, 0.6);
    box-shadow:
        0 15px 60px rgba(255, 107, 53, 0.4),
        0 0 80px rgba(255, 107, 53, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.hero-card-advanced .hero-title {
    background: linear-gradient(135deg, #ff6b35 0%, #ef233c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-card-advanced .hero-badge {
    background: rgba(255, 107, 53, 0.2);
    border-color: rgba(255, 107, 53, 0.4);
    color: #ff6b35;
}

.hero-card-advanced .hero-arrow {
    color: #ff6b35;
}

/* Variante Training (terza card) */
.hero-card-training {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(6, 214, 160, 0.1) 100%);
    border-color: rgba(16, 185, 129, 0.4);
    box-shadow:
        0 10px 40px rgba(16, 185, 129, 0.2),
        0 0 60px rgba(16, 185, 129, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.hero-card-training::before {
    background: radial-gradient(
        circle at center,
        rgba(16, 185, 129, 0.2) 0%,
        rgba(6, 214, 160, 0.1) 40%,
        transparent 70%
    );
}

.hero-card-training:hover {
    border-color: rgba(16, 185, 129, 0.6);
    box-shadow:
        0 15px 60px rgba(16, 185, 129, 0.4),
        0 0 80px rgba(16, 185, 129, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.hero-card-training .hero-title {
    background: linear-gradient(135deg, #10b981 0%, #06d6a0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-card-training .hero-badge {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.4);
    color: #10b981;
}

.hero-card-training .hero-arrow {
    color: #10b981;
}

/* REGOLA QUI: dimensione icona hero */
.hero-icon {
    font-size: 3.5rem;
    flex-shrink: 0;
    filter: drop-shadow(0 4px 12px rgba(255, 166, 0, 0.4));
    animation: iconPulse 2s ease-in-out infinite;
    position: relative;
    z-index: 1;
}

@keyframes iconPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.hero-content {
    flex: 1;
    position: relative;
    z-index: 1;
}

/* REGOLA QUI: dimensione titolo hero */
.hero-title {
    font-size: 1.4rem;
    font-weight: 800;
    background: linear-gradient(135deg, #ffa600 0%, #ffcc00 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
    line-height: 1.2;
}

/* REGOLA QUI: dimensione descrizione hero */
.hero-description {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.5;
    margin-bottom: 10px;
}

/* REGOLA QUI: dimensione badge hero */
.hero-badge {
    display: inline-block;
    background: rgba(255, 166, 0, 0.2);
    border: 1px solid rgba(255, 166, 0, 0.4);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #ffcc00;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* REGOLA QUI: dimensione freccia hero */
.hero-arrow {
    font-size: 2rem;
    color: #ffa600;
    flex-shrink: 0;
    transition: transform 0.3s ease;
    position: relative;
    z-index: 1;
}

.hero-card-ai:hover .hero-arrow {
    transform: translateX(10px);
}

/* ============================================
   STATS GRID - GRIGLIA PRINCIPALE
   ============================================ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 colonne */
    gap: var(--spacing-md);
    max-width: 1150px;
    margin: 0 auto;
    animation: fadeIn 0.8s ease-out 0.2s both;
}

/* Layout Desktop/Tablet - 3 righe x 3 colonne - ORDINE ORIZZONTALE */

/* RIGA 1: Totale Sessioni | Media Annuale | Focus Temporale */
.stat-card:nth-child(1) { grid-column: 1; grid-row: 1; }
.stat-card:nth-child(2) { grid-column: 2; grid-row: 1; }
.stat-card:nth-child(3) { grid-column: 3; grid-row: 1; }

/* RIGA 2: Campo | Tipo Sessione | Munizione */
.stat-card:nth-child(4) { grid-column: 1; grid-row: 2; }
.stat-card:nth-child(5) { grid-column: 2; grid-row: 2; }
.stat-card:nth-child(6) { grid-column: 3; grid-row: 2; }

/* RIGA 3: Direzione | Canna | Leaderboards */
.stat-card:nth-child(7) { grid-column: 1; grid-row: 3; }
.stat-card:nth-child(8) { grid-column: 2; grid-row: 3; }
.stat-card:nth-child(9) { grid-column: 3; grid-row: 3; }

/* ============================================
   STAT CARD - CARD STATISTICHE GLASSMORPHISM
   REGOLA QUI le dimensioni delle card statistiche
   ============================================ */

.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    padding: var(--spacing-md); /* REGOLA QUI: padding interno card (12px desktop) */
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    min-height: 110px; /* REGOLA QUI: altezza minima card desktop */
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--warning));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: rgba(255, 255, 255, 0.2);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card:active {
    transform: translateY(0);
}

/* Card Header */
.card-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

/* REGOLA QUI: dimensione icona card */
.card-icon {
    font-size: 1.3rem;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
    flex-shrink: 0;
}

/* REGOLA QUI: dimensione titolo card */
.card-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1.2;
}

/* Card Content */
.card-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* REGOLA QUI: dimensione valore principale */
.stat-value {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    font-weight: 700;
    line-height: 1.1;
    background: linear-gradient(135deg, #ffffff 0%, rgba(255, 255, 255, 0.8) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Layout inline per percentuale + piattelli */
.stat-value-inline {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

/* REGOLA QUI: dimensione valore principale inline */
.stat-value-main {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    font-weight: 700;
    line-height: 1.1;
    background: linear-gradient(135deg, #ffffff 0%, rgba(255, 255, 255, 0.8) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* REGOLA QUI: dimensione valore secondario */
.stat-value-sub {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    opacity: 0.8;
}

/* REGOLA QUI: dimensione etichetta */
.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 400;
    line-height: 1.2;
}

/* REGOLA QUI: dimensione dettagli aggiuntivi */
.stat-detail {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-top: 5px;
    padding-top: 5px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    line-height: 1.3;
}

/* REGOLA QUI: dimensione badge */
.stat-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.1);
    padding: 3px 8px;
    border-radius: var(--border-radius-sm);
    font-size: 0.65rem;
    font-weight: 600;
    margin-top: 4px;
    color: var(--success);
}

/* ============================================
   TIPI SESSIONE - LISTA CON BARRE
   REGOLA QUI le dimensioni delle liste tipi
   ============================================ */

.tipi-list {
    display: flex;
    flex-direction: column;
    gap: 8px; /* REGOLA QUI: spazio tra righe */
    margin-top: 6px;
}

.tipo-item {
    background: rgba(255, 255, 255, 0.03);
    padding: 6px 8px; /* REGOLA QUI: padding interno item */
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
}

.tipo-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.tipo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

/* REGOLA QUI: dimensione nome tipo */
.tipo-nome {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* REGOLA QUI: dimensione precisione tipo */
.tipo-precisione {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
}

/* REGOLA QUI: altezza barra tipo */
.tipo-bar-container {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 3px;
}

.tipo-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--warning) 100%);
    border-radius: 3px;
    transition: width 0.6s ease-out;
}

/* REGOLA QUI: dimensione testo sessioni tipo */
.tipo-sessioni {
    font-size: 0.6rem;
    color: var(--text-muted);
    text-align: right;
}

/* ============================================
   TOP 3 - CAMPI E MUNIZIONI CON BARRE
   REGOLA QUI le dimensioni delle liste top
   ============================================ */

.top-list {
    display: flex;
    flex-direction: column;
    gap: 8px; /* REGOLA QUI: spazio tra righe */
    margin-top: 6px;
}

.top-item {
    background: rgba(255, 255, 255, 0.03);
    padding: 6px 8px; /* REGOLA QUI: padding interno item */
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
}

.top-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

/* REGOLA QUI: dimensione nome top */
.top-nome {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-weight: 500;
    max-width: 60%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* REGOLA QUI: dimensione precisione top */
.top-precisione {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
}

/* REGOLA QUI: altezza barra top */
.top-bar-container {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 3px;
}

.top-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success) 0%, var(--primary) 100%);
    border-radius: 3px;
    transition: width 0.6s ease-out;
}

/* REGOLA QUI: dimensione testo sessioni top */
.top-sessioni {
    font-size: 0.6rem;
    color: var(--text-muted);
    text-align: right;
}

/* ============================================
   DIREZIONI (Sx, C, Dx) - COME CANNE
   REGOLA QUI le dimensioni delle direzioni
   ============================================ */

.direzioni-stats {
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    gap: 8px;
    margin-top: 8px;
}

.direzione-item {
    flex: 1;
    text-align: center;
    padding: 6px; /* REGOLA QUI: padding direzione */
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--border-radius-sm);
    min-width: 50px;
    transition: var(--transition);
}

.direzione-item:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-1px);
}

/* REGOLA QUI: dimensione percentuale direzione */
.direzione-percent {
    font-size: 1rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary) 0%, var(--warning) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 3px;
}

/* REGOLA QUI: dimensione label direzione */
.direzione-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

/* REGOLA QUI: dimensione lanci direzione */
.direzione-lanci {
    font-size: 0.55rem;
    color: var(--text-muted);
}

/* ============================================
   TREND CARD (ULTIMI 3 MESI)
   REGOLA QUI le dimensioni dei trend
   ============================================ */

.trend-bars {
    display: flex;
    gap: 4px;
    margin-top: 6px;
    align-items: flex-end;
    height: 40px; /* REGOLA QUI: altezza totale trend */
}

.trend-bar {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

/* REGOLA QUI: altezza container barra trend */
.bar-container {
    width: 100%;
    height: 28px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    position: relative;
}

.bar-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, var(--primary) 0%, var(--warning) 100%);
    border-radius: var(--border-radius-sm) var(--border-radius-sm) 0 0;
    transition: height 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* REGOLA QUI: dimensione label barra trend */
.bar-label {
    font-size: 0.55rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* REGOLA QUI: dimensione valore barra trend */
.bar-value {
    font-size: 0.6rem;
    color: var(--text-primary);
    font-weight: 600;
}

/* ============================================
   PERFORMANCE CANNE (DONUT/PIE)
   REGOLA QUI le dimensioni delle canne
   ============================================ */

.canne-stats {
    display: flex;
    gap: 4px;
    margin-top: 6px;
    flex-wrap: wrap;
}

.canna-item {
    flex: 1;
    min-width: 40px; /* REGOLA QUI: larghezza minima canna */
    text-align: center;
    padding: 4px; /* REGOLA QUI: padding canna */
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
}

.canna-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.02);
}

/* REGOLA QUI: dimensione percentuale canna */
.canna-percent {
    font-size: 0.9rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--success) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
}

/* REGOLA QUI: dimensione label canna */
.canna-label {
    font-size: 0.55rem;
    color: var(--text-muted);
    margin-top: 2px;
    line-height: 1.1;
}

/* ============================================
   LOADING SKELETON
   ============================================ */

.loading-skeleton {
    display: contents;
}

.skeleton-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    height: 80px;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 0.3;
    }
}

/* ============================================
   EMPTY STATE
   ============================================ */

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: var(--spacing-lg);
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 2rem;
    margin-bottom: var(--spacing-sm);
    opacity: 0.5;
}

.empty-state-text {
    font-size: 0.8rem;
    margin-bottom: 4px;
    font-weight: 500;
}

.empty-state-hint {
    font-size: 0.65rem;
    color: var(--text-muted);
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stagger animation per cards */
.stat-card {
    animation: fadeInUp 0.6s ease-out backwards;
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.15s; }
.stat-card:nth-child(3) { animation-delay: 0.2s; }
.stat-card:nth-child(4) { animation-delay: 0.25s; }
.stat-card:nth-child(5) { animation-delay: 0.3s; }
.stat-card:nth-child(6) { animation-delay: 0.35s; }
.stat-card:nth-child(7) { animation-delay: 0.4s; }
.stat-card:nth-child(8) { animation-delay: 0.45s; }
.stat-card:nth-child(9) { animation-delay: 0.5s; }

/* ============================================
   ACCESSIBILITY & MOBILE TOUCH
   ============================================ */

/* Ottimizzazione touch area (minimo 44x44px per iOS) */
.stat-card {
    -webkit-tap-highlight-color: rgba(255, 107, 53, 0.2);
    touch-action: manipulation;
    min-height: 44px;
}

/* Previeni selezione testo durante drag */
.stat-card,
.card-icon,
.stat-value {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Smooth scroll per iOS */
body {
    -webkit-overflow-scrolling: touch;
}

/* Focus visibile solo keyboard, non touch */
.stat-card:focus {
    outline: 2px solid var(--primary);
    outline-offset: 4px;
}

.stat-card:focus:not(:focus-visible) {
    outline: none;
}

/* Touch feedback più evidente su mobile */
@media (hover: none) and (pointer: coarse) {
    .stat-card:active {
        background: rgba(255, 107, 53, 0.15);
        transform: scale(0.98);
    }

    .hero-card-ai {
        min-height: 100px;
    }

    .hero-card-ai:active {
        background: linear-gradient(135deg, rgba(255, 166, 0, 0.25) 0%, rgba(255, 204, 0, 0.15) 100%);
        transform: scale(0.98);
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   FLOATING AI BUTTON
   ============================================ */

.floating-ai-button {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #ffa600, #ffcc00);
    border-radius: 50%;
    box-shadow: 0 8px 24px rgba(255, 166, 0, 0.4), 0 0 0 0 rgba(255, 166, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
    z-index: 1000;
    animation: pulse-ai 2s infinite;
}

.floating-ai-button:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 12px 32px rgba(255, 166, 0, 0.6);
}

.floating-ai-button:active {
    transform: translateY(-2px) scale(1.02);
}

.floating-ai-button .ai-icon {
    font-size: 2rem;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.floating-ai-button .ai-label {
    font-size: 0.45rem;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.floating-ai-button .ai-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.5);
}

.floating-ai-button .ai-badge.hidden {
    display: none;
}

@keyframes pulse-ai {
    0%, 100% {
        box-shadow: 0 8px 24px rgba(255, 166, 0, 0.4), 0 0 0 0 rgba(255, 166, 0, 0.7);
    }
    50% {
        box-shadow: 0 8px 24px rgba(255, 166, 0, 0.4), 0 0 0 15px rgba(255, 166, 0, 0);
    }
}

/* ============================================
   📱 MOBILE RESPONSIVE - DIMENSIONI AUMENTATE +25%
   REGOLA QUI TUTTE LE DIMENSIONI MOBILE
   ============================================ */

@media (max-width: 768px) {
    /* BODY MOBILE - font base aumentato del 25% */
    body {
        padding: 6px;
        font-size: 13.75px; /* Era 11px, ora +25% = REGOLA QUI */
    }

    /* HEADER MOBILE */
    .dashboard-header {
        padding: var(--spacing-sm);
    }

    .dashboard-header h1 {
        font-size: 1rem;
    }

    .dashboard-header .subtitle {
        font-size: 0.65rem;
    }

    /* HERO GRID MOBILE - 1 colonna */
    .hero-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
        margin-bottom: var(--spacing-md);
    }

    /* HERO CARD MOBILE - dimensioni aumentate +25% */
    .hero-card-ai {
        padding: 22.5px; /* Era 18px, ora +25% = REGOLA QUI */
        gap: 15px; /* Era 12px, ora +25% = REGOLA QUI */
        flex-direction: row;
        align-items: center;
    }

    /* REGOLA QUI: icona hero mobile */
    .hero-icon {
        font-size: 3.125rem; /* Era 2.5rem, ora +25% */
    }

    /* REGOLA QUI: titolo hero mobile */
    .hero-title {
        font-size: 1.375rem; /* Era 1.1rem, ora +25% */
    }

    /* REGOLA QUI: descrizione hero mobile */
    .hero-description {
        font-size: 1.0625rem; /* Era 0.85rem, ora +25% */
        line-height: 1.4;
        margin-bottom: 10px; /* Era 8px, ora +25% */
    }

    /* REGOLA QUI: badge hero mobile */
    .hero-badge {
        font-size: 0.8125rem; /* Era 0.65rem, ora +25% */
        padding: 6.25px 12.5px; /* Era 5px 10px, ora +25% */
    }

    /* REGOLA QUI: freccia hero mobile */
    .hero-arrow {
        font-size: 1.875rem; /* Era 1.5rem, ora +25% */
    }

    /* STATS GRID MOBILE - 1 colonna */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-xs);
        max-width: 100%;
    }

    /* Reset ordine su mobile */
    .stat-card {
        grid-column: auto !important;
        grid-row: auto !important;
    }

    /* STAT CARD MOBILE - dimensioni aumentate +25% */
    /* REGOLA QUI: padding e altezza card mobile */
    .stat-card {
        padding: 10px; /* Era 8px (var(--spacing-sm)), ora +25% */
        min-height: 106px; /* Era 85px, ora +25% */
    }

    /* Header rimane a sinistra, valori centrati */
    .card-header {
        justify-content: flex-start;
    }

    .card-content {
        align-items: center;
        text-align: center;
    }

    .stat-value,
    .stat-label,
    .stat-detail,
    .stat-badge {
        text-align: center;
    }

    /* REGOLA QUI: icona card mobile */
    .card-icon {
        font-size: 1.25rem; /* Era 1rem, ora +25% */
    }

    /* REGOLA QUI: titolo card mobile */
    .card-title {
        font-size: 0.8125rem; /* Era 0.65rem, ora +25% */
    }

    /* REGOLA QUI: valore principale mobile */
    .stat-value {
        font-size: 1.375rem; /* Era 1.1rem, ora +25% */
    }

    /* REGOLA QUI: valore main inline mobile */
    .stat-value-main {
        font-size: 1.375rem; /* Era 1.1rem, ora +25% */
    }

    /* REGOLA QUI: valore secondario mobile */
    .stat-value-sub {
        font-size: 0.8125rem; /* Era 0.65rem, ora +25% */
    }

    /* REGOLA QUI: label mobile */
    .stat-label {
        font-size: 0.8125rem; /* Era 0.65rem, ora +25% */
    }

    /* REGOLA QUI: dettagli mobile */
    .stat-detail {
        font-size: 0.75rem; /* Era 0.6rem, ora +25% */
    }

    /* TIPI SESSIONE MOBILE - dimensioni aumentate +25% */
    /* REGOLA QUI: gap lista tipi mobile */
    .tipi-list {
        gap: 7.5px; /* Era 6px, ora +25% */
    }

    /* REGOLA QUI: padding item tipo mobile */
    .tipo-item {
        padding: 6.25px 7.5px; /* Era 5px 6px, ora +25% */
    }

    /* REGOLA QUI: nome tipo mobile */
    .tipo-nome {
        font-size: 0.8125rem; /* Era 0.65rem, ora +25% */
    }

    /* REGOLA QUI: precisione tipo mobile */
    .tipo-precisione {
        font-size: 0.9375rem; /* Era 0.75rem, ora +25% */
    }

    /* REGOLA QUI: altezza barra tipo mobile */
    .tipo-bar-container {
        height: 6.25px; /* Era 5px, ora +25% */
    }

    /* REGOLA QUI: sessioni tipo mobile */
    .tipo-sessioni {
        font-size: 0.6875rem; /* Era 0.55rem, ora +25% */
    }

    /* TOP LIST MOBILE - dimensioni aumentate +25% */
    /* REGOLA QUI: gap lista top mobile */
    .top-list {
        gap: 7.5px; /* Era 6px, ora +25% */
    }

    /* REGOLA QUI: padding item top mobile */
    .top-item {
        padding: 6.25px 7.5px; /* Era 5px 6px, ora +25% */
    }

    /* REGOLA QUI: nome top mobile */
    .top-nome {
        font-size: 0.8125rem; /* Era 0.65rem, ora +25% */
    }

    /* REGOLA QUI: precisione top mobile */
    .top-precisione {
        font-size: 0.9375rem; /* Era 0.75rem, ora +25% */
    }

    /* REGOLA QUI: altezza barra top mobile */
    .top-bar-container {
        height: 6.25px; /* Era 5px, ora +25% */
    }

    /* REGOLA QUI: sessioni top mobile */
    .top-sessioni {
        font-size: 0.6875rem; /* Era 0.55rem, ora +25% */
    }

    /* DIREZIONI MOBILE - dimensioni aumentate +25% */
    /* REGOLA QUI: gap direzioni mobile */
    .direzioni-stats {
        gap: 5px; /* Era 4px, ora +25% */
    }

    /* REGOLA QUI: padding direzione mobile */
    .direzione-item {
        padding: 5px; /* Era 4px, ora +25% */
        min-width: 50px; /* Era 40px, ora +25% */
    }

    /* REGOLA QUI: percentuale direzione mobile */
    .direzione-percent {
        font-size: 1.0625rem; /* Era 0.85rem, ora +25% */
    }

    /* REGOLA QUI: label direzione mobile */
    .direzione-label {
        font-size: 0.75rem; /* Era 0.6rem, ora +25% */
    }

    /* REGOLA QUI: lanci direzione mobile */
    .direzione-lanci {
        font-size: 0.625rem; /* Era 0.5rem, ora +25% */
    }

    /* TREND BARS MOBILE - dimensioni aumentate +25% */
    /* REGOLA QUI: altezza e gap trend mobile */
    .trend-bars {
        height: 43.75px; /* Era 35px, ora +25% */
        gap: 3.75px; /* Era 3px, ora +25% */
        justify-content: center;
    }

    /* REGOLA QUI: altezza container barra trend mobile */
    .bar-container {
        height: 30px; /* Era 24px, ora +25% */
    }

    /* CANNE MOBILE - dimensioni aumentate +25% */
    /* REGOLA QUI: larghezza e padding canna mobile */
    .canna-item {
        min-width: 43.75px; /* Era 35px, ora +25% */
        padding: 3.75px; /* Era 3px, ora +25% */
    }

    /* REGOLA QUI: percentuale canna mobile */
    .canna-percent {
        font-size: 1rem; /* Era 0.8rem, ora +25% */
    }

    /* REGOLA QUI: label canna mobile */
    .canna-label {
        font-size: 0.625rem; /* Era 0.5rem, ora +25% */
    }

    .canne-stats {
        justify-content: center;
    }

    /* SKELETON MOBILE */
    .skeleton-card {
        height: 87.5px; /* Era 70px, ora +25% */
    }

    /* EMPTY STATE MOBILE */
    .empty-state {
        padding: var(--spacing-md);
    }

    .empty-state-icon {
        font-size: 2.25rem; /* Era 1.8rem, ora +25% */
    }

    /* FLOATING AI BUTTON MOBILE - dimensioni aumentate +25% */
    /* REGOLA QUI: posizione e dimensioni AI button mobile */
    .floating-ai-button {
        bottom: 87.5px; /* Era 70px, ora +25% */
        right: 18.75px; /* Era 15px, ora +25% */
        width: 80px; /* Era 64px, ora +25% */
        height: 80px; /* Era 64px, ora +25% */
    }

    /* REGOLA QUI: icona AI button mobile */
    .floating-ai-button .ai-icon {
        font-size: 2.25rem; /* Era 1.8rem, ora +25% */
    }

    /* REGOLA QUI: label AI button mobile */
    .floating-ai-button .ai-label {
        font-size: 0.5625rem; /* Era 0.45rem, ora +25% */
    }
}

/* ============================================
   TABLET/DESKTOP - Layout 3 colonne
   ============================================ */

@media (min-width: 769px) {
    body {
        padding: var(--spacing-md);
    }
}