/* ═══════════════════════════════════════════
   Gamification UI — Toasts, Popups, Confetti
   ═══════════════════════════════════════════ */

/* ─── XP Toast ─── */
.gf-toast {
  position: fixed;
  top: 20px;
  right: 20px;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border: 1px solid rgba(255, 122, 26, 0.4);
  border-radius: 14px;
  padding: 14px 22px;
  z-index: 10000;
  transform: translateX(120%);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 8px 32px rgba(255, 122, 26, 0.25);
  font-family: "Space Grotesk", "Nunito Sans", sans-serif;
}

.gf-toast.show {
  transform: translateX(0);
}

.gf-toast-xp {
  font-size: 22px;
  font-weight: 800;
  background: linear-gradient(90deg, #ff7a1a, #ffd700);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gf-toast-bonus {
  font-size: 13px;
  color: #4CAF50;
  margin-top: 4px;
  font-weight: 600;
}

.gf-toast-level {
  font-size: 14px;
  color: #ffd700;
  margin-top: 6px;
  font-weight: 700;
}

/* ─── Achievement Popup ─── */
.gf-achievement-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  opacity: 0;
  transition: opacity 0.4s ease;
  font-family: "Space Grotesk", "Nunito Sans", sans-serif;
}

.gf-achievement-overlay.show {
  opacity: 1;
}

