/* public/css/gamification.css - Gamification & RPG Styling */

/* Student Hero RPG Profile Card */
.rpg-profile-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem 1.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    box-shadow: var(--card-shadow);
    margin-bottom: 1.75rem;
    position: relative;
    overflow: hidden;
}

[data-theme="cyber-dark"] .rpg-profile-card {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.9) 0%, rgba(17, 24, 39, 0.95) 100%);
    border-color: rgba(99, 102, 241, 0.3);
}

[data-theme="aurora-light"] .rpg-profile-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-color: #e2e8f0;
}

[data-theme="emerald-light"] .rpg-profile-card {
    background: linear-gradient(135deg, #ffffff 0%, #ecfdf5 100%);
    border-color: #a7f3d0;
}

[data-theme="sunset-warm"] .rpg-profile-card {
    background: linear-gradient(135deg, #ffffff 0%, #fff7ed 100%);
    border-color: #fed7aa;
}

[data-theme="neon-synth"] .rpg-profile-card {
    background: linear-gradient(135deg, #191233 0%, #241a49 100%);
    border-color: rgba(168, 85, 247, 0.4);
}

[data-theme="aqua-frost"] .rpg-profile-card {
    background: linear-gradient(135deg, #ffffff 0%, #ecfeff 100%);
    border-color: #67e8f9;
}

.rpg-avatar-box {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.rpg-avatar {
    width: 68px;
    height: 68px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #4f46e5, #06b6d4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 800;
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.4);
}

.rpg-level-badge {
    position: absolute;
    bottom: -8px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 0.15rem 0.55rem;
    border-radius: var(--radius-full);
    border: 2px solid var(--bg-surface);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    text-transform: uppercase;
    white-space: nowrap;
}

.rpg-info {
    flex: 1;
    min-width: 0;
}

.rpg-title-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.2rem;
    flex-wrap: wrap;
}

.rpg-user-name {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-main);
}

.rpg-rank-title {
    font-size: 0.82rem;
    color: var(--accent-cyan);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* XP Progress Bar */
.xp-bar-container {
    margin-top: 0.65rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.xp-bar-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
}

.xp-track {
    width: 100%;
    height: 10px;
    background: var(--bg-surface-elevated);
    border-radius: var(--radius-full);
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border-color);
}

.xp-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent-cyan), var(--accent-emerald));
    border-radius: var(--radius-full);
    transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    box-shadow: 0 0 12px var(--primary-glow);
}

/* Streak & Quick Badges in Header */
.rpg-stats-group {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-shrink: 0;
}

.streak-pill {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.35);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    color: #d97706;
}

.streak-flame {
    font-size: 1.5rem;
}

.streak-count {
    font-size: 1.2rem;
    font-weight: 800;
    line-height: 1;
    color: var(--text-main);
}

.streak-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--text-dim);
}

/* Learning Path Node Map */
.learning-path-wrapper {
    margin: 1.25rem 0;
}

.chapter-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    box-shadow: var(--card-shadow);
}

.chapter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.85rem;
}

.chapter-title-group h3 {
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-main);
}

.topic-timeline {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    position: relative;
}

.topic-node-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    position: relative;
    z-index: 2;
    transition: all var(--transition-fast);
    gap: 1rem;
}

.topic-node-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--card-shadow);
}

.topic-node-card.locked {
    opacity: 0.55;
    filter: grayscale(0.7);
    cursor: not-allowed;
}

.node-bullet {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--bg-surface);
    border: 2px solid var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
    flex-shrink: 0;
}

.topic-node-card.completed .node-bullet {
    background: var(--accent-emerald);
    border-color: var(--accent-emerald);
    color: #fff;
}

.node-info {
    flex: 1;
    min-width: 0;
}

.node-info h4 {
    font-size: 1.05rem;
    margin-bottom: 0.2rem;
    color: var(--text-main);
}

.node-info p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.node-badges {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.4rem;
    flex-wrap: wrap;
}

/* Badge Trophy Grid */
.badge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.25rem;
}

.badge-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    transition: all var(--transition-fast);
    box-shadow: var(--card-shadow);
}

.badge-card.unlocked {
    border-color: rgba(245, 158, 11, 0.5);
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.15);
}

.badge-card.locked {
    opacity: 0.45;
    filter: grayscale(1);
}

.badge-card-icon {
    font-size: 3rem;
    margin-bottom: 0.25rem;
}

.badge-card-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
}

.badge-card-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* Mission Checklist */
.mission-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--card-shadow);
}

.mission-task-list {
    margin: 1rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.mission-task-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.92rem;
    color: var(--text-muted);
}

.mission-task-item.completed {
    color: var(--accent-emerald);
    font-weight: 600;
}

.task-check-box {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.mission-task-item.completed .task-check-box {
    background: var(--accent-emerald);
    border-color: var(--accent-emerald);
    color: #fff;
}

/* =========================================================================
   STUDENT ULTRA-INTUITIVE REDESIGN & CHILD-FRIENDLY ROADMAP
   ========================================================================= */
.student-quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.student-action-card {
    background: var(--bg-surface);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1rem;
    box-shadow: var(--card-shadow);
    transition: all var(--transition-normal);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.student-action-card:hover {
    transform: translateY(-4px);
    border-color: var(--card-accent, var(--primary));
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.15);
}

.student-action-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 100%;
    background: var(--card-accent, var(--primary));
}

.student-action-icon {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    background: var(--card-bg, rgba(99, 102, 241, 0.12));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.7rem;
}

.student-action-title {
    font-size: 1.08rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 0.35rem 0 0.15rem 0;
}

.student-action-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.45;
    margin: 0;
}

.roadmap-step-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
}

.roadmap-step-badge.done {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.3);
    color: var(--accent-emerald);
}

.roadmap-step-badge.current {
    background: rgba(99, 102, 241, 0.12);
    border-color: var(--primary);
    color: var(--primary-light);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); }
    70% { box-shadow: 0 0 0 8px rgba(99, 102, 241, 0); }
    100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
}

@media (max-width: 768px) {
    .rpg-profile-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.25rem;
        padding: 1.25rem;
    }
    .rpg-stats-group {
        width: 100%;
        justify-content: space-between;
    }
    .student-quick-grid {
        grid-template-columns: 1fr;
    }
    .topic-node-card {
        flex-direction: column;
        align-items: stretch;
        gap: 0.85rem;
        padding: 1rem;
    }
    .topic-node-card .btn {
        width: 100%;
        margin-top: 0.25rem;
    }
    .chapter-accordion-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.75rem;
    }
    .chapter-accordion-content {
        padding: 1rem 0.75rem !important;
    }
}

