

/* ============================================================================
   GAMIFICATION - STYLES CSS
   ============================================================================ */

/* ===== ANIMATIONS GÉNÉRALES ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px currentColor;
    }
    50% {
        box-shadow: 0 0 20px currentColor, 0 0 30px currentColor;
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes confettiFall {
    to {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

@keyframes sparkle {
    0%, 100% {
        opacity: 0;
        transform: scale(0);
    }
    50% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* ===== DASHBOARD GAMIFICATION ===== */
#gamificationDashboard {
    display: grid;
    gap: 20px;
    margin-bottom: 30px;
}

.gamification-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 6px var(--shadow);
    animation: fadeInUp 0.5s ease;
}

/* Carte de niveau */
.level-card {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-tertiary) 100%);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.level-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    transform: rotate(45deg);
    animation: shine 3s infinite;
}

@keyframes shine {
    0%, 100% {
        transform: translateX(-100%) rotate(45deg);
    }
    50% {
        transform: translateX(100%) rotate(45deg);
    }
}

.level-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.level-icon-big {
    font-size: 4em;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
    animation: pulse 2s infinite;
}

.level-info {
    flex: 1;
}

.level-number {
    font-size: 1.2em;
    color: var(--text-secondary);
    font-weight: 600;
}

.level-title {
    font-size: 1.8em;
    font-weight: bold;
    margin-top: 5px;
}

.xp-progress {
    margin-top: 15px;
}

.xp-bar-container {
    height: 30px;
    background: var(--bg-tertiary);
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    border: 2px solid var(--border-color);
}

.xp-bar {
    height: 100%;
    background: linear-gradient(90deg, #4A90E2, #9B59B6, #E74C3C);
    border-radius: 15px;
    transition: width 0.5s ease;
    position: relative;
    overflow: hidden;
}

.xp-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

.xp-text {
    margin-top: 10px;
    text-align: center;
    font-weight: 600;
    color: var(--text-primary);
}

.xp-remaining {
    color: var(--text-tertiary);
    font-size: 0.9em;
}

.max-level {
    text-align: center;
    font-size: 1.5em;
    font-weight: bold;
    color: #FFD700;
    padding: 20px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 165, 0, 0.1));
    border-radius: 10px;
    animation: pulse 2s infinite;
}

/* Stats rapides */
.gamification-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
}

.stat-card-small {
    background: var(--bg-card);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 4px var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
}

.stat-card-small:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px var(--shadow);
}

.stat-icon {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 2em;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.85em;
    color: var(--text-tertiary);
}

/* Objectifs */
.objectives-container {
    display: grid;
    gap: 20px;
}

.objective-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px var(--shadow);
}

.objective-card h3 {
    margin-bottom: 15px;
    font-size: 1.3em;
}

.objective-monthly {
    border-left: 4px solid #3498db;
}

.objective-final {
    border-left: 4px solid #FFD700;
    background: linear-gradient(135deg, var(--bg-card), rgba(255, 215, 0, 0.05));
}

.objective-progress {
    height: 25px;
    background: var(--bg-tertiary);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 10px;
    border: 2px solid var(--border-color);
}

.objective-bar {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    border-radius: 12px;
    transition: width 0.5s ease;
}

