/* Badges Section */
.badges-header {
    margin-top: var(--spacing-4xl);
    margin-bottom: var(--spacing-xl);
}

.badges-header h4 {    
    display: flex;
    justify-content: space-between;
    align-items: center;
    white-space: nowrap;
    margin: auto;
    font-family: var(--font-heading-normal);
    font-size: var(--font-size-lg);
    color: var(--color-text-lighter);
    gap: var(--spacing-xs);
}
.badges-header h4:before,
.badges-header h4:after {
    content: '';
    display: block;
    width: 100%;
    height: 2px;
    border-radius: var(--border-radius-lg);
    background: var(--color-border);
}

.badges-header h4 i {
    color: var(--color-text-lighter);
}

.badges-section .section-header {
    margin-bottom: var(--spacing-md);
    margin-top: 0;
}

.badges-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    padding-top: 0;
}

.badge-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    z-index: 2;
    position: relative;
    padding: 0 var(--spacing-xs);
}

.badge-item {
    display: flex;
    text-align: center;
    flex-direction: column;
    align-items: center;
    padding: var(--spacing-md);
    transition: all var(--transition-base);
    aspect-ratio: 152 / 139; /* Match the SVG proportions */
    width: 100%;
    max-width: 152px;
    position: relative;
    overflow: hidden;
    /* Use the hexagonal SVG as background */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='152' height='139' viewBox='0 0 152 139' fill='none'%3E%3Cpath d='M20.7018 17.4132C25.3111 6.83775 35.7502 0 47.2865 0H104.714C116.25 0 126.689 6.83774 131.298 17.4132L148.95 57.9132C152.17 65.3021 152.17 73.6979 148.95 81.0868L131.298 121.587C126.689 132.162 116.25 139 104.714 139H47.2865C35.7502 139 25.3111 132.162 20.7018 121.587L3.05007 81.0868C-0.170347 73.6979 -0.170353 65.3021 3.05006 57.9132L20.7018 17.4132Z' fill='%23D9D9D9'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* Sheen animation overlay */
.badge-item::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -150%;
    width: 20px;
    height: 200%;
    background: rgba(255, 255, 255, 0.5);
    transform: rotate(45deg);
    transition: left 0.6s ease-in-out;
    z-index: 1;
    pointer-events: none;
}

/* Trigger sheen on hover */
.badge-item:hover::before {
    left: 150%;
}

/* Trigger sheen animation programmatically (for score updates) */
.badge-item.sheen-animate::before {
    left: 150%;
}

/* Sparkle effects - 3 dots at random positions */
.badge-item::after {
    content: '';
    position: absolute;
    top: 25%;
    left: 20%;
    width: 3px;
    height: 3px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    box-shadow: 
        0 0 4px rgba(255, 255, 255, 0.8),
        0 0 8px rgba(255, 255, 255, 0.6);
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s ease-in-out;
    z-index: 2;
    pointer-events: none;
}

.badge-item:hover::after {
    opacity: 1;
    transform: scale(1);
    animation: sparkle1 0.6s ease-in-out 0.2s;
}


@keyframes sparkle1 {
    0% { transform: scale(0) rotate(0deg); opacity: 0; }
    50% { transform: scale(1.3) rotate(180deg); opacity: 1; }
    100% { transform: scale(1) rotate(360deg); opacity: 0.7; }
}

@keyframes sparkle2 {
    0% { transform: scale(0) rotate(0deg); opacity: 0; }
    50% { transform: scale(1.5) rotate(-180deg); opacity: 1; }
    100% { transform: scale(1) rotate(-360deg); opacity: 0.6; }
}

@keyframes sparkle3 {
    0% { transform: scale(0) rotate(0deg); opacity: 0; }
    50% { transform: scale(1.4) rotate(270deg); opacity: 1; }
    100% { transform: scale(1) rotate(540deg); opacity: 0.5; }
}



.badge-item i {
    font-size: var(--font-size-2xl);
    margin: 0 auto var(--spacing-md) auto;
    z-index: 2;
    position: relative;
    text-shadow: none;
}

/* Bronze - Monochromatic brown/amber (dark bg, light fg) */
.badge-item.bronze {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='152' height='139' viewBox='0 0 152 139' fill='none'%3E%3Cpath d='M20.7018 17.4132C25.3111 6.83775 35.7502 0 47.2865 0H104.714C116.25 0 126.689 6.83774 131.298 17.4132L148.95 57.9132C152.17 65.3021 152.17 73.6979 148.95 81.0868L131.298 121.587C126.689 132.162 116.25 139 104.714 139H47.2865C35.7502 139 25.3111 132.162 20.7018 121.587L3.05007 81.0868C-0.170347 73.6979 -0.170353 65.3021 3.05006 57.9132L20.7018 17.4132Z' fill='%2392400E'/%3E%3C/svg%3E");
}
.badge-item.bronze .badge-name  {
    color: #FEF3C7;
}

.badge-item.bronze .badge-tier  {
    color: #FDE68A;
    opacity: 0.9;
}

