/* assets/css/classifiche_stagione.css - TEMA 2026 */

/* =========================================
   1. FONTS & RESET GLOBALE
   ========================================= */
@font-face {
    font-family: 'DrukWide';
    src: url('/assets/doc/DrukTextWide-MediumItalic-Trial.otf') format('opentype');
    font-weight: normal ; /* Modificato da bold a normal */  
    font-style: normal;  /* Modificato da italic a normal */
}

@font-face {
    font-family: 'HelveticaBold';
    src: url('/assets/doc/HelveticaBold.ttf') format('truetype');
 font-weight: normal ; /* Modificato da bold a normal */  
 font-style: normal;  /* Modificato da italic a normal */
}

:root {
    --rosa-neon: #ff19ff;
    --viola: #790cfd;
    --bianco: #ffffff;
    --glass-bg: rgba(18, 0, 40, 0.85); /* Vinaccia semitrasparente */
    --border-light: rgba(255, 255, 255, 0.15);
}

/* FIX SFONDO MOBILE & BASE */
body {
    font-family: 'HelveticaBold', sans-serif;
    color: var(--bianco);
    margin: 0;
    text-transform: uppercase !important; 
    
    /* Base Vinaccia */
    background-color: #120028 !important;
    
    position: relative;
    min-height: 100vh;
    z-index: 0;
    display: flex;
    flex-direction: column;
}

/* Elemento virtuale per lo sfondo fisso con Overlay */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    
    /* Nuovo Sfondo con Gradiente Vinaccia Sovrapposto */
    background: linear-gradient(rgba(18, 0, 40, 0.5), rgba(18, 0, 40, 0.5)), url('/assets/imm/gradiente26.jpg') center/cover no-repeat;
    
    z-index: -1; 
    transform: translateZ(0); 
    will-change: transform;
}

html {
    height: 100%;
    overflow-x: hidden;
}

/* Sticky Footer */
main, .classifica-section {
    flex: 1 0 auto;
    width: 100%;
}

a { text-decoration: none !important; color: inherit !important; }

/* =========================================
   ANIMAZIONI (Fade In Dati Veri)
   ========================================= */
@keyframes rowFadeIn {
    from { opacity: 0; transform: translateY(3px); }
    to { opacity: 1; transform: translateY(0); }
}

.classifica-table tbody tr:not(.skeleton-row) {
    animation: rowFadeIn 0.4s ease-out forwards;
}

/* =========================================
   SKELETON LOADING
   ========================================= */
@keyframes pulse {
    0% { opacity: 0.3; }
    50% { opacity: 0.6; }
    100% { opacity: 0.3; }
}

.skeleton-text, .skeleton-img {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    animation: pulse 1.5s infinite ease-in-out;
}

.skeleton-text { height: 8px; width: 100%; margin: 1px 0; }
.skeleton-img { width: 100%; height: 100%; border-radius: 5px; }

/* =========================================
   2. TOGGLE SWITCH
   ========================================= */
.toggle-switch {
    display: flex; justify-content: center; gap: 7px;
    background: var(--glass-bg); padding: 7px; width: fit-content;
    margin: 20px auto; border-radius: 8px; border: 1px solid var(--border-light);
}
.toggle-switch a {
    color: #ccc; padding: 5px 10px; border-radius: 4px;
    font-family: 'DrukWide', sans-serif; font-size: 0.44rem;
    border: 1px solid transparent; transition: 0.3s;
}
.toggle-switch a.active {
    background: var(--rosa-neon); color: #fff; 
    box-shadow: 0 0 7px rgba(255, 25, 255, 0.3);
}

/* =========================================
   3. TABELLA DESKTOP
   ========================================= */
.classifica-section { max-width: 603px; width: 95%; margin: 0 auto 34px auto; }
.table-container {
    background: var(--glass-bg); border-radius: 8px;
    border: 1px solid var(--border-light); overflow: hidden;
    min-height: 268px; 
}
.classifica-table { 
    width: 100%; 
    border-collapse: collapse; 
    table-layout: fixed; 
}

.mobile-header-bar { display: none; }

.classifica-table thead th {
    font-family: 'HelveticaBold', sans-serif; color: var(--rosa-neon);
    font-size: 0.56rem; padding: 10px 12px;
    text-align: left; background: rgba(18, 0, 40, 0.5);
    border-bottom: 1px solid var(--border-light);
}
.classifica-table thead th:last-child { text-align: right !important; }

