/* ============================================
   BADGES ESAGONALI - PREMIUM DESIGN
   Per rotte /profile/*
   ============================================ */

/* === CONTAINER GRIGLIA === */
.badges-grid-container {
    width: 100%;
}

.badges-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    padding: 15px 0;
}

/* Titoletto separatore sezione "da sbloccare" */
.badges-section-title {
    width: 100%;
    margin: 25px 0 10px;
    padding: 0 10px;
    color: #6c757d;
    font-size: 12pt;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.badges-section-title i {
    font-size: 11pt;
}

/* === BADGE ESAGONALE BASE === */
.hex-badge {
    position: relative;
    margin: 1.2em 0.8em;
    width: 3.5em;
    height: 5.4em;
    border-radius: 10px;
    display: inline-block;
    top: 0;
    transition: all 0.2s ease;
    cursor: pointer;
}

/* Pseudo-elementi per forma esagonale */
.hex-badge::before,
.hex-badge::after {
    position: absolute;
    width: inherit;
    height: inherit;
    border-radius: inherit;
    background: inherit;
    content: "";
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    margin: auto;
}
.hex-badge::before {
    transform: rotate(60deg);
}
.hex-badge::after {
    transform: rotate(-60deg);
}

/* Hover effect */
.hex-badge:hover {
    top: -4px;
}

/* === CERCHIO INTERNO PER ICONA === */
.hex-badge .circle {
    width: 50px;
    height: 50px;
    position: absolute;
    background: #fff;
    z-index: 10;
    border-radius: 50%;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    margin: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        inset 0 2px 4px rgba(255,255,255,0.8),
        inset 0 -2px 4px rgba(0,0,0,0.1),
        0 3px 8px rgba(0,0,0,0.2);
}

.hex-badge .circle i {
    font-size: 1.5em;
}

.hex-badge .circle .font {
    display: inline-block;
    margin-top: 0;
    font-weight: 700;
    font-size: 12pt;
}

/* === RIBBON CON NOME BADGE === */
.hex-badge .ribbon {
    position: absolute;
    border-radius: 4px;
    padding: 4px 6px;
    width: 90px;
    z-index: 11;
    color: #fff;
    bottom: 8px;
    left: 50%;
    margin-left: -50px;
    height: auto;
    font-size: 11pt;
    font-weight: 600;
    line-height: 1.2;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    text-transform: uppercase;
    background: linear-gradient(to bottom right, #555 0%, #333 100%);
    cursor: default;
    text-align: center;
    /* Tronca con ... se troppo lungo */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* === COLORI PER RARITA === */

/* Bronze (Comune) */
.hex-badge.bronze {
    background: linear-gradient(to bottom right, #e6c07b 0%, #CD7F32 100%);
}
.hex-badge.bronze .circle i {
    color: #CD7F32;
}

/* Silver (Non Comune) */
.hex-badge.silver {
    background: linear-gradient(to bottom right, #E8E8E8 0%, #C0C0C0 100%);
}
.hex-badge.silver .circle i {
    color: #8a8a8a;
}

/* Gold (Raro) */
.hex-badge.gold {
    background: linear-gradient(to bottom right, #f7e98e 0%, #FFD700 100%);
}
.hex-badge.gold .circle i {
    color: #b8860b;
}

/* Purple (Epico) */
.hex-badge.purple {
    background: linear-gradient(to bottom right, #ab47bc 0%, #9400D3 100%);
}
.hex-badge.purple .circle i {
    color: #9400D3;
}

/* Orange (Leggendario) */
.hex-badge.orange {
    background: linear-gradient(to bottom right, #ffc107 0%, #FF4500 100%);
}
.hex-badge.orange .circle i {
    color: #FF4500;
}

/* === STATO BLOCCATO === */
.hex-badge.locked {
    filter: grayscale(100%);
    opacity: 0.5;
}
.hex-badge.locked:hover {
    opacity: 0.65;
    top: -2px;
}
.hex-badge.locked .circle {
    background: #e0e0e0;
}
.hex-badge.locked .circle i {
    color: #999 !important;
}


/* ============================================
   MODALE BADGE PREMIUM
   ============================================ */

/* Overlay modale */
.badge-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 9999;
    backdrop-filter: blur(4px);
}
.badge-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Contenitore modale */
.badge-modal {
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    border-radius: 24px;
    max-width: 380px;
    width: 90%;
    padding: 35px 30px;
    text-align: center;
    transform: scale(0.8) translateY(20px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    box-shadow:
        0 25px 50px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.1);
}
.badge-modal-overlay.active .badge-modal {
    transform: scale(1) translateY(0);
}

/* Close button */
.badge-modal-close {
    position: absolute;
    top: 15px;
    right: 18px;
    background: #f1f3f4;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 13pt;
    cursor: pointer;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.badge-modal-close:hover {
    background: #e8eaeb;
    color: #333;
    transform: rotate(90deg);
}

/* Header con badge grande */
.badge-modal-header {
    margin-bottom: 15px;
    display: flex;
    justify-content: center;
}

/* Badge grande nella modale */
.badge-modal-header .hex-badge.large {
    width: 5em;
    height: 7.7em;
    margin: 0.5em auto;
    cursor: default;
}
.badge-modal-header .hex-badge.large:hover {
    top: 0;
}
.badge-modal-header .hex-badge.large .circle {
    width: 70px;
    height: 70px;
}
.badge-modal-header .hex-badge.large .circle i {
    font-size: 2.2em;
}
.badge-modal-header .hex-badge.large .ribbon {
    display: none;
}

/* Nome badge */
.badge-modal-name {
    font-size: 13pt;
    font-weight: 700;
    margin: 5px 0 8px;
    color: #1a1a1a;
}

/* Rarità badge */
.badge-modal-rarity {
    display: inline-block;
    font-size: 11pt;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: 4px 12px;
    border-radius: 20px;
    background: #f1f3f4;
}
.badge-modal-rarity.bronze { background: linear-gradient(135deg, #e6c07b, #CD7F32); color: #fff; }
.badge-modal-rarity.silver { background: linear-gradient(135deg, #E8E8E8, #a0a0a0); color: #333; }
.badge-modal-rarity.gold { background: linear-gradient(135deg, #f7e98e, #d4a600); color: #5a4a00; }
.badge-modal-rarity.purple { background: linear-gradient(135deg, #ab47bc, #7b1fa2); color: #fff; }
.badge-modal-rarity.orange { background: linear-gradient(135deg, #ffc107, #e65100); color: #fff; }

/* Descrizione */
.badge-modal-desc {
    color: #5f6368;
    margin: 18px 0;
    line-height: 1.6;
    font-size: 12pt;
}

/* Info rows container */
.badge-modal-info {
    background: #f8f9fa;
    border-radius: 16px;
    padding: 15px 18px;
    margin-top: 20px;
    text-align: left;
}

.info-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #e9ecef;
    font-size: 12pt;
}
.info-row:last-child {
    border-bottom: none;
}
.info-row i {
    color: #5f6368;
    width: 20px;
    text-align: center;
    font-size: 12pt;
}
.info-row span {
    color: #3c4043;
}
.info-row .value {
    margin-left: auto;
    font-weight: 600;
    color: #1a73e8;
}

/* Progress bar nella modale */
.badge-modal-progress {
    margin-top: 20px;
    padding: 15px 18px;
    background: #fff3e0;
    border-radius: 16px;
    border: 1px solid #ffe0b2;
}
.badge-modal-progress .progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 11pt;
    color: #5f6368;
}
.badge-modal-progress .progress-bar-container {
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}
.badge-modal-progress .progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff9800, #ff5722);
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* Stato sbloccato - badge verde */
.badge-modal-unlocked {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 15px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #81c784, #4caf50);
    color: #fff;
    border-radius: 20px;
    font-size: 11pt;
    font-weight: 600;
}
.badge-modal-unlocked i {
    font-size: 12pt;
}

/* Nascondere righe non applicabili */
.info-row.hidden {
    display: none;
}

/* Come ottenere - per badge bloccati */
.badge-modal-how {
    margin-top: 20px;
    padding: 15px 18px;
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    border-radius: 16px;
    border: 1px solid #90caf9;
    text-align: left;
}
.badge-modal-how .how-to-get {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12pt;
    font-weight: 600;
    color: #1565c0;
    margin-bottom: 8px;
}
.badge-modal-how .how-to-get i {
    color: #ffc107;
    font-size: 13pt;
}
.badge-modal-how-desc {
    font-size: 12pt;
    color: #37474f;
    margin: 0;
    line-height: 1.5;
}

/* ============================================
   RESPONSIVE - Stessa dimensione ovunque
   ============================================ */

/* Forza 3 per riga su tutte le dimensioni */
.badges-grid {
    max-width: 450px;
    margin: 0 auto;
}

@media (max-width: 400px) {
    .hex-badge {
        margin: 1em 0.5em;
        width: 3.2em;
        height: 5em;
    }
    .hex-badge .circle {
        width: 45px;
        height: 45px;
    }
    .hex-badge .circle i {
        font-size: 1.3em;
    }
    .hex-badge .ribbon {
        width: 80px;
        margin-left: -45px;
        font-size: 11pt;
        padding: 3px 4px;
        bottom: 6px;
        height: 16px;
        line-height: 16px;
    }

    .badge-modal {
        padding: 25px 20px;
        margin: 15px;
    }
    .badge-modal-header .hex-badge.large {
        width: 4em;
        height: 6.2em;
    }
    .badge-modal-header .hex-badge.large .circle {
        width: 55px;
        height: 55px;
    }
    .badge-modal-header .hex-badge.large .circle i {
        font-size: 1.8em;
    }
}

/* ============================================
   FILTRI BADGES (deprecato)
   ============================================ */
.badges-filters {
    display: none;
}
