/* ===== GAMIFICATION UX STYLES ===== */

/* === LEVEL BADGE STYLES === */
.level-badge {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    background: #007bff;
    color: white;
    font-weight: 600;
    display: inline-block;
    transition: all 0.3s ease;
}

.title-badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    background: #6c757d;
    color: white;
    font-style: italic;
    opacity: 0.9;
    display: inline-block;
    transition: all 0.3s ease;
}

.level-badge:hover,
.title-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.level-info small {
    font-size: 0.75rem;
    color: #6c757d;
    font-style: italic;
}

/* === XP GAIN ANIMATIONS === */
.xp-gain-animation {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    padding: 20px 30px;
    border-radius: 15px;
    font-size: 24px;
    font-weight: bold;
    box-shadow: 0 10px 30px rgba(40, 167, 69, 0.3);
    z-index: 9999;
    animation: xpGainFloat 2s ease-out forwards;
    pointer-events: none;
}

@keyframes xpGainFloat {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
    20% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1);
    }
    80% {
        opacity: 1;
        transform: translate(-50%, -80%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -120%) scale(0.8);
    }
}

.xp-counter {
    transition: all 0.3s ease;
}

.xp-counter.updating {
    animation: xpCounterPulse 0.5s ease-in-out;
}

@keyframes xpCounterPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* === LEVEL UP ANIMATIONS === */
.level-up-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.level-up-modal {
    background: linear-gradient(135deg, #007bff, #6610f2);
    color: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    max-width: 500px;
    animation: levelUpBounce 0.6s ease-out, levelUpPulse 2s ease-in-out infinite;
    box-shadow: 0 20px 60px rgba(0, 123, 255, 0.4);
    border: 3px solid #FFD700;
    position: relative;
    overflow: hidden;
}

.level-up-modal::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: levelUpShine 3s ease-in-out infinite;
}

@keyframes levelUpPulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 20px 60px rgba(0, 123, 255, 0.4);
    }
    50% { 
        transform: scale(1.02);
        box-shadow: 0 25px 80px rgba(0, 123, 255, 0.6);
    }
}

@keyframes levelUpShine {
    0% { left: -100%; }
    50% { left: 100%; }
    100% { left: 100%; }
}