/* Righe */
.desktop-row td {
    padding: 7px 12px; border-bottom: 1px solid var(--border-light); vertical-align: middle;
}
.desktop-row td:last-child { text-align: right !important; }
.desktop-row:hover { background: rgba(255, 25, 255, 0.05); }

/* Celle */
.rank-num {
    font-family: 'DrukWide', sans-serif; font-size: 0.80rem; 
    color: #fff; text-align: center; width: 24px; display: inline-block;
}
.rank-1 .rank-num { color: var(--rosa-neon); font-size: 1.04rem; }

.player-cell-content { display: flex; align-items: center; gap: 10px; }
.player-avatar {
    width: 30px; height: 30px; border-radius: 4px; 
    object-fit: cover; border: 1px solid rgba(255,255,255,0.2);
}
.player-texts { display: flex; flex-direction: column; justify-content: center; gap: 4px; line-height: 1; }
.p-name-group { display: flex; flex-direction: column; gap: 2px; }
.p-nome { font-size: 0.53rem; color: #ffffff !important; opacity: 1 !important; }
.p-cognome { font-family: 'DrukWide', sans-serif; font-size: 0.68rem; color: #ffffff !important; opacity: 1 !important; }
.role-badge { font-size: 0.44rem; color: var(--rosa-neon); font-weight: bold; }

.classifica-table thead th:nth-child(2),
.classifica-table tbody td:nth-child(2) { width: 45%; }

.team-cell-content { display: flex; align-items: center; gap: 6px; }
.team-logo-mini { width: 19px; height: 19px; object-fit: contain; }
.team-name-text { font-size: 0.56rem; color: #aaa; }

.stat-val-big { font-family: 'DrukWide', sans-serif; font-size: 1.04rem; color: var(--rosa-neon); }

/* =========================================
   4. MOBILE
   ========================================= */
@media (max-width: 515px) {
    .classifica-table thead { display: none !important; }
    .desktop-row { display: none !important; }

    .mobile-header-bar {
        display: flex; justify-content: space-between; padding: 7px 12px;
        background: rgba(18, 0, 40, 0.6);
        border-bottom: 1px solid var(--border-light);
        font-family: 'HelveticaBold', sans-serif; font-size: 0.46rem; 
        color: var(--rosa-neon); text-transform: uppercase;
    }

    .mobile-row { display: table-row !important; }
    .mobile-row td {
        display: block; width: 100%; padding: 8px 12px; 
        box-sizing: border-box; border-bottom: 1px solid rgba(255,255,255,0.1);
    }

    .mob-card { display: flex; align-items: center; width: 100%; gap: 11px; }

    .mob-rank {
        font-family: 'DrukWide', sans-serif; font-size: 0.68rem; 
        color: #fff; width: 16px; text-align: center; flex-shrink: 0;
    }
    .rank-1 .mob-rank { color: var(--rosa-neon); font-size: 0.84rem; }

    .mob-img-box { position: relative; width: 36px; height: 36px; flex-shrink: 0; }
    .mob-avatar { width: 100%; height: 100%; border-radius: 5px; object-fit: cover; }
    
    .mob-team-logo {
        position: absolute; bottom: -3px; right: -3px; width: 17px; height: 17px;
        background: #120028;
        border-radius: 50%; padding: 1px;
        border: 1px solid transparent !important; object-fit: contain; z-index: 2;
    }

    .mob-info {
        flex: 1; display: flex; flex-direction: column; justify-content: center;
        min-width: 0; gap: 3px; line-height: 1.2;
    }
    .mob-nome { font-size: 0.46rem; color: #fff !important; opacity: 1 !important; font-weight: bold; }
    .mob-cognome { font-family: 'DrukWide', sans-serif; font-size: 0.60rem; color: #fff !important; opacity: 1 !important; }
    .mob-meta { display: flex; gap: 4px; align-items: center; margin-top: 2px; }
    .mob-role { font-size: 0.38rem; color: var(--rosa-neon); font-weight: bold; }

    .mob-stat {
        margin-left: auto !important; 
        display: flex; justify-content: flex-end; align-items: center; 
        text-align: right; min-width: 34px; flex-shrink: 0;
    }
    .mob-stat-val {
        font-family: 'DrukWide', sans-serif; font-size: 0.84rem;
        color: var(--rosa-neon); display: block;
    }
}

/* Aumento proporzionale dei testi per schermi DESKTOP 
@media (min-width: 516px) {
    html {
        font-size: 100% !important; /* RIPRISTINATO: Evita doppio rimpicciolimento su header e footer
    }
}*/