/* ─── 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(0, 0, 0, 0.7));
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

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

.badges-counter {
    font-size: 0.75rem;
    color: var(--text-muted, rgba(0, 0, 0, 0.5));
    background: var(--glass);
    padding: 2px 10px;
    border-radius: 20px;
    border: 1px solid rgba(0, 0, 0, 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(0, 0, 0, 0.05));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border, rgba(0, 0, 0, 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.16);
}

/* Unlocked state */
.badge-card.unlocked {
    border-color: rgba(222, 145, 3, 0.4);
    background: linear-gradient(135deg, rgba(222, 145, 3, 0.08) 0%, rgba(88, 88, 88, 0.08) 100%);
}

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

/* Locked state */
.badge-card.locked {
    border-style: dashed;
    border-color: var(--line);
}

/* ─── 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(0, 0, 0, 0.06);
}

/* 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: var(--ink);
    border: 2px solid var(--dark-bg, #ebebeb);
}

.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, #000000);
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 6px;
}

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

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

.badge-progress-bar {
    width: 100%;
    height: 5px;
    background: var(--glass-strong);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 4px;
}

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

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

/* ─── 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(0, 0, 0, 0.5));
}

.badge-reward {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.65rem;
    font-weight: 600;
    color: #de9103;
    background: rgba(222, 145, 3, 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(0, 0, 0, 0.06); }
    100% { transform: scale(1); }
}

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

.badge-toast-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* Backdrop, not a panel — the card inside is what carries the content. */
    background: var(--surface-veil);
    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, #dbdbdb, #d5d5d5);
    border: 1px solid rgba(222, 145, 3, 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(222, 145, 3, 0.1), transparent, rgba(88, 88, 88, 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: #de9103;
    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(0, 0, 0, 0.06);
    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: var(--ink);
    margin-bottom: 6px;
}

.badge-toast-desc {
    font-size: 0.8rem;
    color: var(--ink-muted);
    margin-bottom: 16px;
    line-height: 1.4;
}

.badge-toast-coins {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, rgba(222, 145, 3, 0.2), rgba(154, 97, 8, 0.2));
    border: 1px solid rgba(222, 145, 3, 0.3);
    padding: 8px 18px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 700;
    color: #de9103;
    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(0, 0, 0, 0.06); }
}

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

.badge-toast-dismiss {
    display: block;
    width: 100%;
    padding: 10px;
    background: linear-gradient(90.9deg, #232323 2.74%, #777777 102.92%);
    color: var(--brand-ink);
    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(0, 0, 0, 0.06);
}

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

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

.badges-see-all:hover {
    color: var(--ink-soft);
    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: var(--ink-soft);
}

.badges-category-header i {
    color: var(--ink-soft);
    font-size: 1.1rem;
}

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

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

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

/* ─── AI Influencer Course: Enrollment Banner ─────────────────── */

.ai-enroll-banner {
    background: linear-gradient(135deg, rgba(130, 130, 130, 0.18), rgba(146, 146, 146, 0.1));
    border: 1px solid rgba(130, 130, 130, 0.45);
    border-radius: 16px;
    padding: 18px 20px;
    margin-top: 16px;
}

.ai-enroll-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #828282, #929292);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: var(--ink);
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
}

.ai-enroll-btn {
    background: linear-gradient(135deg, #828282, #929292);
    color: var(--ink);
    font-size: 0.85rem;
    font-weight: 700;
    padding: 9px 20px;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.16);
    white-space: nowrap;
}

.ai-enroll-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16);
}

/* ─── Course Progress Card ─────────────────────────────────────── */

.course-progress-card {
    background: var(--glass);
    border: 1px solid rgba(0, 0, 0, 0.09);
    border-radius: 16px;
    padding: 18px 20px;
}

.cp-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--ink-muted);
    margin-bottom: 8px;
}

.cp-bar-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cp-bar {
    flex: 1;
    height: 8px;
    background: var(--glass-strong);
    border-radius: 4px;
    overflow: hidden;
}

.cp-bar-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, #828282, #a44604);
    transition: width 0.6s ease;
}

.cp-pct {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--ink-soft);
    white-space: nowrap;
}

.cp-stat-num {
    font-size: 1.4rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 2px;
}

.cp-stat-label {
    font-size: 0.7rem;
    color: var(--ink-muted);
}

.cp-next-label {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--ink-muted);
    margin-bottom: 4px;
}

.cp-next-action {
    font-size: 0.8rem;
    font-weight: 600;
    color: #a44604;
    line-height: 1.3;
}

/* ─── Module Status Chips ──────────────────────────────────────── */

.module-status-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.module-status-chip.locked {
    background: var(--glass-strong);
    color: var(--ink-muted);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.module-status-chip.in-progress {
    background: rgba(164, 70, 4, 0.12);
    color: #bd5704;
    border: 1px solid rgba(164, 70, 4, 0.25);
}

.module-status-chip.completed {
    background: rgba(0,184,148,0.12);
    color: #00b894;
    border: 1px solid rgba(0,184,148,0.25);
}

.module-coin-reward {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #986206;
    background: rgba(152, 98, 6, 0.1);
    padding: 3px 9px;
    border-radius: 10px;
    border: 1px solid rgba(152, 98, 6, 0.2);
}

/* ─── Quest Step Modal ─────────────────────────────────────────── */

.quest-step-modal .modal-content {
    background: var(--surface-raised);
    color: var(--ink);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 18px;
}

.quest-step-modal .modal-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.07);
    padding: 16px 20px 12px;
}

.quest-module-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--ink-muted);
    margin-bottom: 4px;
}

.quest-lesson-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.quest-lesson-desc {
    font-size: 0.88rem;
    color: var(--ink-soft);
    line-height: 1.6;
    font-style: italic;
    margin-bottom: 18px;
}

.quest-cta-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #828282, #929292);
    color: var(--ink) !important;
    font-weight: 700;
    font-size: 0.9rem;
    padding: 11px 22px;
    border-radius: 12px;
    text-decoration: none !important;
    border: none;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
    width: fit-content;
    margin-bottom: 20px;
}

.quest-cta-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 7px 20px rgba(0, 0, 0, 0.16);
}

.quest-lesson-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.quest-lesson-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-size: 0.85rem;
}

.quest-lesson-list li:last-child { border-bottom: none; }

.quest-lesson-list li.completed { color: rgba(0,184,148,0.9); }
.quest-lesson-list li.current { color: var(--ink); font-weight: 600; }
.quest-lesson-list li.pending { color: var(--ink-muted); }

.quest-lesson-list .step-icon { font-size: 0.9rem; flex-shrink: 0; }

.quest-lesson-current-badge {
    font-size: 0.65rem;
    background: rgba(164, 70, 4, 0.18);
    color: #bd5704;
    border: 1px solid rgba(164, 70, 4, 0.3);
    padding: 2px 7px;
    border-radius: 8px;
    font-weight: 700;
    margin-left: 4px;
}

.quest-coin-reward-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: rgba(152, 98, 6, 0.08);
    border: 1px solid rgba(152, 98, 6, 0.18);
    border-radius: 10px;
    padding: 10px;
    margin: 16px 0 0;
    font-size: 0.88rem;
    font-weight: 600;
    color: #986206;
}
