/* Achievement System Styles */

/* ─── Badges ─────────────────────────────────────────────────────── */

.ach-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 2px solid;
  border-radius: 50%;
  font-size: 14px;
  margin: 0 2px;
  cursor: help;
  transition: transform 0.2s, box-shadow 0.2s;
  background: rgba(0, 0, 0, 0.3);
}

.ach-badge:hover {
  transform: scale(1.3);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
  z-index: 10;
}

/* ─── Showcase (in agent cards) ──────────────────────────────────── */

.ach-showcase {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.ach-showcase.empty {
  color: #6b7280;
  font-size: 11px;
  font-style: italic;
}

.ach-more {
  font-size: 11px;
  color: #9ca3af;
  margin-left: 4px;
}

/* ─── Progress Bar ───────────────────────────────────────────────── */

.ach-progress {
  position: relative;
  width: 100%;
  height: 18px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 9px;
  overflow: hidden;
  margin: 4px 0;
}

.ach-progress-bar {
  height: 100%;
  border-radius: 9px;
  transition: width 0.5s ease;
  min-width: 2px;
}

.ach-progress-text {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* ─── Achievement Panel (tab content) ────────────────────────────── */

.ach-panel {
  padding: 16px;
  max-width: 900px;
  margin: 0 auto;
}

.ach-panel h3 {
  color: #f59e0b;
  margin: 16px 0 8px;
  font-size: 16px;
}

.ach-panel h4 {
  color: #d1d5db;
  margin: 12px 0 6px;
  font-size: 13px;
  text-transform: capitalize;
}

/* ─── Leaderboard ────────────────────────────────────────────────── */

.ach-leaderboard {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ach-agent-row {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ach-agent-name {
  font-weight: 600;
  color: #e5e7eb;
  font-size: 14px;
}

/* ─── Achievement Grid ───────────────────────────────────────────── */

.ach-category {
  margin-bottom: 12px;
}

.ach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px;
}

.ach-card {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  padding: 8px 10px;
  display: flex;
  gap: 8px;
  transition: background 0.2s;
}

.ach-card.locked {
  opacity: 0.4;
}

.ach-card.earned {
  opacity: 1;
  background: rgba(255, 255, 255, 0.08);
}

.ach-card:hover {
  background: rgba(255, 255, 255, 0.12);
}

.ach-card-emoji {
  font-size: 24px;
  flex-shrink: 0;
  width: 32px;
  text-align: center;
}

.ach-card-info {
  flex: 1;
  min-width: 0;
}

.ach-card-name {
  font-weight: 600;
  color: #e5e7eb;
  font-size: 12px;
}

.ach-card-desc {
  color: #9ca3af;
  font-size: 11px;
  margin-top: 1px;
}

.ach-card-meta {
  display: flex;
  gap: 8px;
  margin-top: 3px;
  font-size: 10px;
  color: #6b7280;
}

.ach-earners {
  color: #f59e0b;
}

/* ─── Toast Notifications ────────────────────────────────────────── */

.ach-toast {
  position: fixed;
  top: 80px;
  right: -350px;
  width: 300px;
  background: rgba(0, 0, 0, 0.9);
  border: 2px solid;
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 10000;
  transition: right 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.ach-toast.show {
  right: 20px;
}

.ach-toast-emoji {
  font-size: 36px;
  flex-shrink: 0;
  animation: achBounce 0.5s ease 0.5s;
}

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

.ach-toast-content {
  flex: 1;
}

.ach-toast-title {
  font-size: 11px;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ach-toast-name {
  font-size: 16px;
  font-weight: 700;
  margin-top: 2px;
}

/* ─── Mobile Responsive ──────────────────────────────────────────── */

@media (max-width: 768px) {
  .ach-grid {
    grid-template-columns: 1fr;
  }
  
  .ach-badge {
    width: 24px;
    height: 24px;
    font-size: 12px;
  }
  
  .ach-toast {
    width: calc(100vw - 40px);
    right: -100vw;
  }
  
  .ach-toast.show {
    right: 20px;
  }
  
  .ach-panel {
    padding: 8px;
  }
}
