/* ==============================================
   Achievement System Styles
   Matches funnyzz-achievement.js toast structure
   ============================================== */

/* Toast 通知 */
.fz-achievement-toast {
  position: fixed;
  top: 80px;
  right: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  padding: 16px 24px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 10000;
  max-width: 320px;
  transform: translateX(400px);
  opacity: 0;
  transition: transform 0.5s ease-out, opacity 0.5s ease-in;
  pointer-events: none;
}

.fz-achievement-toast.show {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.fz-achievement-toast .fz-ach-icon {
  font-size: 40px;
  line-height: 1;
  flex-shrink: 0;
}

.fz-achievement-toast .fz-ach-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.fz-achievement-toast .fz-ach-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.8;
}

.fz-achievement-toast .fz-ach-title {
  font-size: 16px;
  font-weight: bold;
  line-height: 1.2;
}

.fz-achievement-toast .fz-ach-desc {
  font-size: 12px;
  opacity: 0.85;
  line-height: 1.3;
}

/* 成就面板遮罩 */
.fz-achievement-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 9998;
  display: none;
}

.fz-achievement-overlay.show {
  display: block;
}

/* 成就面板 */
.fz-achievement-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--card, #fff);
  border: 2px solid var(--accent, #4f46e5);
  border-radius: 16px;
  padding: 24px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  z-index: 9999;
  display: none;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.fz-achievement-panel.show {
  display: block;
}

.fz-achievement-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 2px solid rgba(28,31,51,0.1);
}

.fz-achievement-header h2 {
  margin: 0;
  color: var(--text, #1c1f33);
  font-size: 24px;
}

.fz-achievement-close {
  background: none;
  border: none;
  color: var(--text, #1c1f33);
  font-size: 32px;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fz-achievement-close:hover {
  color: var(--accent, #4f46e5);
}

.fz-achievement-progress {
  margin-bottom: 24px;
  text-align: center;
}

.fz-achievement-progress .progress-text {
  color: var(--text, #1c1f33);
  font-size: 18px;
  margin-bottom: 8px;
}

.fz-achievement-progress .progress-bar {
  width: 100%;
  height: 24px;
  background: rgba(28,31,51,0.08);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

.fz-achievement-progress .progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #667eea, #764ba2);
  transition: width 0.5s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: bold;
  font-size: 14px;
}

.fz-achievement-category {
  margin-bottom: 24px;
}

.fz-achievement-category h3 {
  color: var(--text, #1c1f33);
  font-size: 18px;
  margin: 0 0 16px 0;
  padding: 8px 12px;
  background: rgba(28,31,51,0.05);
  border-radius: 8px;
}

.fz-achievement-list {
  display: grid;
  gap: 12px;
}

.fz-achievement-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: rgba(28,31,51,0.03);
  border: 2px solid rgba(28,31,51,0.08);
  border-radius: 12px;
  transition: all 0.3s ease;
}

.fz-achievement-card.unlocked {
  border-color: #667eea;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
}

.fz-achievement-card .ach-icon {
  font-size: 40px;
  line-height: 1;
  filter: grayscale(100%);
  opacity: 0.4;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.fz-achievement-card.unlocked .ach-icon {
  filter: grayscale(0%);
  opacity: 1;
}

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

.fz-achievement-card .ach-name {
  color: var(--text, #1c1f33);
  font-size: 15px;
  font-weight: bold;
  margin: 0 0 4px 0;
}

.fz-achievement-card .ach-desc {
  color: rgba(28,31,51,0.6);
  font-size: 13px;
  margin: 0;
}

.fz-achievement-card.unlocked .ach-name {
  color: #4f46e5;
}

.fz-achievement-card .ach-check {
  color: #667eea;
  font-size: 24px;
  font-weight: bold;
  flex-shrink: 0;
}

/* Floating achievement button (injected by funnyzz-achievement.js) */
.fz-achievement-btn {
  position: fixed;
  bottom: 20px;
  left: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.3s ease;
  text-decoration: none;
}

.fz-achievement-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.fz-achievement-btn .fz-ach-badge {
  background: #e94560;
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: bold;
}

/* Rarity colors (for achievement page) */
.fz-achievement-card.rarity-common { border-left: 3px solid #9ca3af; }
.fz-achievement-card.rarity-uncommon { border-left: 3px solid #34d399; }
.fz-achievement-card.rarity-epic { border-left: 3px solid #f59e0b; }

/* 响应式 */
@media (max-width: 768px) {
  .fz-achievement-toast {
    top: 60px;
    right: 10px;
    left: 10px;
    max-width: none;
  }

  .fz-achievement-panel {
    width: 95%;
    padding: 16px;
  }

  .fz-achievement-btn {
    bottom: 10px;
    left: 10px;
    padding: 8px 14px;
    font-size: 13px;
  }
}
