/* Progress & Gamification UI */

/* --- Progress Panel (compact bar above variants) --- */

.neuroege-progress-panel {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.06);
  background: rgba(15, 23, 42, 0.25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 12px;
  min-height: 34px;
}

.neuroege-progress-panel__xp {
  font-weight: 600;
  color: #f59e0b;
  white-space: nowrap;
}

.neuroege-progress-panel__streak {
  font-weight: 600;
  color: #ef4444;
  white-space: nowrap;
}

.neuroege-progress-bar {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.neuroege-progress-bar__track {
  flex: 1 1 auto;
  height: 6px;
  border-radius: 3px;
  background: rgba(148, 163, 184, 0.15);
  overflow: hidden;
}

.neuroege-progress-bar__fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #2563eb, #7c3aed);
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 0;
}

.neuroege-progress-bar__label {
  font-size: 11px;
  color: #94a3b8;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.neuroege-progress-panel__badges {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}

/* --- Badges --- */

.neuroege-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 12px;
  opacity: 0.25;
  filter: grayscale(1);
  transition: all 0.3s ease;
}

.neuroege-badge--earned {
  opacity: 1;
  filter: none;
  animation: neuroege-badge-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes neuroege-badge-pop {
  0% { transform: scale(0.5); }
  60% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* --- Badge Toast --- */

.neuroege-badge-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(124, 58, 237, 0.3);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(124, 58, 237, 0.1);
  color: #f1f5f9;
  font-size: 14px;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.neuroege-badge-toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.neuroege-badge-toast__icon {
  font-size: 24px;
  animation: neuroege-badge-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both;
}

.neuroege-badge-toast__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.neuroege-badge-toast__text strong {
  font-weight: 600;
  color: #e2e8f0;
}

.neuroege-badge-toast__desc {
  font-size: 12px;
  color: #94a3b8;
}

/* --- Variant chip solved mark --- */

.libreoffice-task9-chip--solved::after {
  content: "✓";
  position: absolute;
  top: -3px;
  right: -3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #10b981;
  color: white;
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.libreoffice-task9-chip {
  position: relative;
}

/* --- Light theme overrides --- */

[data-theme="light"] .neuroege-progress-panel,
:root:not([data-theme="dark"]) .neuroege-progress-panel {
  background: rgba(248, 250, 252, 0.8);
  border-bottom-color: rgba(148, 163, 184, 0.2);
}

[data-theme="light"] .neuroege-progress-bar__track {
  background: rgba(148, 163, 184, 0.2);
}

[data-theme="light"] .neuroege-badge-toast {
  background: rgba(255, 255, 255, 0.97);
  border-color: rgba(124, 58, 237, 0.2);
  color: #1e293b;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .neuroege-badge-toast__text strong {
  color: #1e293b;
}

/* --- Responsive --- */

@media (max-width: 600px) {
  .neuroege-progress-panel {
    gap: 8px;
    padding: 4px 8px;
    font-size: 11px;
  }

  .neuroege-progress-panel__badges {
    display: none;
  }

  .neuroege-badge-toast {
    left: 12px;
    right: 12px;
    transform: translateX(0) translateY(20px);
    bottom: 12px;
  }

  .neuroege-badge-toast--visible {
    transform: translateX(0) translateY(0);
  }
}
