/* ============================================
   Achievements Page
   ============================================ */

.achievements-container {
  max-width: 900px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.achievements-header {
  margin-bottom: 2rem;
}

.achievements-header h1 {
  font-size: 1.8rem;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.achievements-header h1 i {
  color: var(--warning);
  margin-right: 0.4rem;
}

/* Overall summary bar */
.achievements-summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.achievements-count {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-light);
}

.achievements-label {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.achievements-overall-bar {
  flex: 1;
  min-width: 120px;
  height: 8px;
  background: var(--border-color);
  border-radius: 4px;
  overflow: hidden;
}

.achievements-overall-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 4px;
  transition: width 0.4s ease;
}

.achievements-sign-in-hint {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.achievements-sign-in-hint a {
  color: var(--primary-light);
  text-decoration: underline;
}

/* Category sections */
.ach-category {
  margin-bottom: 2rem;
}

.ach-category-title {
  font-size: 1.2rem;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border-color);
}

.ach-category-title i {
  color: var(--primary-light);
  margin-right: 0.3rem;
  width: 1.2em;
  text-align: center;
}

/* Achievement cards grid */
.ach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 10px;
}

.ach-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 14px;
  opacity: 0.5;
  transition: opacity 0.2s ease, border-color 0.2s ease;
}

.ach-card.ach-earned {
  opacity: 1;
  border-color: var(--primary-light);
}

.ach-card:hover {
  opacity: 0.8;
}

.ach-card.ach-earned:hover {
  opacity: 1;
}

/* Icon circle */
.ach-icon {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 50%;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--text-muted);
}

.ach-earned .ach-icon {
  background: var(--primary);
  color: #fff;
}

/* Text content */
.ach-body {
  flex: 1;
  min-width: 0;
}

.ach-name {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.ach-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

/* Progress bar row */
.ach-progress-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ach-bar {
  flex: 1;
  height: 6px;
  background: var(--border-color);
  border-radius: 3px;
  overflow: hidden;
}

.ach-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  transition: width 0.4s ease;
  min-width: 0;
}

.ach-bar-complete {
  background: var(--success);
}

.ach-stat {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 3em;
  text-align: right;
}

.ach-earned .ach-stat {
  color: var(--success);
}

/* Responsive */
@media (max-width: 480px) {
  .achievements-container {
    padding: 0 0.75rem;
  }

  .ach-grid {
    grid-template-columns: 1fr;
  }

  .achievements-header h1 {
    font-size: 1.4rem;
  }
}