/* Silver - Monochromatic gray (dark bg, light fg) */
.badge-item.silver {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='152' height='139' viewBox='0 0 152 139' fill='none'%3E%3Cpath d='M20.7018 17.4132C25.3111 6.83775 35.7502 0 47.2865 0H104.714C116.25 0 126.689 6.83774 131.298 17.4132L148.95 57.9132C152.17 65.3021 152.17 73.6979 148.95 81.0868L131.298 121.587C126.689 132.162 116.25 139 104.714 139H47.2865C35.7502 139 25.3111 132.162 20.7018 121.587L3.05007 81.0868C-0.170347 73.6979 -0.170353 65.3021 3.05006 57.9132L20.7018 17.4132Z' fill='%234B5563'/%3E%3C/svg%3E");
}
.badge-item.silver .badge-name  {
    color: #F3F4F6;
}
.badge-item.silver .badge-tier  {
    color: #D1D5DB;
    opacity: 0.9;
}

/* Gold - Monochromatic yellow (dark bg, light fg) */
.badge-item.gold {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='152' height='139' viewBox='0 0 152 139' fill='none'%3E%3Cpath d='M20.7018 17.4132C25.3111 6.83775 35.7502 0 47.2865 0H104.714C116.25 0 126.689 6.83774 131.298 17.4132L148.95 57.9132C152.17 65.3021 152.17 73.6979 148.95 81.0868L131.298 121.587C126.689 132.162 116.25 139 104.714 139H47.2865C35.7502 139 25.3111 132.162 20.7018 121.587L3.05007 81.0868C-0.170347 73.6979 -0.170353 65.3021 3.05006 57.9132L20.7018 17.4132Z' fill='%23A16207'/%3E%3C/svg%3E");
}
.badge-item.gold .badge-name  {
    color: #FEF9C3;
}
.badge-item.gold .badge-tier  {
    color: #FDE047;
    opacity: 0.9;
}

/* Platinum - Monochromatic purple (dark bg, light fg) */
.badge-item.platinum {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='152' height='139' viewBox='0 0 152 139' fill='none'%3E%3Cpath d='M20.7018 17.4132C25.3111 6.83775 35.7502 0 47.2865 0H104.714C116.25 0 126.689 6.83774 131.298 17.4132L148.95 57.9132C152.17 65.3021 152.17 73.6979 148.95 81.0868L131.298 121.587C126.689 132.162 116.25 139 104.714 139H47.2865C35.7502 139 25.3111 132.162 20.7018 121.587L3.05007 81.0868C-0.170347 73.6979 -0.170353 65.3021 3.05006 57.9132L20.7018 17.4132Z' fill='%236B21A8'/%3E%3C/svg%3E");
}
.badge-item.platinum .badge-name  {
    color: #F5F3FF;
}
.badge-item.platinum .badge-tier  {
    color: #DDD6FE;
    opacity: 0.9;
}

/* Gray - Locked/inactive badges */
.badge-item.gray {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='152' height='139' viewBox='0 0 152 139' fill='none'%3E%3Cpath d='M20.7018 17.4132C25.3111 6.83775 35.7502 0 47.2865 0H104.714C116.25 0 126.689 6.83774 131.298 17.4132L148.95 57.9132C152.17 65.3021 152.17 73.6979 148.95 81.0868L131.298 121.587C126.689 132.162 116.25 139 104.714 139H47.2865C35.7502 139 25.3111 132.162 20.7018 121.587L3.05007 81.0868C-0.170347 73.6979 -0.170353 65.3021 3.05006 57.9132L20.7018 17.4132Z' fill='%23F3F4F6'/%3E%3C/svg%3E");
    opacity: 0.7;
}
.badge-item.gray .badge-name {
    color: #6B7280;
}
.badge-item.gray .badge-tier {
    color: #6B7280;
    opacity: 0.7;
}
.badge-item.gray .badge-progress {
    color: #6b7280;
    font-size: var(--font-size-xs);
    font-weight: 500;
    margin-top: 2px;
}

.badge-name {
    font-size: var(--font-size-s);
    font-family: var(--font-heading-medium);
    line-height: 1.2;
    white-space: nowrap;
    text-transform: uppercase;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: none;
}

.badge-tier {
    letter-spacing: 0.5px;
    opacity: 0.8;
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    color: var(--color-text-muted);
}

/* Badge icon monochromatic colors - light on dark */
.badge-item.bronze i {
    color: #FDE68A;
}

.badge-item.silver i {
    color: #E5E7EB;
}

.badge-item.gold i {
    color: #FEF08A;
}

.badge-item.platinum i {
    color: #E9D5FF;
}

.badge-item.gray i {
    color: #9CA3AF;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .badges-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .badge-item {
        padding: var(--spacing-sm);
        max-width: 120px;
        margin: 0 auto;
    }
    
    .badge-item i {
        font-size: 28px;
    }
    
    .badge-name {
        font-size: 10px;
    }
    
    .badge-tier {
        font-size: 9px;
    }
}
