/* Achievement Categories */
.achievement-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
  justify-content: center;
}

.category-btn {
  padding: 10px 20px;
  border: 2px solid #4a5568;
  background: #2d3748;
  color: #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
  font-size: 14px;
}

.category-btn:hover {
  background: #4a5568;
  border-color: #68d391;
}

.category-btn.active {
  background: #68d391;
  border-color: #68d391;
  color: #1a202c;
}

/* Achievement List */
.achievement-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.achievement-card {
  background: #2d3748;
  border: 1px solid #4a5568;
  border-radius: 12px;
  padding: 20px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.achievement-card:hover {
  border-color: #68d391;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(104, 211, 145, 0.15);
}

.achievement-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 15px;
}

.achievement-icon {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  background: #4a5568;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
  overflow: hidden;
}

.achievement-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 6px;
  transition: transform 0.2s ease;
}

/* Ensure monster images are same size as skill images */
.achievement-icon.monster img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.achievement-icon img:hover {
  transform: scale(1.05);
}

/* Fallback for missing images */
.achievement-icon img:not([src]),
.achievement-icon img[src=""],
.achievement-icon img[src*="undefined"] {
  display: none;
}

.achievement-icon:not(:has(img)) {
  font-size: 24px;
}

.achievement-icon.skill {
  background: linear-gradient(135deg, #4299e1, #3182ce);
}

.achievement-icon.monster {
  background: linear-gradient(135deg, #e53e3e, #c53030);
}

.achievement-icon.general {
  background: linear-gradient(135deg, #68d391, #48bb78);
}

.achievement-icon.ability {
  background: linear-gradient(135deg, #805ad5, #6b46c1);
}

.achievement-title {
  font-size: 18px;
  font-weight: 600;
  color: #e2e8f0;
  margin: 0;
  flex: 1;
}

.achievement-sleep-points {
  background: #68d391;
  color: #1a202c;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  min-width: 40px;
  text-align: center;
}

.achievement-description {
  color: #a0aec0;
  line-height: 1.5;
  margin-bottom: 15px;
}


/* Responsive Design */
@media (max-width: 768px) {
  .achievement-categories {
    flex-direction: column;
    align-items: center;
  }
  
  .category-btn {
    width: 100%;
    max-width: 300px;
  }
  
  .achievement-list {
    grid-template-columns: 1fr;
  }
  
  .achievement-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  
  .achievement-title {
    font-size: 16px;
  }
}

/* Loading State */
.achievement-list.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 200px;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #4a5568;
  border-top: 4px solid #68d391;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Empty State */
.achievement-list.empty {
  text-align: center;
  padding: 40px 20px;
  color: #a0aec0;
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-text {
  font-size: 18px;
  margin-bottom: 8px;
}

.empty-subtext {
  font-size: 14px;
  opacity: 0.7;
}
