/* assets/css/classifiche_stagione.css */

/* =========================================
   1. FONTS & RESET GLOBALE
   ========================================= */
@font-face {
    font-family: 'DrukWide';
    src: url('../../doc/DrukWideBold.otf') format('opentype');
    font-weight: bold;
}
@font-face {
    font-family: 'HelveticaBold';
    src: url('../../doc/HelveticaBold.ttf') format('truetype');
    font-weight: bold;
}

:root {
    --rosa-neon: #ff19ff;
    --bianco: #ffffff;
    --glass-bg: rgba(20, 20, 20, 0.85); 
    --border-light: rgba(255, 255, 255, 0.15);
}

/* FIX SFONDO MOBILE (Tecnica ::before) */
body {
    font-family: 'HelveticaBold', sans-serif;
    color: var(--bianco);
    margin: 0;
    text-transform: uppercase !important; 
    
    /* Rimuovo lo sfondo da qui */
    background: transparent !important;
    
    position: relative;
    min-height: 100vh;
    z-index: 0;
    display: flex;
    flex-direction: column;
}

/* Elemento virtuale per lo sfondo fisso */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    
    background: url('../../imm/sfondouml25.jpg') center/cover no-repeat;
    
    z-index: -1; /* Sta dietro a tutto */
    transform: translateZ(0); /* Forza accelerazione hardware su mobile */
    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(5px); }
    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: 4px;
    animation: pulse 1.5s infinite ease-in-out;
}

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

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

/* =========================================
   3. TABELLA DESKTOP
   ========================================= */
.classifica-section { max-width: 900px; width: 95%; margin: 0 auto 50px auto; }
.table-container {
    background: var(--glass-bg); border-radius: 12px;
    border: 1px solid var(--border-light); overflow: hidden;
    min-height: 400px; 
}
.classifica-table { 
    width: 100%; 
    border-collapse: collapse; 
    table-layout: fixed; /* Blocca larghezza colonne */
}

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

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

/* Righe */
.desktop-row td {
    padding: 8px 15px; 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: 1rem; 
    color: #fff; text-align: center; width: 30px; display: inline-block;
}
.rank-1 .rank-num { color: var(--rosa-neon); font-size: 1.3rem; }

.player-cell-content { display: flex; align-items: center; gap: 12px; }
.player-avatar {
    width: 38px; height: 38px; border-radius: 6px; 
    object-fit: cover; border: 1px solid rgba(255,255,255,0.2);
}
.player-texts { display: flex; flex-direction: column; line-height: 1.1; }
.p-nome { font-size: 0.65rem; color: #ffffff !important; opacity: 1 !important; }
.p-cognome { font-family: 'DrukWide', sans-serif; font-size: 0.85rem; color: #ffffff !important; opacity: 1 !important; }
.role-badge { font-size: 0.55rem; color: var(--rosa-neon); font-weight: bold; margin-top: 2px; }

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

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

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

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

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

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

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

    .mob-img-box { position: relative; width: 40px; height: 40px; flex-shrink: 0; }
    .mob-avatar { width: 100%; height: 100%; border-radius: 8px; object-fit: cover; }
    .mob-team-logo {
        position: absolute; bottom: -4px; right: -4px; width: 18px; height: 18px;
        background: #111; 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; line-height: 1.1;
    }
    .mob-nome { font-size: 0.65rem; color: #fff !important; opacity: 1 !important; font-weight: bold; }
    .mob-cognome { font-family: 'DrukWide', sans-serif; font-size: 0.8rem; color: #fff !important; opacity: 1 !important; }
    .mob-meta { display: flex; gap: 5px; align-items: center; margin-top: 2px; }
    .mob-role { font-size: 0.5rem; 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: 45px; flex-shrink: 0;
    }
    .mob-stat-val {
        font-family: 'DrukWide', sans-serif; font-size: 1.1rem;
        color: var(--rosa-neon); display: block;
    }
}

/* Aumento proporzionale dei testi per schermi DESKTOP */
@media (min-width: 769px) {
    html {
        font-size: 100% !important;
    }
}
/* Riduzione font globale su mobile */
@media (max-width: 768px) {
    html {
        font-size: 80% !important; 
    }
}