/* ════════════════════════════════════════════════════════════════════
   Lunolabs Learn — Animation Library — Base Tokens & Utilities
   ════════════════════════════════════════════════════════════════════
   Wird einmal pro Lesson geladen. Komponenten greifen auf diese
   Custom Properties zu. Keine globalen Element-Selektoren, alles
   im .ll- Namespace.
   ════════════════════════════════════════════════════════════════════ */

:where(:root) {
  --ll-navy:        #0B1E3F;
  --ll-navy-2:      #0F2240;
  --ll-cyan:        #22D3EE;
  --ll-cyan-soft:   #A5F3FC;
  --ll-yellow:      #FBBF24;
  --ll-orange:      #F97316;
  --ll-pink:        #EC4899;
  --ll-red:         #EF4444;
  --ll-success:     #22C55E;
  --ll-text:        #F6F9FC;
  --ll-text-muted:  #94A8C3;
  --ll-bg-card:     rgba(11, 30, 63, 0.55);
  --ll-bg-card-strong: rgba(11, 30, 63, 0.85);
  --ll-border:      rgba(34, 211, 238, 0.18);
  --ll-border-strong: rgba(34, 211, 238, 0.45);

  --ll-radius:      14px;
  --ll-radius-sm:   8px;
  --ll-radius-xs:   4px;
  --ll-shadow:      0 8px 28px rgba(0, 0, 0, 0.18);
  --ll-shadow-strong: 0 16px 48px rgba(0, 0, 0, 0.32);

  --ll-font:        'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ll-mono:        'JetBrains Mono', "SF Mono", Menlo, Consolas, monospace;

  --ll-ease:        cubic-bezier(0.16, 1, 0.3, 1);
  --ll-ease-back:   cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ─── Container für jede Komponente ─── */
[data-lunolabs] {
  display: block;
  margin: 1.5em 0;
  font-family: var(--ll-font);
  color: var(--ll-text);
  -webkit-font-smoothing: antialiased;
  box-sizing: border-box;
}
[data-lunolabs] *,
[data-lunolabs] *::before,
[data-lunolabs] *::after {
  box-sizing: border-box;
}

/* ─── Loading-State (während JS bootet) ─── */
[data-lunolabs]:not(.ll-ready) {
  min-height: 240px;
  background:
    linear-gradient(90deg,
      rgba(34, 211, 238, 0.06) 0%,
      rgba(34, 211, 238, 0.12) 50%,
      rgba(34, 211, 238, 0.06) 100%);
  background-size: 200% 100%;
  animation: llSkeleton 1.6s ease-in-out infinite;
  border-radius: var(--ll-radius);
  border: 1px solid var(--ll-border);
}
@keyframes llSkeleton {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── Gemeinsame Hülle (Card-Style für alle Komponenten) ─── */
.ll-card {
  background: linear-gradient(135deg,
    rgba(15, 34, 64, 0.92) 0%,
    rgba(11, 30, 63, 0.88) 100%);
  border: 1px solid var(--ll-border);
  border-radius: var(--ll-radius);
  box-shadow: var(--ll-shadow);
  padding: 1.4em 1.5em;
  overflow: hidden;
  position: relative;
}
.ll-card::before {
  /* dezenter Cyan-Glow oben */
  content: '';
  position: absolute;
  inset: -1px -1px auto -1px;
  height: 60px;
  background: linear-gradient(to bottom,
    rgba(34, 211, 238, 0.10) 0%,
    transparent 100%);
  pointer-events: none;
}

/* ─── Header pro Komponente ─── */
.ll-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 0.9em;
  position: relative;
}
.ll-header__eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ll-cyan);
  padding: 3px 8px;
  background: rgba(34, 211, 238, 0.12);
  border: 1px solid rgba(34, 211, 238, 0.28);
  border-radius: 999px;
  flex-shrink: 0;
}
.ll-header__title {
  font-size: 16px;
  font-weight: 700;
  color: var(--ll-text);
  margin: 0;
  letter-spacing: -0.01em;
}
.ll-header__hint {
  margin-left: auto;
  font-size: 12px;
  color: var(--ll-text-muted);
  font-weight: 500;
}

/* ─── Common Buttons ─── */
.ll-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--ll-cyan);
  color: var(--ll-navy);
  border: 0;
  border-radius: var(--ll-radius-sm);
  font-family: var(--ll-font);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s var(--ll-ease), box-shadow 0.15s, background 0.15s;
}
.ll-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(34, 211, 238, 0.35);
}
.ll-btn:active { transform: translateY(0); }
.ll-btn--ghost {
  background: transparent;
  color: var(--ll-cyan);
  border: 1px solid var(--ll-border-strong);
}
.ll-btn--ghost:hover { background: rgba(34, 211, 238, 0.10); box-shadow: none; }
.ll-btn--warm {
  background: linear-gradient(135deg, var(--ll-yellow) 0%, var(--ll-orange) 100%);
  color: var(--ll-navy);
}

/* ─── Common Inputs ─── */
.ll-input {
  display: block;
  width: 100%;
  padding: 11px 14px;
  background: rgba(11, 30, 63, 0.7);
  border: 1px solid var(--ll-border);
  border-radius: var(--ll-radius-sm);
  color: var(--ll-text);
  font-family: var(--ll-font);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.ll-input::placeholder { color: var(--ll-text-muted); }
.ll-input:focus {
  border-color: var(--ll-border-strong);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.14);
  background: rgba(11, 30, 63, 0.92);
}

/* ─── Code/Mono ─── */
.ll-mono {
  font-family: var(--ll-mono);
  font-feature-settings: "tnum" 1, "ss01" 1;
}

/* ─── Pulse/Pop-Hilfsanimationen (für Highlights) ─── */
@keyframes llPop {
  0%   { transform: scale(0.6); opacity: 0; }
  60%  { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); }
}
@keyframes llPulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.0); }
  50%      { box-shadow: 0 0 0 6px rgba(34, 211, 238, 0.20); }
}
@keyframes llFadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.ll-pop  { animation: llPop 0.4s var(--ll-ease-back); }
.ll-fade { animation: llFadeUp 0.35s var(--ll-ease); }

/* ─── Reduced-Motion ─── */
@media (prefers-reduced-motion: reduce) {
  [data-lunolabs] *,
  [data-lunolabs] *::before,
  [data-lunolabs] *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
