/**
 * Kapsul Echo UI Styles
 */

/* === Level Badge === */
.echo-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 50px;
    background: linear-gradient(135deg, var(--badge-color), color-mix(in srgb, var(--badge-color) 80%, black));
    color: white;
    font-weight: 600;
    white-space: nowrap;
}

.echo-badge--xs {
    font-size: 10px;
    padding: 1px 6px;
}

.echo-badge--sm {
    font-size: 11px;
    padding: 2px 8px;
}

.echo-badge--md {
    font-size: 13px;
    padding: 4px 12px;
}

.echo-badge--lg {
    font-size: 16px;
    padding: 6px 16px;
}

.echo-badge--compact {
    width: 22px;
    height: 22px;
    padding: 0;
    justify-content: center;
    font-size: 11px;
}

.echo-badge__level {
    opacity: 0.9;
}

.echo-badge__name {
    font-weight: 500;
}

/* === Progress Bar === */
.echo-progress {
    width: 100%;
}

.echo-progress__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 12px;
}

.echo-progress__current {
    display: flex;
    align-items: center;
    gap: 8px;
}

.echo-progress__level {
    font-weight: 600;
}

.echo-progress__echo {
    color: var(--text-secondary, #888);
}

.echo-progress__next {
    color: var(--text-secondary, #888);
    font-size: 11px;
}

.echo-progress__bar {
    height: 6px;
    background: var(--bg-tertiary, #333);
    border-radius: 3px;
    overflow: hidden;
}

.echo-progress__fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease-out;
}

.echo-progress__percent {
    text-align: right;
    font-size: 10px;
    color: var(--text-secondary, #888);
    margin-top: 4px;
}

/* === Stats Card === */
.echo-stats-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-secondary, #1a1a1a);
    border-radius: 16px;
}

.echo-stats-card__badge {
    flex-shrink: 0;
}

.echo-stats-card__info {
    flex: 1;
    min-width: 0;
}

.echo-stats-card__echo {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 8px;
}

.echo-stats-card__value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary, white);
}

.echo-stats-card__label {
    font-size: 14px;
    color: var(--text-secondary, #888);
}

.echo-stats-card__progress {
    width: 100%;
}

.echo-stats-card__bar {
    height: 4px;
    background: var(--bg-tertiary, #333);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 4px;
}

.echo-stats-card__fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.5s ease-out;
}

.echo-stats-card__remaining {
    font-size: 11px;
    color: var(--text-secondary, #888);
}

/* === Level Up Notification === */
.echo-levelup {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    z-index: 10000;
    padding: 16px 24px;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.95), rgba(22, 163, 74, 0.95));
    backdrop-filter: blur(12px);
    border-radius: 50px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.echo-levelup--visible {
    transform: translateX(-50%) translateY(0);
}

.echo-levelup__content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.echo-levelup__icon {
    font-size: 28px;
    animation: levelup-bounce 0.6s ease-out;
}

@keyframes levelup-bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

.echo-levelup__text {
    display: flex;
    flex-direction: column;
}

.echo-levelup__title {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.echo-levelup__level {
    font-size: 18px;
    font-weight: 700;
    color: white;
}

/* === Points Animation === */
.echo-points-anim {
    position: fixed;
    font-size: 18px;
    font-weight: 700;
    pointer-events: none;
    z-index: 9999;
    animation: points-float 1s ease-out forwards;
    transform: translateX(-50%);
}

.echo-points-anim--positive {
    color: #22c55e;
}

.echo-points-anim--negative {
    color: #ef4444;
}

@keyframes points-float {
    0% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-40px);
    }
}

/* === Profile Echo Section === */
.profile-echo {
    margin: 16px 0;
    padding: 16px;
    background: var(--bg-secondary, #1a1a1a);
    border-radius: 16px;
}

.profile-echo__header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.profile-echo__level {
    display: flex;
    align-items: center;
    gap: 8px;
}

.profile-echo__name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary, white);
}

/* === Inline Badge (for usernames) === */
.username-with-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.username-with-badge .echo-badge {
    vertical-align: middle;
}

/* === Profile Echo Section === */
.profile-echo-section {
    margin-top: 16px;
    padding: 0 20px;
    max-width: 300px;
}

.profile-hero__stat--echo strong {
    color: #22c55e;
}

/* === Leaderboard Styles === */
.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-secondary, #1a1a1a);
    border-radius: 12px;
    margin-bottom: 8px;
}

.leaderboard-item__rank {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    border-radius: 50%;
    background: var(--bg-tertiary, #333);
    color: var(--text-secondary, #888);
}

.leaderboard-item__rank--gold {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
}

.leaderboard-item__rank--silver {
    background: linear-gradient(135deg, #9ca3af, #6b7280);
    color: white;
}

.leaderboard-item__rank--bronze {
    background: linear-gradient(135deg, #d97706, #b45309);
    color: white;
}

.leaderboard-item__user {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.leaderboard-item__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.leaderboard-item__info {
    display: flex;
    flex-direction: column;
}

.leaderboard-item__name {
    font-weight: 600;
    color: var(--text-primary, white);
}

.leaderboard-item__echo {
    font-size: 12px;
    color: var(--text-secondary, #888);
}
