/* ============================================
   LEADERBOARD - Stile accessibile 60+
   ============================================ */

/* TABS CLASSIFICA */
.leaderboard-tabs {
    display: flex;
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 5px;
}

.leaderboard-tabs .nav-link {
    font-size: 13pt;
    font-weight: 600;
    padding: 12px 20px;
    color: #666;
    border: none;
    border-bottom: 3px solid transparent;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.leaderboard-tabs .nav-link:hover {
    color: #ff5200;
    border-bottom-color: rgba(255, 82, 0, 0.3);
}

.leaderboard-tabs .nav-link.active {
    color: #ff5200;
    border-bottom-color: #ff5200;
}

.leaderboard-tabs .nav-link i {
    margin-right: 6px;
}

.leaderboard-tabs .badge-mese {
    background: #ff5200;
    color: #fff;
    font-size: 10pt;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 6px;
}

/* TAB CONTENT */
.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* PODIO */
.leaderboard-podium {
    padding: 30px 15px;
    background: linear-gradient(180deg, #f8f9fa 0%, #fff 100%);
    border-radius: 12px;
    margin-bottom: 25px;
}

.podium-container {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 15px;
    max-width: 600px;
    margin: 0 auto;
}

.podium-item {
    text-align: center;
    flex: 1;
    max-width: 180px;
}

.podium-item.podium-1 { order: 2; }
.podium-item.podium-2 { order: 1; }
.podium-item.podium-3 { order: 3; }

.podium-avatar {
    position: relative;
    margin-bottom: 12px;
    display: inline-block;
}

.podium-avatar.champion::after {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    background: linear-gradient(45deg, #FFD700, #FFA500, #FFD700);
    background-size: 200% 200%;
    animation: champion-glow 2s ease infinite;
    z-index: -1;
    opacity: 0.5;
}

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

.champion-crown {
    position: absolute;
    top: -22px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 24px;
    color: #FFD700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    animation: crown-bounce 1.5s ease infinite;
}

@keyframes crown-bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-4px); }
}

.podium-info {
    margin-bottom: 12px;
}

.podium-name {
    display: block;
    font-size: 12pt;
    font-weight: 700;
    color: #333;
    margin-bottom: 4px;
    text-decoration: none;
}

.podium-name:hover {
    color: #ff5200;
}

.podium-score {
    display: block;
    font-size: 11pt;
    font-weight: 600;
    color: #ff5200;
}

.podium-title {
    display: block;
    font-size: 11pt;
    color: #9400D3;
    font-style: italic;
    margin-top: 4px;
}

/* BASI PODIO */
.podium-base {
    height: 70px;
    border-radius: 8px 8px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20pt;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 2px 3px rgba(0,0,0,0.2);
}