@keyframes levelUpBounce {
    0% {
        opacity: 0;
        transform: scale(0.3) rotate(-10deg);
    }
    50% {
        transform: scale(1.1) rotate(5deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

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

.level-up-icon {
    font-size: 80px;
    margin-bottom: 20px;
    animation: levelUpIconSpin 1s ease-out;
}

@keyframes levelUpIconSpin {
    0% { transform: scale(0) rotate(0deg); }
    50% { transform: scale(1.2) rotate(180deg); }
    100% { transform: scale(1) rotate(360deg); }
}

.level-up-title {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 10px;
    animation: slideInUp 0.5s ease-out 0.2s both;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.level-up-subtitle {
    font-size: 18px;
    opacity: 0.9;
    animation: slideInUp 0.5s ease-out 0.4s both;
    margin-bottom: 20px;
}

.level-up-rewards {
    margin: 20px 0;
    animation: slideInUp 0.5s ease-out 0.6s both;
}

.xp-reward {
    font-size: 24px;
    font-weight: bold;
    color: #FFD700;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    margin-bottom: 10px;
}

.motivation-message {
    font-size: 16px;
    font-style: italic;
    margin: 15px 0;
    color: #E8F4FD;
}

.motivation-message .alert {
    border: none;
    border-radius: 10px;
    font-size: 0.85rem;
    animation: slideInUp 0.5s ease-out;
}
.unlock-message .alert {
    border: none;
    border-radius: 10px;
    font-size: 0.85rem;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
}
.motivation-message .alert-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-left: 4px solid #28a745;
}
.motivation-message .alert i {
    animation: pulse 2s infinite;
}

.rewards-list {
    margin: 20px 0;
    animation: slideInUp 0.5s ease-out 0.8s both;
}

.reward-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 15px;
    margin: 5px 0;
    border-radius: 10px;
    border-left: 3px solid #FFD700;
    font-size: 14px;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === BADGE UNLOCK ANIMATIONS === */
.badge-unlock-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #ffc107, #fd7e14);
    color: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(255, 193, 7, 0.3);
    z-index: 9999;
    animation: badgeSlideIn 0.5s ease-out;
    max-width: 300px;
}

@keyframes badgeSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.badge-unlock-icon {
    font-size: 40px;
    margin-bottom: 10px;
    animation: badgeIconBounce 0.6s ease-out;
}

@keyframes badgeIconBounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* === ACHIEVEMENT ANIMATIONS === */
.achievement-unlock {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.3);
    z-index: 9999;
    animation: achievementSlideUp 0.5s ease-out;
    max-width: 280px;
}

@keyframes achievementSlideUp {
    from {
        opacity: 0;
        transform: translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === STREAK ANIMATIONS === */
.streak-fire {
    animation: streakFire 1s ease-in-out infinite alternate;
}

@keyframes streakFire {
    from { transform: scale(1) rotate(-5deg); }
    to { transform: scale(1.1) rotate(5deg); }
}

.streak-counter {
    transition: all 0.3s ease;
}

.streak-counter.updating {
    animation: streakPulse 0.5s ease-in-out;
}

@keyframes streakPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* === PROGRESS BAR ANIMATIONS === */
.progress-bar-animated {
    transition: width 0.8s ease-in-out;
    background: linear-gradient(90deg, #007bff, #6610f2, #007bff);
    background-size: 200% 100%;
    animation: progressShimmer 2s ease-in-out infinite;
}

@keyframes progressShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* === HOVER EFFECTS === */
.badge-hover-effect {
    transition: all 0.3s ease;
    cursor: pointer;
}

.badge-hover-effect:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.achievement-hover-effect {
    transition: all 0.3s ease;
    cursor: pointer;
}

.achievement-hover-effect:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.card-hover-effect {
    transition: all 0.3s ease;
}

.card-hover-effect:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* === LOADING SPINNERS === */
.gamification-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* === NOTIFICATIONS === */
.gamification-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    animation: notificationSlideDown 0.5s ease-out;
    max-width: 400px;
    border-left: 4px solid #007bff;
}

@keyframes notificationSlideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-100%);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.notification-success {
    border-left-color: #28a745;
}

.notification-warning {
    border-left-color: #ffc107;
}

.notification-error {
    border-left-color: #dc3545;
}

/* === CONFETTI EFFECT === */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9997;
}

.confetti-piece {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #f39c12;
    animation: confettiFall 3s ease-in-out forwards;
}

@keyframes confettiFall {
    0% {
        opacity: 1;
        transform: translateY(-100vh) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: translateY(100vh) rotate(720deg);
    }
}

/* === SOUND CONTROLS === */
.sound-controls {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px;
    border-radius: 10px;
    z-index: 9996;
    display: flex;
    gap: 10px;
    align-items: center;
}

.sound-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.sound-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.sound-toggle.muted {
    opacity: 0.5;
}

/* === ACCESSIBILITY === */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ===== BADGE EARNED ANIMATION ===== */
.badge-earned-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease-out;
}

.badge-earned-modal {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    border: 3px solid;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transform: scale(0.7) translateY(50px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.badge-earned-modal.show {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.badge-earned-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    animation: badgePulse 2s infinite;
}

.badge-earned-icon img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}

.badge-earned-title {
    font-size: 24px;
    font-weight: bold;
    color: white;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.badge-earned-name {
    font-size: 20px;
    font-weight: bold;
    color: #FFD700;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.badge-earned-description {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 15px;
    line-height: 1.4;
}

.badge-earned-xp {
    font-size: 18px;
    font-weight: bold;
    color: #4CAF50;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.badge-earned-category {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.badge-earned-close {
    background: linear-gradient(45deg, #FFD700, #FFA500);
    border: none;
    border-radius: 25px;
    padding: 12px 30px;
    color: white;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.3);
}

.badge-earned-close:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 215, 0, 0.4);
}

