/**
 * Badges CSS - Sistema de Gamificação (visual.md §2 e §7)
 *
 * Self-contained: usa as cores do Tailwind config inline de
 * templates/_base/global.html (brand.teal #0d9488 / brand.indigo #312e81)
 * em vez de static/css/design-tokens.css, que não é carregado nas
 * páginas autenticadas (Tailwind-based) onde este widget vive.
 *
 * Progressão visual por NÍVEL (não por badge): I-II = clay simples,
 * III = clay denso + sombra de contato, IV-V = glow (Amber/Cristal).
 * A cor de família vem de `data-material-type` (categoria da badge).
 */

.badge-icon {
    position: relative;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    font-size: 28px;
    line-height: 1;
    flex-shrink: 0;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

.badge-icon[data-material-type="clay_teal"] { background: linear-gradient(145deg, #2dd4bf, #0d9488); }
.badge-icon[data-material-type="clay_indigo"] { background: linear-gradient(145deg, #6366f1, #312e81); }
.badge-icon[data-material-type="clay_amber"] { background: linear-gradient(145deg, #fbbf24, #d97706); }
.badge-icon[data-material-type="glass"] { background: linear-gradient(145deg, rgba(255,255,255,0.85), rgba(226,232,240,0.6)); border: 1px solid rgba(255,255,255,0.6); }
.badge-icon[data-material-type="cristal"] { background: linear-gradient(135deg, #fde68a, #d97706 60%, #fde68a); }

.badge-icon {
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.12), inset 0 1px 1px rgba(255,255,255,0.35);
}

.badge-icon[data-level="3"] {
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.22), inset 0 1px 1px rgba(255,255,255,0.35);
}

.badge-icon--glow,
.badge-icon[data-level="4"],
.badge-icon[data-level="5"] {
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.18), 0 8px 20px rgba(217, 119, 6, 0.35), inset 0 1px 1px rgba(255,255,255,0.5);
}

.badge-icon[data-level="5"] {
    background: linear-gradient(135deg, #312e81, #fde68a 85%);
}

.badge-icon--locked {
    background: #e2e8f0 !important;
    box-shadow: none !important;
    filter: grayscale(1);
    opacity: 0.55;
}

/* ── Widget do Dashboard ─────────────────────────────────────────── */

.badges-widget__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.badge-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
}

.badge-card .badge-icon { width: 52px; height: 52px; font-size: 22px; border-radius: 16px; }

.badge-card__name {
    font-size: 10px;
    font-weight: 700;
    color: #475569;
    line-height: 1.2;
}

.badge-progress-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.badge-progress-item .badge-icon { width: 36px; height: 36px; font-size: 16px; border-radius: 12px; }

.badge-progress-item__content { flex-grow: 1; min-width: 0; }

.badge-progress-item__name {
    font-size: 11px;
    font-weight: 700;
    color: #334155;
    margin-bottom: 3px;
}

.badge-progress-item__bar {
    height: 6px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}

.badge-progress-item__bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #2dd4bf, #0d9488);
    border-radius: 999px;
    transition: width 0.4s ease;
}

.badge-progress-item__text {
    font-size: 10px;
    color: #94a3b8;
    margin-top: 2px;
}

/* ── Modal de celebração ─────────────────────────────────────────── */

.badge-modal__level-star { color: #d97706; }
.badge-modal__level-star--empty { color: #e2e8f0; }