.gf-achievement-card {
  background: linear-gradient(145deg, #2c211b, #3a2a1e);
  border: 2px solid rgba(255, 215, 0, 0.5);
  border-radius: 20px;
  padding: 40px 36px;
  text-align: center;
  max-width: 340px;
  width: 90%;
  transform: scale(0.8);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 20px 60px rgba(255, 215, 0, 0.15);
}

.gf-achievement-overlay.show .gf-achievement-card {
  transform: scale(1);
}

.gf-achievement-icon {
  font-size: 56px;
  margin-bottom: 12px;
  animation: gf-bounce 0.6s ease 0.3s both;
}

@keyframes gf-bounce {
  0% { transform: scale(0); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.gf-achievement-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #ffd700;
  margin-bottom: 8px;
}

.gf-achievement-name {
  font-size: 22px;
  font-weight: 800;
  color: #f5eee7;
  margin-bottom: 6px;
}

.gf-achievement-desc {
  font-size: 14px;
  color: #b8a99e;
  margin-bottom: 20px;
}

.gf-achievement-btn {
  background: linear-gradient(135deg, #ff7a1a, #ff9a3c);
  color: #111;
  border: none;
  padding: 10px 28px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s;
}

.gf-achievement-btn:hover {
  transform: scale(1.05);
}

/* ─── Confetti Canvas ─── */
.gf-confetti-canvas {
  position: fixed;
  inset: 0;
  z-index: 10002;
  pointer-events: none;
}

/* ─── Quiz Score Screen ─── */
.gf-score-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  opacity: 0;
  transition: opacity 0.4s ease;
  font-family: "Space Grotesk", "Nunito Sans", sans-serif;
}

.gf-score-overlay.show {
  opacity: 1;
}

.gf-score-card {
  background: linear-gradient(145deg, #2c211b, #1a120e);
  border: 2px solid rgba(255, 122, 26, 0.4);
  border-radius: 24px;
  padding: 44px 40px;
  text-align: center;
  max-width: 380px;
  width: 90%;
  transform: scale(0.8);
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

.gf-score-overlay.show .gf-score-card {
  transform: scale(1);
}

.gf-score-stars {
  font-size: 40px;
  margin-bottom: 12px;
  letter-spacing: 6px;
}

.gf-score-title {
  font-size: 26px;
  font-weight: 800;
  color: #f5eee7;
  margin-bottom: 12px;
}

.gf-score-pct {
  font-size: 52px;
  font-weight: 800;
  background: linear-gradient(90deg, #ff7a1a, #ffd700);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
}

.gf-score-detail {
  font-size: 15px;
  color: #b8a99e;
  margin-bottom: 16px;
}

.gf-score-xp {
  font-size: 20px;
  font-weight: 700;
  color: #ffd700;
  margin-bottom: 6px;
}

.gf-score-level {
  font-size: 14px;
  color: #b8a99e;
  margin-bottom: 20px;
}

.gf-score-btn {
  background: linear-gradient(135deg, #ff7a1a, #ff9a3c);
  color: #111;
  border: none;
  padding: 12px 36px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s;
}

.gf-score-btn:hover {
  transform: scale(1.05);
}

/* ─── Streak Toast ─── */
.gf-streak-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: linear-gradient(135deg, #ff7a1a, #ff4500);
  color: white;
  font-size: 16px;
  font-weight: 700;
  padding: 12px 28px;
  border-radius: 999px;
  z-index: 10000;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 8px 24px rgba(255, 69, 0, 0.35);
  font-family: "Space Grotesk", "Nunito Sans", sans-serif;
}

.gf-streak-toast.show {
  transform: translateX(-50%) translateY(0);
}

/* ─── Dashboard Gamification Cards ─── */
.gf-xp-card {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border: 1px solid rgba(255, 215, 0, 0.25);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 18px 30px rgba(0, 0, 0, 0.3);
}

.gf-level-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #ff7a1a, #ff9a3c);
  color: #111;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 12px;
}

.gf-xp-amount {
  font-size: 28px;
  font-weight: 800;
  background: linear-gradient(90deg, #ffd700, #ff7a1a);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 4px;
}

.gf-xp-label {
  font-size: 12px;
  color: #b8a99e;
  margin-bottom: 12px;
}

.gf-level-progress {
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 6px;
}

.gf-level-fill {
  height: 100%;
  background: linear-gradient(90deg, #ffd700, #ff7a1a);
  border-radius: 999px;
  transition: width 0.5s ease;
}

.gf-level-text {
  font-size: 11px;
  color: #b8a99e;
  display: flex;
  justify-content: space-between;
}

/* ─── Daily Quest Card ─── */
.gf-quest-card {
  background: linear-gradient(135deg, #1b2a1b 0%, #162316 100%);
  border: 1px solid rgba(76, 175, 80, 0.3);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25);
}

.gf-quest-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.gf-quest-icon {
  font-size: 20px;
}

.gf-quest-title {
  font-size: 14px;
  font-weight: 700;
  color: #4CAF50;
}

.gf-quest-desc {
  font-size: 14px;
  color: #e0e0e0;
  margin-bottom: 10px;
}

.gf-quest-progress {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 6px;
}

.gf-quest-fill {
  height: 100%;
  background: linear-gradient(90deg, #4CAF50, #8BC34A);
  border-radius: 999px;
  transition: width 0.4s ease;
}

.gf-quest-reward {
  font-size: 12px;
  color: #b8a99e;
}

.gf-quest-done {
  color: #4CAF50;
  font-weight: 700;
}

/* ─── Streak Card ─── */
.gf-streak-card {
  background: linear-gradient(135deg, #2a1d16, #3a2417);
  border: 1px solid rgba(255, 69, 0, 0.25);
  border-radius: 18px;
  padding: 18px;
}

.gf-streak-number {
  font-size: 36px;
  font-weight: 800;
  color: #ff7a1a;
  line-height: 1;
}

.gf-streak-label {
  font-size: 13px;
  color: #b8a99e;
  margin-bottom: 6px;
}

.gf-streak-longest {
  font-size: 11px;
  color: #888;
}

/* ─── Achievements Grid ─── */
.gf-achievements {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.gf-ach-badge {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 22px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.2s;
  cursor: default;
  position: relative;
}

.gf-ach-badge.locked {
  filter: grayscale(1) brightness(0.4);
}

.gf-ach-badge:not(.locked):hover {
  transform: scale(1.15);
}

.gf-ach-badge:not(.locked) {
  border-color: rgba(255, 215, 0, 0.35);
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.15);
}

/* Tooltip on hover */
.gf-ach-badge::after {
  content: attr(title);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a2e;
  color: #f5eee7;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 11px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.gf-ach-badge:hover::after {
  opacity: 1;
}
