/* ─── Badge Quest Section ─────────────────────────────────────── */

.badges-section {
    margin-bottom: 24px;
}

.badges-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.badges-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary, rgba(255,255,255,0.7));
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.badges-title i {
    color: #fdcb6e;
    font-size: 1rem;
}

.badges-counter {
    font-size: 0.75rem;
    color: var(--text-muted, rgba(255,255,255,0.5));
    background: rgba(255,255,255,0.05);
    padding: 2px 10px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.08);
}

.badges-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

@media (min-width: 480px) {
    .badges-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ─── Badge Card ──────────────────────────────────────────────── */

.badge-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: var(--card-bg, rgba(255,255,255,0.05));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border, rgba(255,255,255,0.1));
    border-radius: 14px;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.badge-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}

/* Unlocked state */
.badge-card.unlocked {
    border-color: rgba(253,203,110,0.4);
    background: linear-gradient(135deg, rgba(253,203,110,0.08) 0%, rgba(181,138,254,0.08) 100%);
}

.badge-card.unlocked::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #fdcb6e, #f39c12, #fdcb6e);
}

/* Locked state */
.badge-card.locked {
    border-style: dashed;
    border-color: rgba(255,255,255,0.08);
}

/* ─── Badge Icon ──────────────────────────────────────────────── */

.badge-icon-wrapper {
    position: relative;
    flex-shrink: 0;
    width: 52px;
    height: 52px;
}

.badge-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    object-fit: cover;
    transition: filter 0.3s ease;
}

.badge-card.locked .badge-icon {
    filter: grayscale(100%) brightness(0.5);
}

.badge-card.unlocked .badge-icon {
    filter: none;
    box-shadow: 0 0 12px rgba(253,203,110,0.3);
}

/* Checkmark overlay on unlocked */
.badge-check {
    display: none;
    position: absolute;
    bottom: -3px;
    right: -3px;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #00b894, #00cec9);
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    color: #fff;
    border: 2px solid var(--dark-bg, #0f0f1a);
}

.badge-card.unlocked .badge-check {
    display: flex;
}

/* ─── Badge Content ───────────────────────────────────────────── */

.badge-content {
    flex: 1;
    min-width: 0;
}

.badge-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary, #fff);
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.badge-description {
    font-size: 0.72rem;
    color: var(--text-secondary, rgba(255,255,255,0.7));
    margin-bottom: 6px;
    line-height: 1.3;
}

/* ─── Progress Bar ────────────────────────────────────────────── */

.badge-progress-bar {
    width: 100%;
    height: 5px;
    background: rgba(255,255,255,0.08);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 4px;
}

.badge-progress-fill {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, #b58afe, #6c5ce7);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.badge-card.unlocked .badge-progress-fill {
    background: linear-gradient(90deg, #fdcb6e, #f39c12);
}

/* ─── Progress Text & Reward ──────────────────────────────────── */

.badge-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.badge-progress-text {
    font-size: 0.65rem;
    color: var(--text-muted, rgba(255,255,255,0.5));
}

.badge-reward {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.65rem;
    font-weight: 600;
    color: #fdcb6e;
    background: rgba(253,203,110,0.12);
    padding: 2px 7px;
    border-radius: 10px;
}

.badge-reward i {
    font-size: 0.6rem;
}

.badge-card.unlocked .badge-reward {
    color: #00b894;
    background: rgba(0,184,148,0.12);
}

/* ─── Unlock Animation ────────────────────────────────────────── */

.badge-card.just-unlocked {
    animation: badgeUnlockPulse 0.6s ease;
}

@keyframes badgeUnlockPulse {
    0% { transform: scale(1); }
    30% { transform: scale(1.04); box-shadow: 0 0 25px rgba(253,203,110,0.4); }
    100% { transform: scale(1); }
}

/* ─── Badge Unlock Toast ──────────────────────────────────────── */

.badge-toast-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: badgeToastFadeIn 0.3s ease;
}

@keyframes badgeToastFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.badge-toast {
    background: linear-gradient(145deg, #1a1a2e, #16213e);
    border: 1px solid rgba(253,203,110,0.3);
    border-radius: 20px;
    padding: 28px 24px;
    text-align: center;
    max-width: 300px;
    width: 90%;
    position: relative;
    overflow: hidden;
    animation: badgeToastScale 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes badgeToastScale {
    from { transform: scale(0.7); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.badge-toast::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, rgba(253,203,110,0.1), transparent, rgba(181,138,254,0.1), transparent);
    animation: badgeShine 3s linear infinite;
}

@keyframes badgeShine {
    100% { transform: rotate(360deg); }
}

.badge-toast-content {
    position: relative;
    z-index: 1;
}

.badge-toast-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #fdcb6e;
    margin-bottom: 12px;
    font-weight: 600;
}

.badge-toast-icon {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    object-fit: cover;
    margin-bottom: 14px;
    box-shadow: 0 0 30px rgba(253,203,110,0.3);
    animation: badgeIconFloat 2s ease-in-out infinite;
}

@keyframes badgeIconFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.badge-toast-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
}

.badge-toast-desc {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.6);
    margin-bottom: 16px;
    line-height: 1.4;
}

.badge-toast-coins {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, rgba(253,203,110,0.2), rgba(243,156,18,0.2));
    border: 1px solid rgba(253,203,110,0.3);
    padding: 8px 18px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 700;
    color: #fdcb6e;
    margin-bottom: 16px;
    animation: coinPulse 1.5s ease-in-out infinite;
}

@keyframes coinPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); box-shadow: 0 0 16px rgba(253,203,110,0.3); }
}

.badge-toast-coins i {
    font-size: 1.1rem;
}

.badge-toast-dismiss {
    display: block;
    width: 100%;
    padding: 10px;
    background: linear-gradient(90.9deg, #D2B8FF 2.74%, #8240FF 102.92%);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.badge-toast-dismiss:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(130,64,255,0.3);
}

/* ─── See All Link ────────────────────────────────────────────── */

.badges-see-all {
    font-size: 0.75rem;
    color: #b58afe;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    transition: color 0.2s;
}

.badges-see-all:hover {
    color: #d2b8ff;
    text-decoration: none;
}

/* ─── Badges Page — Category Headers ─────────────────────────── */

.badges-page-category {
    margin-bottom: 28px;
}

.badges-category-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #e0e0e0;
}

.badges-category-header i {
    color: #b58afe;
    font-size: 1.1rem;
}

.badges-category-count {
    margin-left: auto;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.5);
    background: rgba(255,255,255,0.05);
    padding: 2px 10px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.08);
}

.badges-grid-full {
    grid-template-columns: 1fr !important;
}

@media (min-width: 480px) {
    .badges-grid-full {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}
