/* Level Widget Styles */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Rajdhani:wght@400;600;700&display=swap');

.level-widget {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
    border: 2px solid rgba(99, 102, 241, 0.3);
    border-radius: 12px;
    padding: 16px;
    margin: 16px 0;
}

.level-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.level-badge {
    font-size: 48px;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.level-info {
    flex: 1;
}

.level-number {
    font-size: 24px;
    font-weight: bold;
    color: #6366f1;
    line-height: 1.2;
}

.level-title {
    font-size: 14px;
    color: #8b5cf6;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.level-progress-container {
    margin-bottom: 8px;
}

.level-progress-bar {
    height: 24px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.level-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    border-radius: 12px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

.level-progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    font-weight: bold;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

.level-xp-needed {
    text-align: center;
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

/* ============ LEVEL UP MODAL ============ */

.level-up-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 10, 30, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 11000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.level-up-modal.show {
    opacity: 1;
}

.level-up-content {
    background: linear-gradient(135deg, rgba(10, 30, 60, 0.95) 0%, rgba(5, 20, 45, 0.98) 100%);
    border-radius: 24px;
    padding: 32px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    border: 2px solid rgba(0, 200, 255, 0.6);
    box-shadow: 0 0 60px rgba(0, 150, 255, 0.4);
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.level-up-modal.show .level-up-content {
    transform: scale(1);
}

.level-up-content.milestone {
    border-color: rgba(255, 215, 0, 0.8);
    box-shadow: 0 0 80px rgba(255, 215, 0, 0.5);
}

.level-up-animation {
    position: relative;
    margin-bottom: 20px;
}

.level-up-rays {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200px;
    height: 200px;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(0, 200, 255, 0.3) 0%, transparent 70%);
    animation: raysRotate 3s linear infinite;
}

@keyframes raysRotate {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.level-up-badge-container {
    position: relative;
    z-index: 1;
}

.level-up-badge {
    font-size: 4em;
    display: block;
    animation: badgeBounce 0.5s ease;
}

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

.level-up-title {
    font-size: 1.8em;
    color: #00d4ff;
    font-family: 'Orbitron', sans-serif;
    margin-bottom: 16px;
    text-shadow: 0 0 20px rgba(0, 200, 255, 0.6);
}

.level-up-levels {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
    font-family: 'Orbitron', sans-serif;
}

.old-level {
    font-size: 2em;
    color: rgba(150, 180, 200, 0.6);
}

.level-arrow {
    font-size: 1.5em;
    color: #00d4ff;
}

.new-level {
    font-size: 2.5em;
    color: #00d4ff;
    text-shadow: 0 0 15px rgba(0, 200, 255, 0.8);
}

.level-up-new-title {
    font-size: 1.2em;
    color: #ffd700;
    font-family: 'Rajdhani', sans-serif;
    margin-bottom: 12px;
}

.level-up-milestone-badge {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #1a1a1a;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
    margin-bottom: 16px;
    display: inline-block;
    font-family: 'Orbitron', sans-serif;
}

.level-up-reward {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 1.2em;
    color: #ffd700;
}

.reward-icon {
    font-size: 1.5em;
}

.level-up-close {
    background: linear-gradient(145deg, #00a8ff 0%, #0066cc 100%);
    border: none;
    color: white;
    padding: 12px 32px;
    border-radius: 25px;
    font-size: 1.1em;
    font-family: 'Orbitron', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 150, 255, 0.4);
}

.level-up-close:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 25px rgba(0, 150, 255, 0.6);
}

/* ============ LEVEL CARD (Profile) ============ */

.level-card {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--lc-color, #6366f1)20, var(--lc-color, #6366f1)08);
    border-radius: var(--radius-md);
    border: 2px solid color-mix(in srgb, var(--lc-color, #6366f1) 33%, transparent);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15), inset 0 1px 0 rgba(255,255,255,0.05);
    box-sizing: border-box;
}

.level-card__header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.level-card__badge-circle {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, color-mix(in srgb, var(--lc-color, #6366f1) 20%, transparent), color-mix(in srgb, var(--lc-color, #6366f1) 7%, transparent));
    border-radius: 50%;
    border: 3px solid color-mix(in srgb, var(--lc-color, #6366f1) 40%, transparent);
    box-shadow: 0 4px 12px color-mix(in srgb, var(--lc-color, #6366f1) 27%, transparent);
}

.level-card__badge-icon {
    font-size: 38px;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.4));
}

.level-card__info {
    flex: 1;
}

.level-card__level-number {
    font-size: 24px;
    font-weight: 800;
    color: var(--lc-color, #6366f1);
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.level-card__title {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    opacity: 0.95;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.level-card__progress {
    margin-bottom: 14px;
}

.level-card__progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: rgba(255,255,255,0.75);
    margin-bottom: 6px;
}

.level-card__progress-label {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.level-card__progress-percent {
    font-weight: 800;
    font-size: 14px;
    color: var(--lc-color, #6366f1);
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.level-card__progress-track {
    height: 12px;
    background: rgba(0,0,0,0.3);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.4);
    position: relative;
}

.level-card__progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--lc-color, #6366f1), #8b5cf6, var(--lc-color, #6366f1));
    transition: width 0.6s cubic-bezier(0.4,0,0.2,1);
    box-shadow: 0 0 12px color-mix(in srgb, var(--lc-color, #6366f1) 67%, transparent), inset 0 1px 0 rgba(255,255,255,0.2);
}

.level-card__stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 12px;
    background: rgba(0,0,0,0.2);
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.05);
}

.level-card__stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.level-card__stat-label {
    font-size: 11px;
    color: rgba(255,255,255,0.6);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.level-card__stat-value {
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.level-card__stat-value--accent {
    font-size: 18px;
    font-weight: 800;
    color: var(--lc-color, #6366f1);
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.level-card__max-level {
    grid-column: 1 / -1;
    text-align: center;
    padding: 8px;
    background: linear-gradient(135deg, #FFD70033, #FFA50033);
    border-radius: 6px;
    border: 1px solid #FFD70044;
}

.level-card__max-level-text {
    font-weight: 800;
    font-size: 14px;
    color: #FFD700;
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
    letter-spacing: 0.5px;
}

/* Compact level display for header */

.level-display-compact {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.15));
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.level-display-compact:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(139, 92, 246, 0.25));
    border-color: rgba(99, 102, 241, 0.5);
}

.level-display-compact .level-badge {
    font-size: 24px;
}

.level-display-compact .level-number {
    font-weight: bold;
    color: #6366f1;
}

/* Dark mode support */

@media (prefers-color-scheme: dark) {
    .level-widget {
        background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.2));
        border-color: rgba(99, 102, 241, 0.5);
    }

    .level-number {
        color: #818cf8;
    }

    .level-title {
        color: #a78bfa;
    }

    .level-xp-needed {
        color: #d1d5db;
    }
}
