/* ════════════════════════════════════════════════════════════
   gamification.css — XP, Levels, Streaks, Achievements & Celebrations
   OmniVest AI / ZEN ASSETS
════════════════════════════════════════════════════════════ */

/* ── Main Panel ──────────────────────────────────────────── */
.gm-panel {
  margin-bottom: 1.25rem;
  padding: 0;
  background: rgba(10, 14, 22, 0.7);
  border: 1px solid rgba(0, 230, 118, 0.1);
  border-radius: 14px;
  overflow: hidden;
}

/* ── Top Row: Level | Streak | Daily | Stats ─────────────── */
.gm-top-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr auto 1fr;
  gap: 1px;
  background: rgba(255,255,255,0.04);
}
.gm-top-row > div {
  padding: 1rem 1.1rem;
  background: rgba(10, 14, 22, 0.85);
}

/* ── Level Section ───────────────────────────────────────── */
.gm-level-section {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}
.gm-level-badge {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  border: 2px solid rgba(0, 230, 118, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 230, 118, 0.05);
  flex-shrink: 0;
  transition: border-color 0.5s, box-shadow 0.5s;
  position: relative;
}
.gm-level-badge::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 16px;
  background: conic-gradient(from 0deg, transparent, rgba(0,230,118,0.15), transparent, rgba(0,230,118,0.1), transparent);
  animation: gmBadgeSpin 8s linear infinite;
  z-index: -1;
}
@keyframes gmBadgeSpin {
  to { transform: rotate(360deg); }
}
.gm-level-icon {
  font-size: 1.4rem;
  line-height: 1;
}
.gm-level-num {
  font-size: 0.6rem;
  font-weight: 800;
  color: rgba(255,255,255,0.6);
  font-family: 'Orbitron', sans-serif;
  letter-spacing: 1px;
}
.gm-level-info {
  flex: 1;
  min-width: 0;
}
.gm-level-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: rgba(255,255,255,0.85);
  margin-bottom: 4px;
  font-family: 'Space Grotesk', sans-serif;
}

/* ── XP Bar ──────────────────────────────────────────────── */
.gm-xp-bar-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.gm-xp-bar {
  flex: 1;
  height: 8px;
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}
.gm-xp-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #00e676, #00e67688);
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}
.gm-xp-fill::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  width: 20px;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4));
  animation: gmXPShine 2s ease-in-out infinite;
}
@keyframes gmXPShine {
  0%, 100% { opacity: 0; }
  50%      { opacity: 1; }
}
.gm-xp-text {
  font-size: 0.62rem;
  color: rgba(255,255,255,0.4);
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
  min-width: 70px;
  text-align: right;
}
.gm-xp-sub {
  font-size: 0.6rem;
  color: rgba(255,255,255,0.25);
  margin-top: 3px;
}

/* ── Streak Section ──────────────────────────────────────── */
.gm-streak-section {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.gm-streak-flame {
  font-size: 1.8rem;
  line-height: 1;
  transition: filter 0.3s;
}
.gm-streak-flame.gm-fire-hot {
  filter: drop-shadow(0 0 6px rgba(255,100,0,0.5));
  animation: gmFirePulse 1.5s ease-in-out infinite;
}
.gm-streak-flame.gm-fire-mega {
  filter: drop-shadow(0 0 12px rgba(255,50,0,0.7));
  animation: gmFirePulse 0.8s ease-in-out infinite;
}
@keyframes gmFirePulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.15); }
}
.gm-streak-count {
  font-size: 0.85rem;
  font-weight: 700;
  color: rgba(255,255,255,0.85);
}
.gm-streak-count span {
  font-size: 1.1rem;
  font-family: 'Orbitron', sans-serif;
  color: #ff9800;
}
.gm-streak-mult {
  font-size: 0.62rem;
  color: #00e676;
  font-weight: 600;
}
.gm-streak-best {
  font-size: 0.58rem;
  color: rgba(255,255,255,0.25);
}

