/* XP/Points System Styles */

.xp-display {
    display: none !important;
}

.xp-display.collapsed {
    transform: translateX(calc(100% - 60px));
}

.xp-toggle {
    display: none !important;
}

.xp-level-display {
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 16px 16px 0 0;
    text-align: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.level-info {
    margin-bottom: 16px;
}

.current-level {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 4px;
}

.level-title {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.xp-progress-container {
    margin-top: 16px;
}

.xp-progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.xp-progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    transition: width 0.5s ease;
    position: relative;
    overflow: hidden;
}

.xp-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.xp-text {
    font-size: 0.8rem;
    color: #666;
    text-align: center;
}

.xp-text .current-xp,
.xp-text .required-xp {
    font-weight: 600;
    color: #2c3e50;
}

.xp-stats {
    display: flex;
    justify-content: space-around;
    padding: 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.stat-item {
    text-align: center;
    flex: 1;
}

.stat-label {
    display: block;
    font-size: 0.7rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.stat-value {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    color: #667eea;
}

.xp-level-progression {
    padding: 20px;
}

.xp-level-progression h3 {
    margin: 0 0 16px 0;
    font-size: 1.1rem;
    color: #2c3e50;
    text-align: center;
}

.level-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.level-item {
    padding: 12px 8px;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: center;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    cursor: pointer;
}

.level-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.level-item.completed {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-color: #27ae60;
}

.level-item.current {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.level-number {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.level-item.completed .level-number,
.level-item.current .level-number {
    opacity: 0.9;
}

.level-title {
    font-size: 0.6rem;
    font-weight: 500;
    line-height: 1.1;
    margin-bottom: 2px;
}

.level-xp {
    font-size: 0.7rem;
    opacity: 0.8;
}

.level-item.completed .level-xp,
.level-item.current .level-xp {
    opacity: 1;
}

/* XP Gain Notifications */
.xp-gain-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: white;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(46, 204, 113, 0.3);
    transform: translateY(-20px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1001;
    font-weight: 600;
}

.xp-gain-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.xp-plus {
    font-size: 1.2rem;
    font-weight: 700;
}

.xp-amount {
    font-size: 1.1rem;
    min-width: 80px;
}

.xp-source {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Level Up Notifications */
.level-up-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #f39c12 0%, #e74c3c 100%);
    color: white;
    padding: 24px 32px;
    border-radius: 16px;
    box-shadow: 0 12px 32px rgba(243, 156, 18, 0.3);
    transform: translate(-50%, -50%) scale(0.9);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1002;
    text-align: center;
    max-width: 400px;
}

.level-up-content {
    position: relative;
}

.level-up-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 16px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.level-up-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    font-size: 1.1rem;
}

.level-up-reward {
    font-size: 0.9rem;
    opacity: 0.9;
    font-style: italic;
}

/* Confetti Animation */
.confetti {
    position: fixed;
    width: 8px;
    height: 8px;
    background: #ff6b6b;
    pointer-events: none;
    border-radius: 50%;
    z-index: 1003;
    animation: confetti-fall 3s ease-out forwards;
}

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

/* Mobile Responsive */
@media (max-width: 768px) {
    .xp-display {
        width: calc(100vw - 40px);
        right: 20px;
        left: 20px;
        top: auto;
        bottom: 20px;
        max-height: 50vh;
    }

    .xp-display.collapsed {
        transform: translateY(calc(100% - 60px));
    }

    .xp-toggle {
        left: auto;
        right: -40px;
        top: 50%;
        transform: translateY(-50%);
    }

    .xp-stats {
        flex-direction: column;
        gap: 12px;
    }

    .level-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }

    .level-item {
        padding: 8px 6px;
    }

    .level-title {
        font-size: 0.5rem;
    }

    .level-xp {
        font-size: 0.6rem;
    }
}

@media (max-width: 480px) {
    .xp-display {
        width: calc(100vw - 20px);
        right: 10px;
        left: 10px;
        bottom: 10px;
    }

    .xp-toggle {
        width: 30px;
        right: -30px;
    }

    .xp-level-display {
        padding: 16px;
    }

    .current-level {
        font-size: 1.2rem;
    }

    .level-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 4px;
    }

    .level-item {
        padding: 6px 4px;
    }

    .xp-gain-notification {
        right: 10px;
        left: 10px;
        max-width: none;
    }

    .level-up-notification {
        max-width: calc(100vw - 40px);
        padding: 20px;
    }
}

/* Accessibility Enhancements */
@media (prefers-reduced-motion: reduce) {
    .xp-progress-fill,
    .xp-gain-notification,
    .level-up-notification,
    .confetti {
        animation: none;
        transition: none;
    }

    .level-item,
    .xp-toggle {
        transition: none;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .xp-display {
        border: 2px solid #000;
    }

    .level-item.current {
        border-color: #000;
    }

    .xp-gain-notification {
        border: 2px solid #000;
    }

    .level-up-notification {
        border: 2px solid #000;
    }
}

/* Print Styles */
@media print {
    .xp-display,
    .xp-gain-notification,
    .level-up-notification,
    .confetti {
        display: none;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .xp-display {
        background: #1a1a1a;
        color: #ffffff;
        border: 1px solid #333;
    }

    .xp-level-display {
        background: linear-gradient(135deg, #2d2d2d 0%, #3a3a3a 100%);
    }

    .level-item {
        background: #2d2d2d;
        border-color: #444;
    }

    .level-item.completed {
        background: linear-gradient(135deg, #1e3a1e 0%, #2d4a2d 100%);
        border-color: #4ade80;
    }

    .stat-label,
    .xp-text,
    .xp-level-progression h3 {
        color: #ccc;
    }

    .stat-value {
        color: #818cf8;
    }
}