/* ═══════════════════════════════════════════════════════════
   r90-user-eco.css — User Ecosystem UI Components
   Radio 90 Hit — 2026
   ═══════════════════════════════════════════════════════════ */

/* ─── Variables ─── */
:root {
    --r90-primary: #6366f1;
    --r90-primary-hover: #4f46e5;
    --r90-accent: #8b5cf6;
    --r90-bg: #1a1a2e;
    --r90-bg-card: #16213e;
    --r90-bg-input: #0f172a;
    --r90-text: #e2e8f0;
    --r90-text-muted: #94a3b8;
    --r90-border: #334155;
    --r90-success: #10b981;
    --r90-error: #ef4444;
    --r90-radius: 12px;
}

/* ─── Identity Bar (floating header widget) ─── */
.r90-id-bar {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 99999;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.r90-id-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--r90-bg-card);
    border: 1px solid var(--r90-border);
    border-radius: 999px;
    padding: 6px 16px 6px 10px;
    cursor: pointer;
    transition: all .2s ease;
    box-shadow: 0 4px 16px rgba(0,0,0,.3);
}
.r90-id-pill:hover {
    border-color: var(--r90-primary);
    box-shadow: 0 4px 20px rgba(99,102,241,.25);
}

.r90-id-badge {
    font-size: 18px;
    line-height: 1;
}
.r90-id-name {
    color: var(--r90-text);
    font-size: 13px;
    font-weight: 600;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.r90-id-karma {
    color: var(--r90-text-muted);
    font-size: 11px;
    font-weight: 500;
}
.r90-id-login-btn {
    background: linear-gradient(135deg, var(--r90-primary), var(--r90-accent));
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s ease;
    box-shadow: 0 4px 16px rgba(0,0,0,.3);
}
.r90-id-login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(99,102,241,.35);
}

/* ─── Dropdown menu ─── */
.r90-id-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--r90-bg-card);
    border: 1px solid var(--r90-border);
    border-radius: var(--r90-radius);
    min-width: 220px;
    padding: 8px 0;
    box-shadow: 0 8px 32px rgba(0,0,0,.4);
    display: none;
}
.r90-id-dropdown.open { display: block; }

.r90-id-dropdown a,
.r90-id-dropdown button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 16px;
    color: var(--r90-text);
    font-size: 13px;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    transition: background .15s;
    text-align: left;
}
.r90-id-dropdown a:hover,
.r90-id-dropdown button:hover {
    background: rgba(99,102,241,.1);
}

/* ─── Login Modal ─── */
.r90-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.6);
    backdrop-filter: blur(4px);
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
}
.r90-modal-overlay.open { display: flex; }

.r90-modal {
    background: var(--r90-bg-card);
    border: 1px solid var(--r90-border);
    border-radius: var(--r90-radius);
    padding: 32px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 16px 48px rgba(0,0,0,.5);
}
.r90-modal h3 {
    color: var(--r90-text);
    margin: 0 0 8px;
    font-size: 20px;
}
.r90-modal p {
    color: var(--r90-text-muted);
    font-size: 14px;
    margin: 0 0 24px;
    line-height: 1.5;
}
.r90-modal input[type="email"] {
    width: 100%;
    padding: 12px 16px;
    background: var(--r90-bg-input);
    border: 1px solid var(--r90-border);
    border-radius: 8px;
    color: var(--r90-text);
    font-size: 15px;
    outline: none;
    box-sizing: border-box;
    margin-bottom: 16px;
}
.r90-modal input[type="email"]:focus {
    border-color: var(--r90-primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}

.r90-modal-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--r90-primary), var(--r90-accent));
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s ease;
}
.r90-modal-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(99,102,241,.3);
}
.r90-modal-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
    transform: none;
}
.r90-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    color: var(--r90-text-muted);
    font-size: 22px;
    cursor: pointer;
}
.r90-modal-msg {
    margin-top: 12px;
    font-size: 13px;
    min-height: 20px;
}
.r90-modal-msg.success { color: var(--r90-success); }
.r90-modal-msg.error   { color: var(--r90-error); }

/* ─── Spinner ─── */
.r90-eco-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--r90-border);
    border-top-color: var(--r90-primary);
    border-radius: 50%;
    animation: r90spin .7s linear infinite;
    margin: 0 auto 12px;
}
@keyframes r90spin { to { transform: rotate(360deg); } }