/* ── Daily Bonus Section ─────────────────────────────────── */
.gm-daily-section {
  display: flex;
  align-items: center;
  justify-content: center;
}
.gm-daily-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 0.5rem 0.9rem;
  border: 2px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  background: rgba(255,255,255,0.02);
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}
.gm-daily-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 40%, rgba(255,215,0,0.05) 50%, transparent 60%);
  animation: gmShimmer 3s ease-in-out infinite;
}
@keyframes gmShimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
.gm-daily-icon {
  font-size: 1.4rem;
  line-height: 1;
}
.gm-daily-label {
  font-size: 0.55rem;
  font-weight: 600;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
  line-height: 1.2;
}
.gm-daily-status {
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 1px 6px;
  border-radius: 4px;
}
.gm-daily-btn.gm-daily-available {
  border-color: rgba(255, 215, 0, 0.5);
  background: rgba(255, 215, 0, 0.06);
  animation: gmDailyPulse 2s ease-in-out infinite;
}
.gm-daily-btn.gm-daily-available .gm-daily-status {
  color: #ffd700;
  background: rgba(255, 215, 0, 0.12);
}
.gm-daily-btn.gm-daily-available:hover {
  border-color: rgba(255, 215, 0, 0.8);
  transform: scale(1.05);
  box-shadow: 0 0 25px rgba(255, 215, 0, 0.2);
}
.gm-daily-btn.gm-daily-available .gm-daily-icon {
  animation: gmGiftBounce 1.5s ease-in-out infinite;
}
@keyframes gmDailyPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 215, 0, 0); }
  50%      { box-shadow: 0 0 15px 2px rgba(255, 215, 0, 0.15); }
}
@keyframes gmGiftBounce {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25%      { transform: translateY(-3px) rotate(-5deg); }
  75%      { transform: translateY(-3px) rotate(5deg); }
}
.gm-daily-btn.gm-daily-claimed {
  border-color: rgba(255,255,255,0.06);
  opacity: 0.5;
  cursor: default;
}
.gm-daily-btn.gm-daily-claimed .gm-daily-status {
  color: rgba(0, 230, 118, 0.6);
}

/* ── Stats Section ───────────────────────────────────────── */
.gm-stats-section {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: center;
}
.gm-stat {
  text-align: center;
}
.gm-stat-val {
  font-size: 0.95rem;
  font-weight: 700;
  color: rgba(255,255,255,0.8);
  font-family: 'JetBrains Mono', monospace;
}
.gm-stat-label {
  font-size: 0.55rem;
  color: rgba(255,255,255,0.3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 1px;
}

/* ── Achievement Badges Row ──────────────────────────────── */
.gm-badges-row {
  border-top: 1px solid rgba(255,255,255,0.04);
  padding: 0;
}
.gm-badges-header {
  padding: 0.6rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(255,255,255,0.5);
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
.gm-badges-header i { color: #ffd700; margin-right: 0.4rem; }
.gm-badges-prog {
  font-size: 0.6rem;
  color: rgba(255,255,255,0.3);
  font-weight: 500;
}
.gm-badges-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  padding: 0.5rem 0.8rem;
}
.gm-badge-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 0.4rem 0.5rem;
  border-radius: 8px;
  min-width: 58px;
  transition: all 0.3s;
  cursor: default;
}
.gm-badge-item:hover {
  background: rgba(255,255,255,0.04);
}
.gm-badge-icon {
  font-size: 1.2rem;
  line-height: 1;
}
.gm-badge-name {
  font-size: 0.5rem;
  color: rgba(255,255,255,0.35);
  text-align: center;
  max-width: 56px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gm-badge-unlocked {
  position: relative;
}
.gm-badge-unlocked .gm-badge-icon {
  filter: drop-shadow(0 0 4px rgba(255, 215, 0, 0.4));
}
.gm-badge-unlocked .gm-badge-name {
  color: rgba(255,255,255,0.6);
  font-weight: 600;
}
.gm-badge-locked .gm-badge-icon {
  filter: grayscale(1) brightness(0.4);
}
.gm-badge-locked .gm-badge-name {
  color: rgba(255,255,255,0.15);
}

/* ── Confetti Animation ──────────────────────────────────── */
@keyframes gmConfettiFall {
  0% {
    transform: translateY(0) translateX(0) rotate(0deg);
    opacity: 1;
  }
  25% {
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) translateX(var(--drift)) rotate(var(--rot));
    opacity: 0;
  }
}

/* ── Celebration Toast ───────────────────────────────────── */
.gm-celebration {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(-30px) scale(0.9);
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem 1.4rem;
  background: rgba(10, 14, 22, 0.95);
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 30px rgba(255, 215, 0, 0.1);
  z-index: 99998;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  backdrop-filter: blur(12px);
}
.gm-celebration.gm-celeb-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}
.gm-celebration.gm-celeb-hide {
  opacity: 0;
  transform: translateX(-50%) translateY(-20px) scale(0.95);
}
.gm-celeb-icon {
  font-size: 2rem;
  line-height: 1;
  animation: gmCelebBounce 0.6s ease-out;
}
@keyframes gmCelebBounce {
  0%   { transform: scale(0); }
  50%  { transform: scale(1.3); }
  100% { transform: scale(1); }
}
.gm-celeb-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: #ffd700;
  font-family: 'Orbitron', sans-serif;
  letter-spacing: 1px;
}
.gm-celeb-sub {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.6);
  margin-top: 2px;
}