.podium-base.gold {
    height: 100px;
    background: linear-gradient(180deg, #FFD700 0%, #DAA520 100%);
    box-shadow: 0 3px 15px rgba(255,215,0,0.4);
}

.podium-base.silver {
    height: 75px;
    background: linear-gradient(180deg, #C0C0C0 0%, #A8A8A8 100%);
    box-shadow: 0 3px 12px rgba(192,192,192,0.4);
}

.podium-base.bronze {
    height: 55px;
    background: linear-gradient(180deg, #CD7F32 0%, #A0522D 100%);
    box-shadow: 0 3px 12px rgba(205,127,50,0.4);
}

/* TABELLA CLASSIFICA */
.leaderboard-table-container {
    overflow-x: auto;
}

.leaderboard-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 6px;
}

.leaderboard-table tr {
    background: #fff;
    box-shadow: 0 1px 6px rgba(0,0,0,0.05);
    transition: all 0.15s ease;
}

.leaderboard-table tr:hover {
    transform: translateX(3px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.leaderboard-table td {
    padding: 12px 10px;
    vertical-align: middle;
    font-size: 11pt;
}

.leaderboard-table td:first-child {
    border-radius: 6px 0 0 6px;
}

.leaderboard-table td:last-child {
    border-radius: 0 6px 6px 0;
}

.leaderboard-table .rank-cell {
    width: 50px;
    text-align: center;
    font-weight: 700;
    font-size: 12pt;
    color: #666;
}



.leaderboard-table .user-cell {
    font-weight: 600;
    font-size: 11pt;
}

.leaderboard-table .user-cell a {
    color: #333;
    text-decoration: none;
}

.leaderboard-table .user-cell a:hover {
    color: #ff5200;
}

.leaderboard-table .score-cell {
    text-align: right;
    font-weight: 700;
    font-size: 11pt;
    color: #ff5200;
    padding-right: 15px;
}

/* HEADER MENSILE */
.monthly-header {
    text-align: center;
    padding: 18px;
    background: linear-gradient(135deg, #ff5200 0%, #ff8d00 100%);
    border-radius: 12px;
    color: #fff;
    margin-bottom: 25px;
}

.monthly-header h2 {
    margin: 0 0 8px;
    font-size: 16pt;
}

.monthly-header .countdown {
    font-size: 12pt;
    margin: 0;
}

.monthly-header .days-left {
    font-weight: 700;
    font-size: 16pt;
    background: rgba(255,255,255,0.2);
    padding: 4px 12px;
    border-radius: 15px;
    margin-left: 5px;
}

/* HALL OF FAME */
.hall-of-fame {
    padding: 20px 0;
}

.hof-month {
    margin-bottom: 30px;
}

.hof-month-title {
    font-size: 13pt;
    font-weight: 700;
    color: #333;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e9ecef;
    text-transform: capitalize;
}

.hof-winners {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.hof-winner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    flex: 1;
    min-width: 220px;
    max-width: 320px;
}

.hof-winner.gold { border-left: 3px solid #FFD700; }
.hof-winner.silver { border-left: 3px solid #C0C0C0; }
.hof-winner.bronze { border-left: 3px solid #CD7F32; }

.hof-winner .hof-pos {
    font-size: 16pt;
    font-weight: 700;
    width: 30px;
    text-align: center;
}

.hof-winner.gold .hof-pos { color: #DAA520; }
.hof-winner.silver .hof-pos { color: #888; }
.hof-winner.bronze .hof-pos { color: #A0522D; }

.hof-winner .hof-info {
    flex: 1;
}

.hof-winner .hof-name {
    font-weight: 600;
    font-size: 11pt;
    color: #333;
    display: block;
}

.hof-winner .hof-score {
    font-size: 10pt;
    color: #666;
}

/* MINI TABS HOMEPAGE */
.home-leaderboard-widget {
    margin: 20px 0;
}

.home-tab-panel {
    display: none !important;
}

.home-tab-panel.active {
    display: block !important;
}

.leaderboard-tabs-mini {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.leaderboard-tabs-mini .tab-btn {
    padding: 8px 16px;
    font-size: 11pt;
    font-weight: 600;
    color: #666;
    background: #f5f5f5;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.leaderboard-tabs-mini .tab-btn:hover {
    background: #eee;
    color: #ff5200;
}

.leaderboard-tabs-mini .tab-btn.active {
    background: #ff5200;
    color: #fff;
}

.leaderboard-tabs-mini .tab-btn i {
    margin-right: 5px;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .leaderboard-podium {
        padding: 15px 5px;
    }

    .podium-container {
        flex-direction: row;
        align-items: flex-end;
        gap: 8px;
    }

    .podium-item {
        flex: 1;
        min-width: 0;
        max-width: none;
    }

    /* Mantieni ordine podio: 2-1-3 */
    .podium-item.podium-1 { order: 2; }
    .podium-item.podium-2 { order: 1; }
    .podium-item.podium-3 { order: 3; }

    .podium-avatar {
        margin-bottom: 8px;
    }

    /* Avatar più piccoli su mobile */
    .podium-item .gamification-avatar {
        width: 50px !important;
        height: 50px !important;
    }

    .podium-item.podium-1 .gamification-avatar {
        width: 60px !important;
        height: 60px !important;
    }

    .champion-crown {
        font-size: 16px;
        top: -16px;
    }

    .podium-name {
        font-size: 12pt;
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .podium-score {
        font-size: 11t;
    }

    .podium-title {
        font-size: 11pt;
    }

    /* Basi podio proporzionali su mobile */
    .podium-base {
        font-size: 14pt;
        border-radius: 6px 6px 0 0;
    }

    .podium-base.gold {
        height: 70px;
    }

    .podium-base.silver {
        height: 50px;
    }

    .podium-base.bronze {
        height: 35px;
    }

    .leaderboard-tabs .nav-link {
        font-size: 11pt;
        padding: 10px 12px;
    }

    .hof-winners {
        flex-direction: column;
    }

    .hof-winner {
        max-width: none;
    }

    .monthly-header h2 {
        font-size: 14pt;
    }

    .monthly-header .countdown {
        font-size: 11pt;
    }

    .monthly-header .days-left {
        font-size: 14pt;
    }
}

/* VERY SMALL SCREENS */
@media (max-width: 380px) {
    .podium-container {
        gap: 4px;
    }

    .podium-item .gamification-avatar {
        width: 40px !important;
        height: 40px !important;
    }

    .podium-item.podium-1 .gamification-avatar {
        width: 50px !important;
        height: 50px !important;
    }

    .champion-crown {
        font-size: 14px;
        top: -14px;
    }

    .podium-name {
        font-size: 11pt;
    }

    .podium-score {
        font-size: 8pt;
    }

    .podium-base {
        font-size: 12pt;
    }

    .podium-base.gold {
        height: 55px;
    }

    .podium-base.silver {
        height: 40px;
    }

    .podium-base.bronze {
        height: 28px;
    }

    .leaderboard-tabs .nav-link {
        font-size: 10pt;
        padding: 8px 10px;
    }

    .leaderboard-tabs-mini .tab-btn {
        padding: 6px 12px;
        font-size: 10pt;
    }
}

/* ACCESSIBILITA - Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .champion-crown,
    .podium-avatar.champion::after {
        animation: none;
    }

    .leaderboard-table tr:hover {
        transform: none;
    }
}

/* HIGH CONTRAST */
@media (prefers-contrast: high) {
    .leaderboard-table tr {
        border: 1px solid #333;
    }

    .podium-name,
    .leaderboard-table .user-cell a {
        text-decoration: underline;
    }
}

/* ============================================
   GUIDE PAGE STYLES
   ============================================ */

.guide-section {
    margin-bottom: 50px;
    padding: 30px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.guide-section h2 {
    color: #ff5200;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
    font-size: 16pt;
}

.guide-section h2 i {
    margin-right: 10px;
}

.guide-card {
    display: flex;
    align-items: flex-start;
    padding: 20px;
    margin-bottom: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #ff5200;
}

.guide-card-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #ff5200, #ff7b00);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
    flex-shrink: 0;
}

.guide-card-icon i {
    color: white;
    font-size: 20px;
}

.guide-card-content h4 {
    margin: 0 0 8px 0;
    color: #333;
    font-size: 13pt;
}

.guide-card-content p {
    margin: 0;
    color: #666;
    font-size: 11pt;
    line-height: 1.5;
}

.guide-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.guide-table th,
.guide-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
    font-size: 11pt;
}

.guide-table th {
    background: #f8f9fa;
    color: #333;
    font-weight: 600;
}

.guide-table tr:hover {
    background: #fafafa;
}

.badge-category {
    margin-bottom: 30px;
}

.badge-category h4 {
    color: #555;
    margin-bottom: 15px;
    padding-left: 10px;
    border-left: 3px solid #ff5200;
    font-size: 12pt;
}

.tier-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 20px;
}

.tier-card {
    padding: 15px 25px;
    border-radius: 8px;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    font-size: 11pt;
}

/* Tier colors - match gamification.css */
.tier-card.level-tier-1 { background: linear-gradient(135deg, #8B4513, #A0522D); }
.tier-card.level-tier-2 { background: linear-gradient(135deg, #C0C0C0, #A8A8A8); }
.tier-card.level-tier-3 { background: linear-gradient(135deg, #FFD700, #DAA520); }
.tier-card.level-tier-4 { background: linear-gradient(135deg, #4169E1, #1E90FF); }
.tier-card.level-tier-5 { background: linear-gradient(135deg, #9400D3, #8B008B); }
.tier-card.level-tier-6 { background: linear-gradient(135deg, #FF4500, #FF6347); }
.tier-card.level-tier-7 { background: linear-gradient(135deg, #DC143C, #FF1493); }

/* Guide Responsive */
@media (max-width: 768px) {
    .guide-section {
        padding: 20px 15px;
        margin-bottom: 30px;
    }

    .guide-section h2 {
        font-size: 14pt;
    }

    .guide-card {
        flex-direction: column;
        text-align: center;
        padding: 15px;
    }

    .guide-card-icon {
        margin: 0 auto 15px;
    }

    .guide-card-content h4 {
        font-size: 12pt;
    }

    .guide-card-content p {
        font-size: 10pt;
    }

    .guide-table th,
    .guide-table td {
        padding: 10px 8px;
        font-size: 10pt;
    }

    .tier-cards {
        flex-direction: column;
    }

    .tier-card {
        text-align: center;
    }

    .badge-category h4 {
        font-size: 11pt;
    }
}

/* ============================================
   PROFILE TABS - Stile migliorato con icone
   ============================================ */

.profile-tabs .nav-tabs {
    border-bottom: 2px solid #e9ecef;
    flex-wrap: wrap;
    gap: 5px;
}

.profile-tabs .nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 22px;
    border: none;
    border-bottom: 3px solid transparent;
    border-radius: 8px 8px 0 0;
    background: #f8f9fa;
    color: #666;
    font-weight: 500;
    font-size: 13pt;
    transition: all 0.2s ease;
    text-decoration: none;
    margin-bottom: -2px;
}

.profile-tabs .nav-link:hover {
    color: #ff5200;
    background: #fff5f0;
    border-bottom-color: rgba(255, 82, 0, 0.3);
}

.profile-tabs .nav-link.active {
    color: #ff5200;
    background: #fff;
    border-bottom-color: #ff5200;
    font-weight: 600;
}

.profile-tabs .nav-link i {
    font-size: 1.1em;
}

.profile-tabs .nav-link .badge {
    background: rgba(0, 0, 0, 0.1);
    color: #666;
    font-size: 100% !important;
    padding: 5px 12px;
    border-radius: 14px;
    font-weight: 700;
}

.profile-tabs .nav-link.active .badge {
    background: #ff5200;
    color: #fff;
}

.profile-tabs .nav-link:hover .badge {
    background: rgba(255, 82, 0, 0.2);
    color: #ff5200;
}

.profile-tabs .nav-link.active:hover .badge {
    background: #ff5200;
    color: #fff;
}

/* Tab text responsive */
.profile-tabs .tab-text {
    white-space: nowrap;
    display: inline !important;
    font-size: inherit !important;
}

/* Mobile responsive per tabs */
@media (max-width: 576px) {
    .profile-tabs .nav-link {
        padding: 10px 12px !important;
        font-size: 11pt !important;
        gap: 6px !important;
    }

    .profile-tabs .nav-link i {
        font-size: 1em !important;
    }

    .profile-tabs .nav-link .badge {
        padding: 3px 8px !important;
        font-size: 90% !important;
    }

    .profile-tabs .tab-text {
        display: inline !important;
        font-size: 11pt !important;
    }
}

/* Loading spinner per infinite scroll */
.load-more-trigger {
    padding: 20px;
    text-align: center;
}

.loading-spinner {
    color: #ff5200;
    font-size: 12pt;
}

.loading-spinner i {
    margin-right: 8px;
}

/* Responsive per mobile */
@media (max-width: 576px) {
    .profile-tabs .nav-link {
        padding: 10px 12px;
        font-size: 10pt;
        gap: 5px;
    }

    .profile-tabs .nav-link .tab-text {
        display: none;
    }

    .profile-tabs .nav-link .badge {
        font-size: 0.8em;
        padding: 2px 6px;
    }

    .profile-tabs .nav-link i {
        font-size: 1.2em;
    }
}

@media (min-width: 577px) and (max-width: 768px) {
    .profile-tabs .nav-link {
        padding: 10px 14px;
        font-size: 10pt;
    }

    .profile-tabs .nav-link .tab-text {
        max-width: 60px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* ============================================
   RISPOSTA CARD - Struttura compatta
   ============================================ */

.risposta-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 15px;
    margin-bottom: 12px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.risposta-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 10px;
}

.risposta-header a {
    font-size: 13pt;
    font-weight: 600;
    color: #333;
    text-decoration: none;
    flex: 1;
    min-width: 200px;
}

.risposta-header a:hover {
    color: #ff5200;
}

.risposta-date {
    color: #888;
    font-size: 10pt;
    white-space: nowrap;
}

.risposta-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.risposta-parola {
    font-size: 15pt;
    color: #ff5200;
    text-transform: uppercase;
}

.risposta-voti {
    display: flex;
    gap: 8px;
}

/* Responsive */
@media (max-width: 576px) {
    .risposta-card {
        padding: 12px;
    }

    .risposta-header a {
        font-size: 12pt;
        min-width: 150px;
    }

    .risposta-parola {
        font-size: 13pt;
    }

    .risposta-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .risposta-voti {
        width: 100%;
        justify-content: flex-end;
    }
}

/* ============================================
   PROFILE STATS - Card con icone
   ============================================ */

.profile-stats-row {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.profile-stat {
    text-align: center;
    flex: 1;
    min-width: 70px;
    max-width: 100px;
    padding: 10px 12px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid rgba(255, 82, 0, 0.1);
}

.profile-stat i {
    font-size: 16pt;
    color: #ff5200;
    margin-bottom: 4px;
    display: block;
}

.profile-stat-label-top {
    font-size: 11pt;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.profile-stat-value {
    font-size: 12pt;
    font-weight: 700;
    color: #333;
}

.profile-stat-rank .profile-stat-value {
    font-size: 14pt;
}

/* ============================================
   PROFILE RANKS - Classifiche prominenti
   ============================================ */
.profile-ranks {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 15px 0;
}

.profile-rank {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.profile-rank i {
    font-size: 18px;
    color: #ff5200;
}

.profile-rank .rank-value {
    font-size: 24px;
    font-weight: 800;
    color: #333;
}

.profile-rank .rank-label {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
}

/* ============================================
   PROFILE STATS INLINE - Punti e risposte
   ============================================ */
.profile-stats-inline {
    display: flex;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    color: #666;
    margin: 10px 0 15px;
}

.profile-stats-inline .stat-item {
    display: flex;
    align-items: center;
    gap: 3px;
}

.profile-stats-inline .stat-item i {
    color: #ff5200;
    font-size: 11pt;
}

.profile-stats-inline .stat-value {
    font-weight: 700;
    color: #333;
}

.profile-stats-inline .stat-label {
    color: #888;
}

.profile-stats-inline .stat-separator {
    color: #ccc;
}

/* Accuracy bar */
.profile-accuracy {
    margin-top: 20px;
    padding: 0 10px;
}

.accuracy-bar {
    display: flex;
    height: 30px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.accuracy-fill {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    transition: width 0.5s ease;
}

.accuracy-value {
    color: #fff;
    font-weight: 700;
    font-size: 11pt;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.accuracy-empty {
    background: linear-gradient(135deg, #dc3545 0%, #e74c3c 100%);
}

.accuracy-labels {
    margin-top: 6px;
    text-align: center;
}

.accuracy-good {
    font-size: 11pt;
    color: #28a745;
    font-weight: 500;
}

.accuracy-good i {
    margin-right: 4px;
}

/* Member since */
.profile-member-since {
    margin-top: 15px;
    font-size: 11pt;
    color: #666;
    text-align: center;
}

/* Responsive */
@media (max-width: 576px) {
    .profile-stat {
        min-width: 60px;
        padding: 8px 10px;
    }

    .profile-stat i {
        font-size: 14pt;
    }

    .profile-stat-label-top {
        font-size: 8pt;
    }

    .profile-stat-value {
        font-size: 11pt;
    }

    .profile-stat-rank .profile-stat-value {
        font-size: 12pt;
    }


    .accuracy-value {
        font-size: 10pt;
    }

    /* Profile ranks mobile */
    .profile-ranks {
        gap: 20px;
    }

    .profile-rank .rank-value {
        font-size: 20px;
    }

    .profile-rank .rank-label {
        font-size: 10px;
    }

    /* Stats inline mobile */
    .profile-stats-inline {
        font-size: 11pt;
    }
}