/* ─── Pages ─── */
.r90-eco-page {
    max-width: 640px;
    margin: 60px auto;
    padding: 0 16px;
}
.r90-eco-card {
    background: var(--r90-bg-card);
    border: 1px solid var(--r90-border);
    border-radius: var(--r90-radius);
    padding: 40px;
    text-align: center;
}
.r90-eco-status {
    color: var(--r90-text-muted);
    font-size: 15px;
}

/* ─── User Panel ─── */
.r90-panel-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}
.r90-panel-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--r90-bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}
.r90-panel-info h2 {
    color: var(--r90-text);
    margin: 0 0 4px;
    font-size: 22px;
}
.r90-panel-info .r90-panel-level {
    font-size: 14px;
    font-weight: 600;
}
.r90-panel-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 24px 0;
}
.r90-panel-stat {
    background: var(--r90-bg-input);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
}
.r90-panel-stat-val {
    font-size: 24px;
    font-weight: 700;
    color: var(--r90-text);
}
.r90-panel-stat-label {
    font-size: 11px;
    color: var(--r90-text-muted);
    text-transform: uppercase;
    margin-top: 4px;
}

/* ─── Leaderboard ─── */
.r90-lb-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--r90-border);
}
.r90-lb-row:last-child { border-bottom: none; }

.r90-lb-rank {
    font-size: 16px;
    font-weight: 700;
    color: var(--r90-text-muted);
    min-width: 28px;
    text-align: center;
}
.r90-lb-rank.top-1 { color: #f59e0b; }
.r90-lb-rank.top-2 { color: #94a3b8; }
.r90-lb-rank.top-3 { color: #b45309; }

.r90-lb-badge { font-size: 20px; }
.r90-lb-name {
    flex: 1;
    color: var(--r90-text);
    font-size: 14px;
    font-weight: 600;
}
.r90-lb-karma {
    color: var(--r90-text-muted);
    font-size: 13px;
}

/* ─── Responsive ─── */
@media (max-width: 480px) {
    .r90-id-bar { top: auto; bottom: 12px; right: 12px; }
    .r90-id-dropdown { right: -4px; }
    .r90-panel-stats { grid-template-columns: 1fr; }
    .r90-eco-page { margin: 20px auto; }
    .r90-modal { padding: 24px; }
}


/* ─── Tabs ─── */
.r90-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--r90-border);
}
.r90-tab {
    flex: 1;
    background: none;
    border: none;
    color: var(--r90-text-muted);
    font-size: 13px;
    font-weight: 600;
    padding: 12px 8px;
    cursor: pointer;
    transition: all .2s;
    border-bottom: 2px solid transparent;
    text-align: center;
}
.r90-tab:hover {
    color: var(--r90-text);
    background: rgba(99,102,241,.05);
}
.r90-tab.active {
    color: var(--r90-primary);
    border-bottom-color: var(--r90-primary);
}

/* ─── Karma Progress Bar ─── */
.r90-karma-progress {
    margin-top: 20px;
}
.r90-karma-progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--r90-text-muted);
    margin-bottom: 6px;
}
.r90-karma-bar {
    height: 8px;
    background: var(--r90-bg-input);
    border-radius: 4px;
    overflow: hidden;
}
.r90-karma-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--r90-primary), var(--r90-accent));
    border-radius: 4px;
    transition: width .5s ease;
}

/* ─── Activity Rows ─── */
.r90-activity-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(51,65,85,.3);
}
.r90-activity-row:last-child { border-bottom: none; }
.r90-activity-icon { font-size: 18px; margin-top: 2px; }
.r90-activity-info { flex: 1; }
.r90-activity-desc {
    color: var(--r90-text);
    font-size: 13px;
    line-height: 1.4;
}
.r90-activity-time {
    color: var(--r90-text-muted);
    font-size: 11px;
    margin-top: 2px;
}

/* ─── Nickname Edit ─── */
.r90-edit-nick-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    opacity: 0.4;
    transition: opacity .2s;
    padding: 0 4px;
    vertical-align: middle;
}
.r90-edit-nick-btn:hover { opacity: 1; }
.r90-nick-input {
    background: var(--r90-bg-input);
    border: 1px solid var(--r90-border);
    border-radius: 6px;
    color: var(--r90-text);
    font-size: 16px;
    padding: 6px 10px;
    width: 160px;
    outline: none;
}
.r90-nick-input:focus {
    border-color: var(--r90-primary);
}
.r90-nick-save, .r90-nick-cancel {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 4px 6px;
    vertical-align: middle;
}

/* ─── Leaderboard "me" highlight ─── */
.r90-lb-me {
    background: rgba(99,102,241,.08);
    border-radius: 8px;
}