.objective-bar-gold {
    background: linear-gradient(90deg, #FFD700, #FFA500, #FF6347);
}

.objective-text {
    font-weight: 600;
    color: var(--text-primary);
}

.objective-amount {
    margin-top: 8px;
    font-size: 1.2em;
    font-weight: bold;
    color: #FFD700;
}

/* Actions */
.gamification-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.gamification-actions .btn {
    padding: 15px;
    font-size: 1em;
    font-weight: 600;
}

/* ===== NOTIFICATIONS ===== */

/* Notification XP */
.xp-notification {
    position: fixed;
    top: 80px;
    right: -300px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    transition: right 0.3s ease;
}

.xp-notification.show {
    right: 20px;
    animation: slideInRight 0.3s ease;
}

.xp-amount {
    font-size: 1.5em;
    font-weight: bold;
    margin-bottom: 5px;
}

.xp-reason {
    font-size: 0.9em;
    opacity: 0.9;
}

/* Notification Badge */
.badge-notification {
    position: fixed;
    top: 80px;
    right: -400px;
    background: var(--bg-card);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    transition: right 0.3s ease;
    min-width: 300px;
    border: 3px solid;
}

.badge-notification.show {
    right: 20px;
    animation: slideInRight 0.3s ease, pulse 0.5s ease 0.3s;
}

.badge-notification-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.badge-icon {
    font-size: 3em;
    filter: drop-shadow(0 0 10px currentColor);
}

.badge-unlock-title {
    font-size: 0.9em;
    color: var(--text-tertiary);
    margin-bottom: 5px;
}

.badge-name {
    font-size: 1.3em;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.badge-rarity {
    font-size: 0.85em;
    font-weight: 600;
}

/* Badges par rareté */
.badge-common {
    border-color: #95a5a6;
}

.badge-uncommon {
    border-color: #27ae60;
}

.badge-rare {
    border-color: #3498db;
    animation: glow 2s infinite;
}

.badge-epic {
    border-color: #9b59b6;
    animation: glow 2s infinite;
}

.badge-legendary {
    border-color: #f39c12;
    animation: glow 2s infinite;
}

.badge-mythic {
    border-color: #e74c3c;
    animation: glow 2s infinite;
}

/* Notification Challenge */
.challenge-notification {
    position: fixed;
    top: 80px;
    right: -400px;
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    transition: right 0.3s ease;
    min-width: 300px;
}

.challenge-notification.show {
    right: 20px;
    animation: slideInRight 0.3s ease;
}

.challenge-notification-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.challenge-icon {
    font-size: 2.5em;
}

.challenge-complete-title {
    font-size: 0.9em;
    opacity: 0.9;
    margin-bottom: 5px;
}

.challenge-name {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 5px;
}

.challenge-reward {
    font-size: 1em;
    font-weight: 600;
}

/* Notification générique */
.game-notification {
    position: fixed;
    top: 80px;
    right: -400px;
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    transition: right 0.3s ease;
    color: white;
    font-weight: 600;
}

.game-notification.show {
    right: 20px;
}

.game-notification-info {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.game-notification-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.game-notification-warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

/* ===== MODALES ===== */

/* Modal Level Up */
.level-up-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.level-up-modal.show {
    opacity: 1;
}

.level-up-content {
    background: var(--bg-card);
    padding: 50px;
    border-radius: 20px;
    text-align: center;
    max-width: 500px;
    animation: fadeInScale 0.5s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.level-up-icon {
    font-size: 5em;
    margin-bottom: 20px;
    animation: pulse 1s infinite;
}

.level-up-title {
    font-size: 2.5em;
    font-weight: bold;
    margin-bottom: 20px;
    background: linear-gradient(90deg, #FFD700, #FFA500);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.level-up-level {
    font-size: 3em;
    font-weight: bold;
    margin-bottom: 10px;
}

.level-up-name {
    font-size: 1.5em;
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.level-up-btn {
    padding: 15px 40px;
    font-size: 1.2em;
}

/* Modal Récompense */
.reward-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.reward-modal.show {
    opacity: 1;
}

.reward-content {
    background: var(--bg-card);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    max-width: 500px;
    animation: fadeInScale 0.5s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.reward-icon {
    font-size: 5em;
    margin-bottom: 20px;
}

.reward-title {
    font-size: 2em;
    font-weight: bold;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.reward-name {
    font-size: 1.5em;
    font-weight: bold;
    color: #FFD700;
    margin-bottom: 15px;
}

.reward-description {
    font-size: 1.1em;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.reward-cost {
    font-size: 1.2em;
    font-weight: 600;
    color: #27ae60;
    margin-bottom: 30px;
}

/* Modal Gamification générale */
.gamification-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gamification-modal.show {
    opacity: 1;
}

.gamification-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
}

.gamification-modal-dialog {
    position: relative;
    background: var(--bg-card);
    border-radius: 15px;
    max-width: 900px;
    max-height: 80vh;
    width: 90%;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: fadeInScale 0.3s ease;
}

.gamification-modal-header {
    padding: 25px;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gamification-modal-header h2 {
    margin: 0;
    font-size: 1.8em;
    color: var(--text-primary);
}

.gamification-modal-close {
    background: none;
    border: none;
    font-size: 2em;
    color: var(--text-tertiary);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
}

.gamification-modal-close:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

.gamification-modal-body {
    padding: 25px;
    overflow-y: auto;
    flex: 1;
}

/* ===== BADGES MODAL ===== */
.badges-modal-content {
    padding: 10px;
}

.badge-rarity-section {
    margin-bottom: 30px;
}

.badge-rarity-section h3 {
    margin-bottom: 20px;
    font-size: 1.5em;
    padding-bottom: 10px;
    border-bottom: 2px solid currentColor;
}

.badges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.badge-item {
    background: var(--bg-tertiary);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    border: 3px solid;
    transition: all 0.3s;
}

.badge-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px var(--shadow);
}

.badge-unlocked {
    cursor: pointer;
}

.badge-locked {
    opacity: 0.5;
    filter: grayscale(100%);
}

.badge-item-icon {
    font-size: 3em;
    margin-bottom: 10px;
}

.badge-item-name {
    font-weight: bold;
    font-size: 1.1em;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.badge-item-desc {
    font-size: 0.85em;
    color: var(--text-secondary);
}

/* ===== CHALLENGES MODAL ===== */
.challenges-modal-content {
    padding: 10px;
}

.challenge-section {
    margin-bottom: 30px;
}

.challenge-section h3 {
    margin-bottom: 20px;
    font-size: 1.5em;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

.challenges-list {
    display: grid;
    gap: 15px;
}

.challenge-item {
    background: var(--bg-tertiary);
    border-radius: 10px;
    padding: 20px;
    display: flex;
    gap: 15px;
    border-left: 4px solid #3498db;
    transition: all 0.3s;
}

.challenge-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 15px var(--shadow);
}

.challenge-completed {
    background: linear-gradient(135deg, rgba(39, 174, 96, 0.1), rgba(46, 204, 113, 0.1));
    border-left-color: #27ae60;
}

.challenge-special {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 165, 0, 0.1));
    border-left-color: #FFD700;
    animation: glow 2s infinite;
}

.challenge-item-icon {
    font-size: 3em;
    flex-shrink: 0;
}

.challenge-item-info {
    flex: 1;
}

.challenge-item-name {
    font-size: 1.2em;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.challenge-item-desc {
    font-size: 0.95em;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.challenge-item-progress {
    margin-bottom: 10px;
}

.challenge-progress-bar {
    height: 20px;
    background: var(--bg-secondary);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 8px;
    border: 1px solid var(--border-color);
}

.challenge-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    border-radius: 10px;
    transition: width 0.5s ease;
}

.challenge-completed .challenge-progress-fill {
    background: linear-gradient(90deg, #27ae60, #2ecc71);
}

.challenge-progress-text {
    font-size: 0.9em;
    font-weight: 600;
    color: var(--text-primary);
}

.challenge-item-reward {
    font-size: 0.9em;
    color: #f39c12;
    font-weight: 600;
}

/* ===== REWARDS MODAL ===== */
.rewards-modal-content {
    padding: 10px;
}

.rewards-intro {
    text-align: center;
    font-size: 1.1em;
    color: var(--text-secondary);
    margin-bottom: 30px;
    padding: 15px;
    background: var(--bg-tertiary);
    border-radius: 10px;
}

.reward-item {
    background: var(--bg-tertiary);
    border-radius: 10px;
    padding: 20px;
    display: flex;
    gap: 20px;
    align-items: center;
    margin-bottom: 15px;
    border: 2px solid var(--border-color);
    transition: all 0.3s;
}

.reward-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 15px var(--shadow);
}

.reward-unlocked {
    border-color: #27ae60;
    background: linear-gradient(135deg, var(--bg-tertiary), rgba(39, 174, 96, 0.1));
}

.reward-soon {
    border-color: #f39c12;
    background: linear-gradient(135deg, var(--bg-tertiary), rgba(243, 156, 18, 0.1));
}

.reward-locked {
    opacity: 0.5;
    filter: grayscale(100%);
}

.reward-item-icon {
    font-size: 3em;
    flex-shrink: 0;
}

.reward-item-info {
    flex: 1;
}

.reward-item-name {
    font-size: 1.3em;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.reward-item-desc {
    font-size: 1em;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.reward-item-cost {
    font-size: 1.1em;
    font-weight: 600;
    color: #27ae60;
}

.reward-soon-text {
    font-size: 0.95em;
    font-weight: 600;
    color: #f39c12;
}

.reward-item-level {
    font-size: 1.2em;
    font-weight: bold;
    color: var(--text-tertiary);
    padding: 10px 15px;
    background: var(--bg-secondary);
    border-radius: 8px;
}

/* ===== STATS MODAL ===== */
.stats-modal-content {
    padding: 10px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-item-big {
    background: var(--bg-tertiary);
    border-radius: 10px;
    padding: 25px;
    text-align: center;
    border: 2px solid var(--border-color);
    transition: all 0.3s;
}

.stat-item-big:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px var(--shadow);
    border-color: #3498db;
}

.stat-icon-big {
    font-size: 3em;
    margin-bottom: 15px;
}

.stat-value-big {
    font-size: 2.5em;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.stat-label-big {
    font-size: 0.95em;
    color: var(--text-secondary);
    font-weight: 600;
}

/* ===== CONFETTIS ===== */
.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    z-index: 10001;
    top: -10px;
    animation: confettiFall 3s linear forwards;
    pointer-events: none;
}

/* ===== SPARKLES ===== */
.sparkle {
    position: fixed;
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    z-index: 10001;
    animation: sparkle 1s ease-out forwards;
    pointer-events: none;
    box-shadow: 0 0 10px white;
}

/* ===== WIDGET HEADER ===== */
.gamification-header-widget {
    display: flex;
    align-items: center;
    gap: 15px;
    background: var(--bg-tertiary);
    padding: 8px 15px;
    border-radius: 20px;
    margin-right: 15px;
}

.widget-level {
    font-weight: bold;
    font-size: 1em;
    white-space: nowrap;
}

.widget-xp-bar {
    width: 100px;
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.widget-xp-fill {
    height: 100%;
    background: linear-gradient(90deg, #4A90E2, #9B59B6);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.widget-streak {
    font-weight: 600;
    font-size: 1em;
}

/* ===== RESPONSIVE MOBILE ===== */
@media (max-width: 768px) {
    .gamification-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .gamification-actions {
        grid-template-columns: 1fr;
    }

    .level-icon-big {
        font-size: 3em;
    }

    .level-title {
        font-size: 1.3em;
    }

    .xp-notification,
    .badge-notification,
    .challenge-notification {
        min-width: auto;
        max-width: calc(100% - 40px);
        right: -100%;
    }

    .xp-notification.show,
    .badge-notification.show,
    .challenge-notification.show {
        right: 10px;
    }

    .gamification-modal-dialog {
        width: 95%;
        max-height: 90vh;
    }

    .badges-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .level-up-content {
        padding: 30px 20px;
        max-width: 90%;
    }

    .level-up-icon {
        font-size: 3.5em;
    }

    .level-up-title {
        font-size: 2em;
    }

    .level-up-level {
        font-size: 2.2em;
    }

    .reward-content {
        padding: 25px 20px;
        max-width: 90%;
    }

    .reward-icon {
        font-size: 3.5em;
    }

    .reward-title {
        font-size: 1.5em;
    }

    .gamification-header-widget {
        padding: 6px 12px;
        gap: 10px;
    }

    .widget-xp-bar {
        width: 60px;
    }

    .widget-level,
    .widget-streak {
        font-size: 0.9em;
    }

    .challenge-item {
        flex-direction: column;
        text-align: center;
    }

    .challenge-item-icon {
        font-size: 2.5em;
    }

    .reward-item {
        flex-direction: column;
        text-align: center;
    }

    .badge-item-icon {
        font-size: 2.5em;
    }
}

/* ===== DARK MODE ADJUSTMENTS ===== */
[data-theme="dark"] .level-card {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-header) 100%);
}

[data-theme="dark"] .gamification-card {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .stat-card-small:hover {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] .xp-bar-container,
[data-theme="dark"] .objective-progress,
[data-theme="dark"] .challenge-progress-bar {
    background: #1a1a1a;
    border-color: #404040;
}

[data-theme="dark"] .confetti {
    opacity: 0.8;
}

[data-theme="dark"] .sparkle {
    opacity: 0.6;
}

/* ===== ANIMATIONS SUPPLÉMENTAIRES ===== */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.level-icon-big.animate-float {
    animation: float 3s ease-in-out infinite;
}

/* Effet de brillance pour les éléments légendaires */
.legendary-glow {
    position: relative;
    overflow: hidden;
}

.legendary-glow::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
            45deg,
            transparent,
            rgba(255, 215, 0, 0.1),
            transparent
    );
    animation: legendary-shine 3s linear infinite;
}

@keyframes legendary-shine {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

/* Effet de pulsation pour les objectifs */
.objective-final {
    animation: gentle-pulse 3s ease-in-out infinite;
}

@keyframes gentle-pulse {
    0%, 100% {
        box-shadow: 0 4px 6px var(--shadow);
    }
    50% {
        box-shadow: 0 4px 20px rgba(255, 215, 0, 0.3);
    }
}

/* Scrollbar personnalisée pour les modales */
.gamification-modal-body::-webkit-scrollbar {
    width: 10px;
}

.gamification-modal-body::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 5px;
}

.gamification-modal-body::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 5px;
}

.gamification-modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* États de chargement */
.loading-shimmer {
    background: linear-gradient(
            90deg,
            var(--bg-tertiary) 0%,
            var(--bg-secondary) 50%,
            var(--bg-tertiary) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* Effet hover pour les cartes interactives */
.interactive-card {
    cursor: pointer;
    transition: all 0.3s ease;
}

.interactive-card:hover {
    transform: translateY(-3px) scale(1.02);
}

.interactive-card:active {
    transform: translateY(0) scale(0.98);
}

/* Effet de completion pour les challenges */
.challenge-complete-effect {
    animation: complete-bounce 0.6s ease;
}

@keyframes complete-bounce {
    0%, 100% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.1);
    }
    50% {
        transform: scale(0.95);
    }
    75% {
        transform: scale(1.05);
    }
}

/* Barre de streak avec flammes */
.streak-fire {
    position: relative;
    display: inline-block;
}

.streak-fire::before {
    content: '🔥';
    position: absolute;
    left: -25px;
    animation: flicker 1s ease-in-out infinite;
}

@keyframes flicker {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.1);
    }
}

/* Effet de déblocage progressif */
.unlock-reveal {
    animation: unlock-reveal 0.8s ease forwards;
}

@keyframes unlock-reveal {
    0% {
        opacity: 0;
        filter: blur(10px) grayscale(100%);
        transform: scale(0.8);
    }
    50% {
        filter: blur(5px) grayscale(50%);
    }
    100% {
        opacity: 1;
        filter: blur(0) grayscale(0%);
        transform: scale(1);
    }
}

/* Animation de compteur qui monte */
.counter-animation {
    animation: counter-up 1s ease;
}

@keyframes counter-up {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Effet de progression qui se remplit */
.progress-fill-animation {
    animation: progress-fill 1s ease-in-out;
}

@keyframes progress-fill {
    from {
        width: 0;
    }
}

/* Ajustements pour très petits écrans */
@media (max-width: 480px) {
    .gamification-modal-header {
        padding: 15px;
    }

    .gamification-modal-body {
        padding: 15px;
    }

    .gamification-modal-header h2 {
        font-size: 1.3em;
    }

    .level-up-content {
        padding: 20px 15px;
    }

    .level-up-icon {
        font-size: 3em;
    }

    .level-up-title {
        font-size: 1.8em;
    }

    .level-up-level {
        font-size: 2em;
    }

    .level-up-name {
        font-size: 1.2em;
    }

    .badges-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }

    .badge-item {
        padding: 15px;
    }

    .badge-item-icon {
        font-size: 2em;
    }

    .badge-item-name {
        font-size: 0.95em;
    }

    .badge-item-desc {
        font-size: 0.75em;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-item-big {
        padding: 20px;
    }

    .stat-icon-big {
        font-size: 2.5em;
    }

    .stat-value-big {
        font-size: 2em;
    }

    .gamification-header-widget {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* Print styles (masquer la gamification lors de l'impression) */
@media print {
    .gamification-card,
    .gamification-actions,
    .xp-notification,
    .badge-notification,
    .challenge-notification,
    .level-up-modal,
    .reward-modal,
    .gamification-modal,
    .confetti,
    .sparkle,
    .gamification-header-widget {
        display: none !important;
    }
}

/* Accessibilité - mode réduit de mouvement */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}