/* ===== BADGE RARITY COLORS ===== */
.badge-common { --badge-rarity-color: #2196F3; }
.badge-bronze { --badge-rarity-color: #4CAF50; }
.badge-silver { --badge-rarity-color: #CD7F32; }
.badge-gold { --badge-rarity-color: #C0C0C0; }
.badge-diamond { --badge-rarity-color: #FFD700; }

/* ===== BADGE PROGRESS BAR ===== */
.badge-progress-container {
    margin-top: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    height: 6px;
}

.badge-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--badge-rarity-color), lighten(var(--badge-rarity-color), 20%));
    border-radius: 10px;
    transition: width 0.5s ease;
    position: relative;
    width: 0%;
}

.badge-progress-bar::after {
    content: attr(data-progress);
    position: absolute;
    right: 5px;
    top: -20px;
    font-size: 10px;
    color: white;
    background: rgba(0, 0, 0, 0.7);
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
}

/* ===== BADGE SHOWCASE ===== */
.badge-showcase-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9998;
    animation: fadeIn 0.3s ease-out;
}

.badge-showcase-modal {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    border-radius: 20px;
    max-width: 900px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.badge-showcase-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.badge-showcase-header h3 {
    color: white;
    margin: 0;
    font-size: 24px;
    font-weight: bold;
}

.badge-showcase-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.badge-showcase-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.badge-showcase-content {
    padding: 30px;
}

.badge-showcase-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-item {
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-number {
    display: block;
    font-size: 32px;
    font-weight: bold;
    color: #FFD700;
    margin-bottom: 5px;
}

.stat-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.badge-showcase-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.badge-showcase-item {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.badge-showcase-item.earned {
    border-color: var(--badge-rarity-color);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.badge-showcase-item.locked {
    opacity: 0.6;
    filter: grayscale(1);
}

.badge-showcase-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.badge-showcase-icon {
    position: relative;
    width: 60px;
    height: 60px;
    margin: 0 auto 15px;
    border-radius: 50%;
    background: var(--badge-rarity-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.badge-showcase-icon img {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
}

.badge-earned-check {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #4CAF50;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.badge-showcase-name {
    font-size: 16px;
    font-weight: bold;
    color: white;
    margin-bottom: 5px;
}

.badge-showcase-category {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.badge-showcase-date {
    font-size: 11px;
    color: #4CAF50;
}

.badge-showcase-requirement {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
}

/* ===== ANIMATIONS ===== */
@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

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

@keyframes slideInUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .xp-gain-animation {
        font-size: 18px;
        padding: 15px 20px;
    }
    
    .level-up-modal {
        margin: 20px;
        padding: 30px 20px;
        max-width: 90%;
    }
    
    .level-up-title {
        font-size: 24px;
    }
    
    .level-up-subtitle {
        font-size: 16px;
    }
    
    .level-up-icon {
        font-size: 60px;
    }
    
    .xp-reward {
        font-size: 20px;
    }
    
    .reward-item {
        font-size: 12px;
        padding: 6px 12px;
    }
    
    .badge-unlock-notification,
    .achievement-unlock {
        max-width: calc(100vw - 40px);
        margin: 10px;
    }
    
    .sound-controls {
        bottom: 10px;
        right: 10px;
        padding: 8px;
    }

    .badge-earned-modal {
        padding: 20px;
        max-width: 90%;
    }
    
    .badge-earned-icon {
        width: 60px;
        height: 60px;
    }
    
    .badge-earned-icon img {
        width: 45px;
        height: 45px;
    }
    
    .badge-earned-title {
        font-size: 20px;
    }
    
    .badge-earned-name {
        font-size: 18px;
    }
    
    .badge-showcase-modal {
        width: 98%;
        margin: 10px;
    }
    
    .badge-showcase-content {
        padding: 20px;
    }
    
    .badge-showcase-stats {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .badge-showcase-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .badge-showcase-grid {
        grid-template-columns: 1fr;
    }
    
    .badge-earned-close {
        padding: 10px 25px;
        font-size: 14px;
    }
}

/* ===== BADGE CHALLENGE SYSTEM ===== */
.badge-challenge-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    padding: 20px;
    margin: 20px 0;
    color: white;
}

.badge-challenge-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.badge-challenge-title {
    font-size: 18px;
    font-weight: bold;
    margin: 0;
}

.badge-challenge-timer {
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
}

.badge-challenge-progress {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    height: 8px;
    overflow: hidden;
    margin-bottom: 10px;
}

.badge-challenge-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #FFD700, #FFA500);
    border-radius: 10px;
    transition: width 0.5s ease;
}

.badge-challenge-description {
    font-size: 14px;
    opacity: 0.9;
    line-height: 1.4;
}

/* === DARK MODE SUPPORT === */
@media (prefers-color-scheme: dark) {
    .gamification-notification {
        background: #2d3748;
        color: white;
    }
    
    .loading-content {
        background: #2d3748;
        color: white;
    }
    
    .sound-controls {
        background: rgba(255, 255, 255, 0.1);
    }
}

/* === CUSTOM SCROLLBAR === */
.gamification-scroll {
    scrollbar-width: thin;
    scrollbar-color: #007bff #f8f9fa;
}

.gamification-scroll::-webkit-scrollbar {
    width: 8px;
}

.gamification-scroll::-webkit-scrollbar-track {
    background: #f8f9fa;
    border-radius: 4px;
}

.gamification-scroll::-webkit-scrollbar-thumb {
    background: #007bff;
    border-radius: 4px;
}

.gamification-scroll::-webkit-scrollbar-thumb:hover {
    background: #0056b3;
}

/* === PULSE EFFECTS === */
.pulse-effect {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(0, 123, 255, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 123, 255, 0);
    }
}

/* === GLOW EFFECTS === */
.glow-effect {
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        box-shadow: 0 0 5px #007bff, 0 0 10px #007bff, 0 0 15px #007bff;
    }
    to {
        box-shadow: 0 0 10px #007bff, 0 0 20px #007bff, 0 0 30px #007bff;
    }
}

/* === FADE IN ANIMATIONS === */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

.fade-in-delay-1 {
    animation: fadeIn 0.5s ease-in 0.1s both;
}

.fade-in-delay-2 {
    animation: fadeIn 0.5s ease-in 0.2s both;
}

.fade-in-delay-3 {
    animation: fadeIn 0.5s ease-in 0.3s both;
}

/* === BOUNCE ANIMATIONS === */
.bounce-in {
    animation: bounceIn 0.6s ease-out;
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* === SLIDE ANIMATIONS === */
.slide-in-left {
    animation: slideInLeft 0.5s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-right {
    animation: slideInRight 0.5s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* === ROTATE ANIMATIONS === */
.rotate-in {
    animation: rotateIn 0.6s ease-out;
}

@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-200deg);
    }
    to {
        opacity: 1;
        transform: rotate(0deg);
    }
}

/* === ZOOM ANIMATIONS === */
.zoom-in {
    animation: zoomIn 0.5s ease-out;
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* === FLIP ANIMATIONS === */
.flip-in {
    animation: flipIn 0.6s ease-out;
}

@keyframes flipIn {
    from {
        opacity: 0;
        transform: perspective(400px) rotateY(90deg);
    }
    to {
        opacity: 1;
        transform: perspective(400px) rotateY(0deg);
    }
}

/* === UTILITY CLASSES === */
.text-gradient {
    background: linear-gradient(135deg, #007bff, #6610f2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, #007bff, #6610f2);
}

.bg-gradient-success {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.bg-gradient-warning {
    background: linear-gradient(135deg, #ffc107, #fd7e14);
}

.bg-gradient-danger {
    background: linear-gradient(135deg, #dc3545, #e83e8c);
}

/* === ANIMATION PAUSE ON HOVER === */
.pause-on-hover:hover {
    animation-play-state: paused;
}

/* === PERFORMANCE OPTIMIZATIONS === */
.will-change-transform {
    will-change: transform;
}

.will-change-opacity {
    will-change: opacity;
}

/* === PRINT STYLES === */
@media print {
    .gamification-notification,
    .badge-unlock-notification,
    .achievement-unlock,
    .level-up-overlay,
    .sound-controls {
        display: none !important;
    }
} 

/* ===== CHALLENGE COMPLETED ANIMATION ===== */
.challenge-completed-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease-out;
}

.challenge-completed-modal {
    background: linear-gradient(135deg, #FF6B6B 0%, #FF8E53 100%);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    border: 3px solid #FFD700;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transform: scale(0.7) translateY(50px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.challenge-completed-modal.show {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.challenge-completed-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: #FFD700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    animation: challengePulse 2s infinite;
}

.challenge-completed-title {
    font-size: 24px;
    font-weight: bold;
    color: white;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.challenge-completed-name {
    font-size: 20px;
    font-weight: bold;
    color: #FFD700;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.challenge-completed-description {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 15px;
    line-height: 1.4;
}

.challenge-completed-reward {
    font-size: 18px;
    font-weight: bold;
    color: #4CAF50;
    margin-bottom: 20px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.challenge-completed-close {
    background: linear-gradient(45deg, #FFD700, #FFA500);
    border: none;
    border-radius: 25px;
    padding: 12px 30px;
    color: white;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.3);
}

.challenge-completed-close:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 215, 0, 0.4);
}

@keyframes challengePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
} 