/* ── Floating XP Text ────────────────────────────────────── */
.gm-floating-xp {
  position: fixed;
  font-size: 0.85rem;
  font-weight: 800;
  color: #00e676;
  font-family: 'Orbitron', sans-serif;
  text-shadow: 0 0 8px rgba(0, 230, 118, 0.5);
  pointer-events: none;
  z-index: 99997;
  opacity: 1;
  transition: all 1.2s ease-out;
}
.gm-floating-xp.gm-float-go {
  transform: translateY(-60px);
  opacity: 0;
}

/* ── Pulse Glow for values that just changed ─────────────── */
.gm-value-pulse {
  animation: gmValuePulse 0.6s ease-out;
}
@keyframes gmValuePulse {
  0%   { text-shadow: 0 0 12px rgba(0, 230, 118, 0.8); color: #00e676; }
  100% { text-shadow: none; }
}

/* ── Addictive Micro-Interactions ────────────────────────── */

/* Hover scale on KPI cards */
.kpi-card {
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s;
}
.kpi-card:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

/* Smooth number transitions */
.kpi-value, .ret-value, .fm-pool-amount {
  transition: color 0.3s;
}

/* Earnings amount glow on change */
.ret-value.up {
  text-shadow: 0 0 6px rgba(0, 230, 118, 0.2);
}

/* Progress bar shimmer overlay */
.gm-xp-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
  animation: gmBarShimmer 3s ease-in-out infinite;
}
@keyframes gmBarShimmer {
  0%   { left: -100%; }
  100% { left: 100%; }
}

/* ── Level-Up Ring Animation ─────────────────────────────── */
.gm-level-badge.gm-leveling-up {
  animation: gmLevelUpRing 1s ease-out;
}
@keyframes gmLevelUpRing {
  0%   { box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.6); }
  50%  { box-shadow: 0 0 0 12px rgba(255, 215, 0, 0); }
  100% { box-shadow: none; }
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 1100px) {
  .gm-top-row {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 768px) {
  .gm-top-row {
    grid-template-columns: 1fr;
  }
  .gm-top-row > div {
    padding: 0.8rem 1rem;
  }
  .gm-level-section {
    gap: 0.6rem;
  }
  .gm-level-badge {
    width: 44px;
    height: 44px;
  }
  .gm-level-icon { font-size: 1.1rem; }
  .gm-streak-flame { font-size: 1.5rem; }
  .gm-daily-btn { padding: 0.4rem 0.7rem; }
  .gm-stats-section { gap: 0.6rem; }
  .gm-badge-item { min-width: 48px; padding: 0.3rem; }
  .gm-badge-icon { font-size: 1rem; }
  .gm-badge-name { font-size: 0.45rem; max-width: 48px; }

  .gm-celebration {
    top: 60px;
    padding: 0.6rem 1rem;
    width: 90%;
    max-width: 360px;
  }
  .gm-celeb-icon { font-size: 1.5rem; }
  .gm-celeb-title { font-size: 0.75rem; }
}
