/* ============================================
   GAMIFICATION STYLES
   ============================================ */

/* === Question of the Day Widget === */
.qotd-widget {
  padding: 24px !important;
  margin-bottom: var(--space-xl);
  border-radius: var(--radius-xl) !important;
  border: 1px solid rgba(251, 191, 36, 0.15) !important;
  background: linear-gradient(145deg, rgba(251,191,36,0.04), var(--glass-bg)) !important;
}

.qotd-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.qotd-badge {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.qotd-title {
  font-weight: 800;
  font-size: 16px;
  color: var(--text-primary);
}

.qotd-domain {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.qotd-xp {
  margin-left: auto;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-gold);
  background: rgba(251, 191, 36, 0.1);
  padding: 4px 12px;
  border-radius: 20px;
}

.qotd-question {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.qotd-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.qotd-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.5;
  text-align: left;
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: var(--font-family);
}

.qotd-option:hover {
  border-color: var(--accent-gold);
  background: rgba(251, 191, 36, 0.06);
  transform: translateX(4px);
}

.qotd-option-letter {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.qotd-result {
  margin-left: auto;
  font-size: 13px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
}

.qotd-result.correct {
  color: var(--success);
  background: rgba(34, 197, 94, 0.1);
}

.qotd-result.incorrect {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

.qotd-answer {
  font-size: 13px;
  color: var(--success);
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(34, 197, 94, 0.06);
  border: 1px solid rgba(34, 197, 94, 0.15);
  margin-bottom: 8px;
}

.qotd-explanation {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* === Level Bar === */
.level-bar-container {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(128, 128, 128, 0.1);
}

.level-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.level-current {
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.level-xp {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.level-bar-track {
  height: 8px;
  border-radius: 4px;
  background: var(--bg-tertiary);
  overflow: hidden;
}

.level-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.level-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(to bottom, rgba(255,255,255,0.15), transparent);
  border-radius: 4px 4px 0 0;
}

.level-next {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 6px;
  text-align: right;
}

/* === Badge Grid === */
.badge-section {
  margin-top: var(--space-lg);
}

.badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 12px;
}

.badge-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 8px;
  border-radius: 14px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  transition: all 0.3s ease;
  cursor: default;
}

.badge-card.earned {
  background: var(--bg-secondary);
}

.badge-card.earned:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.badge-card.locked {
  opacity: 0.35;
  filter: grayscale(0.8);
}

.badge-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  border: 2px solid var(--border-color);
  color: var(--text-dim);
  transition: all 0.3s ease;
}

.badge-card.earned .badge-icon {
  box-shadow: 0 0 16px currentColor;
}

.badge-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.3;
}

.badge-card.earned .badge-name {
  color: var(--text-primary);
}

/* === Badge Toast Notification === */
.badge-toast {
  position: fixed;
  bottom: 24px;
  right: -400px;
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 24px;
  border-radius: 16px;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(251, 191, 36, 0.25);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
  transition: right 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 340px;
}

.badge-toast.show {
  right: 24px;
}

.badge-toast-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  animation: badgePulse 1s ease infinite;
}

.badge-toast-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-gold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.badge-toast-name {
  font-size: 16px;
  font-weight: 800;
  margin: 2px 0;
}

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

@keyframes badgePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

/* === Responsive === */
@media (max-width: 768px) {
  .badge-grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
  }

  .badge-card {
    padding: 12px 6px;
  }

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

  .badge-toast {
    bottom: 12px;
    right: -400px;
    max-width: 300px;
  }

  .badge-toast.show {
    right: 12px;
  }

  .qotd-header {
    flex-wrap: wrap;
  }
}

/* === Light Theme === */
[data-theme="light"] .qotd-widget {
  background: linear-gradient(145deg, rgba(251,191,36,0.03), #fff) !important;
}

[data-theme="light"] .badge-toast {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(251, 191, 36, 0.3);
}
