/* ========== GAMIFIKATION CSS ========== */
.badges-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 12px;
  padding: 20px;
  margin-bottom: 24px;
}

.badge-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  transition: all 0.3s ease;
}

.badge-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.badge-card.locked {
  opacity: 0.5;
  cursor: not-allowed;
}

.badge-card.locked:hover {
  transform: none;
  box-shadow: none;
}

.badge-icon {
  font-size: 32px;
  margin-bottom: 12px;
  display: block;
}

.badge-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.badge-description {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.badge-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.badge-progress-bar {
  height: 4px;
  background: var(--bg-tertiary);
  border-radius: 2px;
  flex: 1;
}

.badge-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.badge-progress-text {
  font-size: 11px;
  color: var(--text-secondary);
}

.badge-locked-icon {
  font-size: 16px;
  margin-top: 8px;
  color: var(--text-muted);
  display: block;
}

/* ========== LEVEL-UI ========== */
.level-container {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 24px;
  text-align: center;
}

.level-badge {
  font-size: 48px;
  margin-bottom: 16px;
  display: block;
  animation: bounce 0.5s ease;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.level-title {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.level-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.level-progress {
  background: var(--bg-tertiary);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
}

.level-progress-bar {
  height: 8px;
  background: var(--bg-primary);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 12px;
}

.level-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.level-progress-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
}

.level-xp {
  font-size: 16px;
  color: var(--accent);
  font-weight: 600;
  text-align: center;
  margin-bottom: 20px;
}

.level-reward {
  background: var(--accent-glow);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 12px 24px;
  margin-top: 16px;
  font-size: 14px;
  color: var(--text-primary);
}

/* ========== STREAK-UI ========== */
.streak-container {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 24px;
}

.streak-icon {
  font-size: 32px;
}

.streak-info {
  flex: 1;
}

.streak-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.streak-count {
  font-size: 32px;
  font-weight: 700;
  color: var(--accent);
}

.streak-label {
  font-size: 12px;
  color: var(--text-secondary);
}

.streak-flame {
  font-size: 24px;
  animation: flicker 2s infinite;
}

@keyframes flicker {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* ========== ACHIEVEMENT-UI ========== */
.achievement-container {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 24px;
}

.achievement-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 400px;
  overflow-y: auto;
}

.achievement-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: all 0.2s ease;
}

.achievement-item:hover {
  border-left: 4px solid var(--accent);
}

.achievement-item.unlocked {
  border-left: 4px solid var(--success);
}

.achievement-item.locked {
  border-left: 4px solid var(--text-muted);
  opacity: 0.5;
}

.achievement-icon {
  font-size: 24px;
}

.achievement-info {
  flex: 1;
}

.achievement-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.achievement-description {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ========== NOTIFICATION-UI ========== */
.notification-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  max-width: 400px;
}

.notification {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.notification.success {
  border-left: 4px solid var(--success);
}

.notification.achievement {
  border-left: 4px solid var(--accent);
}

.notification.level-up {
  border-left: 4px solid var(--badge);
}

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

.notification-icon {
  font-size: 20px;
}

.notification-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.notification-message {
  font-size: 13px;
  color: var(--text-secondary);
}

.notification-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--bg-tertiary);
  border: none;
  color: var(--text-muted);
  border-radius: 4px;
  width: 24px;
  height: 24px;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notification-close:hover {
  background: var(--border);
  color: var(--text-primary);
}

/* ========== ACHIEVEMENT-TOAST ========== */
.achievement-toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  animation: toastSlideIn 0.3s ease;
  z-index: 1000;
}

@keyframes toastSlideIn {
  from {
    transform: translateY(100px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.achievement-icon {
  font-size: 24px;
}

.achievement-message {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.achievement-close {
  margin-left: auto;
  background: var(--bg-tertiary);
  border: none;
  color: var(--text-muted);
  border-radius: 4px;
  width: 24px;
  height: 24px;
  cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

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

  .badge-card {
    padding: 12px;
  }

  .level-container {
    padding: 16px;
  }

  .streak-container {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }

  .achievement-list {
    max-height: 300px;
  }

  .achievement-toast {
    left: 30px;
    right: 30px;
  }
}

/* ========== THEME: LIGHT ========== */
.theme-light {
  --bg-primary: #f8fafc;
  --bg-secondary: #f1f5f9;
  --bg-tertiary: #e2e8f0;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border: #cbd5e1;
  --accent: #2563eb;
  --accent-dim: #1d4ed8;
  --accent-glow: rgba(37, 99, 235, 0.1);
  --success: #16a34a;
  --warning: #ca8a04;
  --danger: #dc2626;
  --code-bg: #f1f5f9;
  --inline-code-bg: #f1f5f9;
  --inline-code-border: #cbd5e1;
}

/* ========== THEME: DARK ========== */
.theme-dark {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  --border: #475569;
  --accent: #00d4aa;
  --accent-dim: #00a386;
  --accent-glow: rgba(0, 212, 170, 0.15);
  --success: #22c55e;
  --warning: #eab308;
  --danger: #ef4444;
  --code-bg: #1e293b;
  --inline-code-bg: #334155;
  --inline-code-border: #475569;
}
