/* ═══════════════════════════════════════════════════════════════
   vibra-reputation.css — VibraReputation v1.0
   Anti-spam + Trust Score + Urban Reputation System
   ═══════════════════════════════════════════════════════════════ */

/* ── Panel ────────────────────────────────────────────────────── */
#vibraRepPanel {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #06040f;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

#vibraRepPanel.rep-open {
  display: block;
  animation: repSlideIn .28s cubic-bezier(.2,0,.1,1);
}

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

/* ── Header ───────────────────────────────────────────────────── */
.rep-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(6,4,15,.96);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(138,87,255,.2);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: .75rem;
}

.rep-header-back {
  background: none;
  border: none;
  color: rgba(240,235,255,.6);
  font-size: 1.1rem;
  cursor: pointer;
  padding: .25rem;
  line-height: 1;
}

.rep-header-title {
  font-family: var(--sans, 'Syne', sans-serif);
  font-size: 1rem;
  font-weight: 800;
  color: #f0ebff;
  flex: 1;
}

.rep-header-live {
  display: flex;
  align-items: center;
  gap: .35rem;
  font-family: var(--mono, 'DM Mono', monospace);
  font-size: .55rem;
  color: var(--teal, #00e5cc);
  letter-spacing: .08em;
}

.rep-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal, #00e5cc);
  animation: repPulse 1.8s ease-in-out infinite;
}

@keyframes repPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .4; transform: scale(.7); }
}

/* ── Body ─────────────────────────────────────────────────────── */
.rep-body {
  padding: 1.25rem;
  padding-bottom: 6rem;
  max-width: 640px;
  margin: 0 auto;
}

/* ── Hero Trust Card ──────────────────────────────────────────── */
.rep-hero {
  background: linear-gradient(135deg, rgba(138,87,255,.12) 0%, rgba(0,229,204,.08) 100%);
  border: 1px solid rgba(138,87,255,.25);
  border-radius: 20px;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.rep-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(138,87,255,.08) 0%, transparent 70%);
  pointer-events: none;
}

.rep-trust-ring {
  width: 110px;
  height: 110px;
  margin: 0 auto 1rem;
  position: relative;
}

.rep-trust-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.rep-trust-ring-bg {
  fill: none;
  stroke: rgba(138,87,255,.15);
  stroke-width: 8;
}

.rep-trust-ring-fill {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 283;
  stroke-dashoffset: 283;
  transition: stroke-dashoffset 1.2s cubic-bezier(.4,0,.2,1), stroke .4s;
}

.rep-trust-val {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.rep-trust-num {
  font-family: var(--sans, 'Syne', sans-serif);
  font-size: 1.8rem;
  font-weight: 900;
  color: #f0ebff;
  line-height: 1;
}

.rep-trust-label {
  font-family: var(--mono, 'DM Mono', monospace);
  font-size: .45rem;
  color: rgba(240,235,255,.5);
  letter-spacing: .1em;
  margin-top: .2rem;
}

.rep-tier-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .35rem .85rem;
  border-radius: 20px;
  font-family: var(--sans, 'Syne', sans-serif);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  margin-bottom: .75rem;
  border: 1px solid;
}

