/* ========================================
   BADGES & ACHIEVEMENTS
   ======================================== */

/* Badge Grid Layout */
.badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

/* Badge Item */
.badge-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 16px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--stroke);
  transition: all 0.2s ease;
}

.badge-item.badge-earned {
  background: linear-gradient(135deg, var(--surface) 0%, var(--glass-100) 100%);
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(var(--accent-rgb), 0.1);
}

.badge-item.badge-locked {
  opacity: 0.5;
  background: var(--glass-50);
}

.badge-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.badge-item.badge-earned:hover {
  box-shadow: 0 4px 16px rgba(var(--accent-rgb), 0.2);
}

/* Badge Icon */
.badge-icon {
  font-size: 48px;
  margin-bottom: 8px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.badge-item.badge-large .badge-icon {
  font-size: 64px;
}

.badge-item.badge-locked .badge-icon {
  filter: grayscale(100%) opacity(0.5);
}

/* Badge Info */
.badge-info {
  width: 100%;
}

.badge-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 4px;
}

.badge-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.badge-threshold {
  margin-top: 8px;
  font-size: 11px;
  color: var(--muted);
  background: var(--glass-100);
  padding: 4px 8px;
  border-radius: 8px;
}

/* Compact Badge List (for profiles) */
.badges-compact {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin: 8px 0;
}

.badge-mini {
  font-size: 24px;
  cursor: help;
  transition: transform 0.2s ease;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.badge-mini:hover {
  transform: scale(1.1);
}

.badge-more {
  font-size: 12px;
  color: var(--muted);
  background: var(--glass-100);
  padding: 4px 8px;
  border-radius: 12px;
  cursor: pointer;
}

.badge-more:hover {
  background: var(--glass-200);
}

/* Badge Progress */
.badge-progress-item {
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  transition: all 0.2s ease;
}

.badge-progress-item:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(var(--accent-rgb), 0.1);
}

.badge-progress-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.badge-progress-icon {
  font-size: 32px;
  flex-shrink: 0;
}

.badge-progress-info {
  flex: 1;
}

.badge-progress-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 4px;
}

.badge-progress-desc {
  font-size: 12px;
  color: var(--muted);
}

.badge-progress-bar-container {
  height: 8px;
  background: var(--glass-100);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 6px;
}

.badge-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-hover) 100%);
  border-radius: 4px;
  transition: width 0.5s ease;
}

.badge-progress-text {
  font-size: 12px;
  color: var(--muted);
  text-align: right;
}

/* Badge Category Sections */
.badge-category {
  margin-bottom: 32px;
}

.badge-category h4 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* My Badges Section */
.my-badges-section {
  margin-bottom: 32px;
}

.my-badges-section h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text);
}

/* Progress Section */
.progress-section {
  margin-bottom: 32px;
}

.progress-section h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text);
}

/* All Badges Section */
.all-badges-section h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 24px;
  color: var(--text);
}

/* Badge Card (alternative style for badges page) */
.badge-card {
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  transition: all 0.2s ease;
}

.badge-card.earned {
  background: linear-gradient(135deg, var(--surface) 0%, var(--glass-100) 100%);
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(var(--accent-rgb), 0.1);
}

.badge-card.locked {
  opacity: 0.5;
  background: var(--glass-50);
}

.badge-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.badge-card.earned:hover {
  box-shadow: 0 4px 16px rgba(var(--accent-rgb), 0.2);
}

.badge-card .badge-icon {
  font-size: 48px;
  margin-bottom: 12px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.badge-card.locked .badge-icon {
  filter: grayscale(100%) opacity(0.5);
}

.badge-card .badge-name {
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
  margin-bottom: 6px;
}

.badge-card .badge-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
  margin-bottom: 8px;
}

.badge-card .badge-threshold {
  font-size: 11px;
  color: var(--muted);
  background: var(--glass-100);
  padding: 4px 8px;
  border-radius: 8px;
  display: inline-block;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .badges-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
  }

  .badge-icon {
    font-size: 40px;
  }

  .badge-item.badge-large .badge-icon {
    font-size: 52px;
  }
}

@media (max-width: 480px) {
  .badges-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
  }

  .badge-item {
    padding: 12px;
  }

  .badge-icon {
    font-size: 36px;
  }
}