.rep-tier-badge.tier-suspicious { background: rgba(255,69,58,.12); border-color: rgba(255,69,58,.3); color: #ff453a; }
.rep-tier-badge.tier-new        { background: rgba(255,196,0,.12);  border-color: rgba(255,196,0,.3);  color: #ffc400; }
.rep-tier-badge.tier-citizen    { background: rgba(0,229,204,.12);  border-color: rgba(0,229,204,.3);  color: #00e5cc; }
.rep-tier-badge.tier-verified   { background: rgba(10,132,255,.12); border-color: rgba(10,132,255,.3); color: #0a84ff; }
.rep-tier-badge.tier-guardian   { background: rgba(138,87,255,.15); border-color: rgba(138,87,255,.4); color: #a855f7; }

.rep-hero-desc {
  font-family: var(--mono, 'DM Mono', monospace);
  font-size: .6rem;
  color: rgba(240,235,255,.5);
  letter-spacing: .04em;
}

/* ── Score Breakdown ──────────────────────────────────────────── */
.rep-section-label {
  font-family: var(--mono, 'DM Mono', monospace);
  font-size: .52rem;
  font-weight: 500;
  letter-spacing: .1em;
  color: rgba(138,87,255,.8);
  text-transform: uppercase;
  margin-bottom: .75rem;
}

.rep-breakdown {
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 16px;
  padding: 1rem;
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.rep-factor {
  display: grid;
  grid-template-columns: 1.2rem 1fr auto;
  align-items: center;
  gap: .6rem;
}

.rep-factor-icon {
  font-size: .9rem;
  text-align: center;
}

.rep-factor-info {
  display: flex;
  flex-direction: column;
  gap: .2rem;
}

.rep-factor-name {
  font-family: var(--mono, 'DM Mono', monospace);
  font-size: .6rem;
  color: rgba(240,235,255,.8);
  letter-spacing: .04em;
}

.rep-factor-bar-wrap {
  height: 3px;
  background: rgba(255,255,255,.07);
  border-radius: 2px;
  overflow: hidden;
}

.rep-factor-bar {
  height: 100%;
  border-radius: 2px;
  transition: width 1s cubic-bezier(.4,0,.2,1);
}

.rep-factor-val {
  font-family: var(--sans, 'Syne', sans-serif);
  font-size: .72rem;
  font-weight: 700;
  min-width: 2.5rem;
  text-align: right;
}

.rep-factor-val.positive { color: #00e5cc; }
.rep-factor-val.neutral  { color: rgba(240,235,255,.6); }
.rep-factor-val.negative { color: #ff453a; }

/* ── KPI Grid ─────────────────────────────────────────────────── */
.rep-kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
  margin-bottom: 1.25rem;
}

.rep-kpi {
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 14px;
  padding: .9rem;
  text-align: center;
}

.rep-kpi-val {
  font-family: var(--sans, 'Syne', sans-serif);
  font-size: 1.4rem;
  font-weight: 900;
  color: #f0ebff;
  line-height: 1;
  margin-bottom: .25rem;
}

.rep-kpi-label {
  font-family: var(--mono, 'DM Mono', monospace);
  font-size: .5rem;
  color: rgba(240,235,255,.4);
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* ── Flags / Warnings ─────────────────────────────────────────── */
.rep-flags {
  background: rgba(255,69,58,.04);
  border: 1px solid rgba(255,69,58,.15);
  border-radius: 16px;
  padding: 1rem;
  margin-bottom: 1.25rem;
  display: none;
}

.rep-flags.has-flags {
  display: block;
}

.rep-flag-item {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .5rem 0;
  border-bottom: 1px solid rgba(255,69,58,.08);
}

.rep-flag-item:last-child { border-bottom: none; }

.rep-flag-icon { font-size: .9rem; }

.rep-flag-info { flex: 1; }

.rep-flag-title {
  font-family: var(--mono, 'DM Mono', monospace);
  font-size: .58rem;
  color: #ff453a;
  letter-spacing: .03em;
  margin-bottom: .15rem;
}

.rep-flag-desc {
  font-family: var(--mono, 'DM Mono', monospace);
  font-size: .5rem;
  color: rgba(255,69,58,.6);
}

.rep-flag-penalty {
  font-family: var(--sans, 'Syne', sans-serif);
  font-size: .65rem;
  font-weight: 700;
  color: #ff453a;
}

/* ── Achievements ─────────────────────────────────────────────── */
.rep-achievements {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  margin-bottom: 1.25rem;
}

.rep-achievement {
  display: flex;
  align-items: center;
  gap: .75rem;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 12px;
  padding: .75rem;
  transition: border-color .2s;
}

.rep-achievement.earned {
  border-color: rgba(0,229,204,.2);
  background: rgba(0,229,204,.04);
}

.rep-achievement-icon {
  font-size: 1.4rem;
  width: 2.2rem;
  text-align: center;
  filter: grayscale(1) opacity(.4);
  transition: filter .3s;
}

.rep-achievement.earned .rep-achievement-icon {
  filter: none;
}

.rep-achievement-info { flex: 1; }

.rep-achievement-name {
  font-family: var(--mono, 'DM Mono', monospace);
  font-size: .62rem;
  color: rgba(240,235,255,.8);
  letter-spacing: .03em;
  margin-bottom: .15rem;
}

.rep-achievement.earned .rep-achievement-name {
  color: #00e5cc;
}

.rep-achievement-desc {
  font-family: var(--mono, 'DM Mono', monospace);
  font-size: .5rem;
  color: rgba(240,235,255,.35);
}

.rep-achievement-xp {
  font-family: var(--sans, 'Syne', sans-serif);
  font-size: .65rem;
  font-weight: 700;
  color: rgba(240,235,255,.4);
}

.rep-achievement.earned .rep-achievement-xp {
  color: #ffc400;
}

/* ── Leaderboard peek ─────────────────────────────────────────── */
.rep-leaderboard {
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.rep-lb-header {
  padding: .75rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.06);
  font-family: var(--mono, 'DM Mono', monospace);
  font-size: .55rem;
  color: rgba(240,235,255,.5);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.rep-lb-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .65rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.04);
  transition: background .15s;
}

.rep-lb-row:last-child { border-bottom: none; }
.rep-lb-row:hover { background: rgba(255,255,255,.03); }
.rep-lb-row.is-me { background: rgba(138,87,255,.06); }

.rep-lb-rank {
  font-family: var(--sans, 'Syne', sans-serif);
  font-size: .65rem;
  font-weight: 900;
  color: rgba(240,235,255,.3);
  min-width: 1.4rem;
}

.rep-lb-rank.gold   { color: #ffc400; }
.rep-lb-rank.silver { color: #adb5bd; }
.rep-lb-rank.bronze { color: #cd7f32; }

.rep-lb-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(138,87,255,.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  flex-shrink: 0;
}

.rep-lb-name {
  font-family: var(--mono, 'DM Mono', monospace);
  font-size: .58rem;
  color: rgba(240,235,255,.8);
  flex: 1;
}

.rep-lb-score {
  font-family: var(--sans, 'Syne', sans-serif);
  font-size: .7rem;
  font-weight: 700;
}

.rep-lb-tier {
  font-size: .75rem;
}

/* ── Tips section ─────────────────────────────────────────────── */
.rep-tips {
  background: rgba(138,87,255,.06);
  border: 1px solid rgba(138,87,255,.15);
  border-radius: 16px;
  padding: 1rem;
  margin-bottom: 1.25rem;
}

.rep-tip {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  padding: .4rem 0;
}

.rep-tip-icon { font-size: .85rem; flex-shrink: 0; }

.rep-tip-text {
  font-family: var(--mono, 'DM Mono', monospace);
  font-size: .57rem;
  color: rgba(240,235,255,.6);
  line-height: 1.5;
}

.rep-tip-text strong {
  color: rgba(138,87,255,.9);
}

/* ── Toast indicator for reputation events ────────────────────── */
.rep-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(9,6,18,.95);
  border: 1px solid rgba(138,87,255,.3);
  border-radius: 20px;
  padding: .5rem 1rem;
  font-family: var(--mono, 'DM Mono', monospace);
  font-size: .6rem;
  color: #f0ebff;
  white-space: nowrap;
  opacity: 0;
  transition: all .3s cubic-bezier(.2,0,.1,1);
  pointer-events: none;
  z-index: 9999;
}

.rep-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Anti-spam shield indicator in feed posts ─────────────────── */
.rep-shield {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  font-family: var(--mono, 'DM Mono', monospace);
  font-size: .48rem;
  padding: .15rem .4rem;
  border-radius: 6px;
  letter-spacing: .04em;
}

.rep-shield.verified  { background: rgba(0,229,204,.1);  color: #00e5cc; }
.rep-shield.trusted   { background: rgba(10,132,255,.1); color: #0a84ff; }
.rep-shield.new-user  { background: rgba(255,196,0,.1);  color: #ffc400; }
.rep-shield.flagged   { background: rgba(255,69,58,.1);  color: #ff453a; }

/* ── Hover animation on KPI cards ────────────────────────────── */
.rep-kpi { transition: transform .15s, border-color .15s; }
.rep-kpi:hover { transform: translateY(-2px); border-color: rgba(138,87,255,.2); }
