/* Welcome-Onboarding-Modul Styles
   Nutzt CSS-Variablen aus landing-v4.css (Dark-Mode automatisch) */

/* === Overlay & Modal === */
.welcome-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  animation: welcome-fade-in 200ms ease-out forwards;
}
.welcome-overlay.welcome-closing {
  animation: welcome-fade-out 200ms ease-in forwards;
}

.welcome-modal {
  position: relative;
  background: var(--bg, #ffffff);
  color: var(--text, #1e293b);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
  padding: 40px 36px 32px;
  max-width: 480px;
  width: calc(100% - 32px);
  text-align: center;
  transform: scale(0.92);
  opacity: 0;
  animation: welcome-modal-in 400ms 100ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.welcome-overlay.welcome-closing .welcome-modal {
  animation: welcome-modal-out 200ms ease-in forwards;
}

:root[data-theme="dark"] .welcome-modal {
  background: var(--bg-card, #1e293b);
  color: var(--text, #f1f5f9);
}

.welcome-close {
  position: absolute; top: 12px; right: 16px;
  background: transparent; border: 0;
  font-size: 28px; line-height: 1;
  color: currentColor; opacity: 0.5;
  cursor: pointer; padding: 4px 8px;
  transition: opacity 150ms;
}
.welcome-close:hover { opacity: 1; }

.welcome-logo {
  width: 64px; height: 64px;
  margin: 0 auto 16px;
  animation: welcome-pulse 1s 400ms ease-in-out 3;
  opacity: 0;
  animation-fill-mode: forwards;
}

.welcome-title {
  margin: 0 0 8px;
  font-size: 1.75rem;
  font-weight: 700;
  opacity: 0;
  transform: translateY(20px);
  animation: welcome-slide-up 400ms 500ms ease-out forwards;
}

.welcome-subtitle {
  margin: 0 0 24px;
  font-size: 1rem;
  color: var(--text-muted, #64748b);
  opacity: 0;
  transform: translateY(20px);
  animation: welcome-slide-up 400ms 600ms ease-out forwards;
}

.welcome-cards {
  display: grid;
  gap: 12px;
  margin: 0 0 24px;
}
.welcome-card {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: var(--bg-subtle, #f8fafc);
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  text-align: left;
  opacity: 0;
  transform: translateY(20px);
  animation: welcome-slide-up 400ms ease-out forwards;
  animation-delay: calc(700ms + var(--stagger, 0ms));
  transition: transform 150ms, box-shadow 150ms;
}
.welcome-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
:root[data-theme="dark"] .welcome-card { background: rgba(255,255,255,0.06); }
.welcome-card strong { display: block; font-size: 0.95rem; margin-bottom: 2px; }
.welcome-card span { font-size: 0.85rem; color: var(--text-muted, #64748b); }

.welcome-cta {
  background: var(--accent, #d4a03e);
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 14px 32px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px);
  animation: welcome-slide-up 400ms 1000ms ease-out forwards;
  transition: transform 150ms, filter 150ms;
}
.welcome-cta:hover { filter: brightness(1.05); transform: translateY(-1px); }

/* Subtiler Tour-Discovery-Hint im Modal */
.welcome-tour-hint {
  margin: 0 0 16px;
  font-size: 12px;
  color: var(--text-muted, #64748b);
  opacity: 0;
  transform: translateY(20px);
  animation: welcome-slide-up 400ms 900ms ease-out forwards;
}
.welcome-tour-hint strong { color: var(--accent, #d4a03e); }

/* === Confetti === */
.welcome-confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10000;
}

/* === Activation-Checkliste === */
.welcome-checklist {
  position: fixed;
  /* Bottom 110px reserviert Platz für Cube-Assistant (56px Höhe, top: calc(100vh - 84px)) */
  bottom: 110px;
  right: 24px;
  width: 360px;
  max-width: calc(100vw - 32px);
  background: var(--bg, #ffffff);
  color: var(--text, #1e293b);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.15);
  z-index: 9998;
  opacity: 0;
  transform: translateX(120%);
  animation: welcome-slide-in-right 400ms ease-out forwards;
}
:root[data-theme="dark"] .welcome-checklist {
  background: var(--bg-card, #1e293b);
  color: var(--text, #f1f5f9);
}
.welcome-checklist.welcome-closing {
  animation: welcome-slide-out-right 400ms ease-in forwards;
}

.welcome-checklist-header {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border, #e2e8f0);
  cursor: pointer;
}
.welcome-checklist-header strong { flex: 1; font-size: 0.95rem; }
.welcome-checklist-count {
  background: var(--accent, #d4a03e);
  color: #fff;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}
.welcome-checklist-close {
  background: transparent; border: 0;
  font-size: 22px; cursor: pointer;
  color: currentColor; opacity: 0.5;
  padding: 0 4px; line-height: 1;
}
.welcome-checklist-close:hover { opacity: 1; }

.welcome-checklist-items {
  list-style: none;
  margin: 0; padding: 8px 0;
  max-height: 360px;
  overflow-y: auto;
}
.welcome-checklist-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 20px;
}
.welcome-check {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border, #cbd5e1);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background 300ms, border-color 300ms;
}
.welcome-check svg {
  width: 14px; height: 14px;
  color: #fff;
  stroke-dasharray: 30;
  stroke-dashoffset: 30;
}
.welcome-checklist-item.is-done .welcome-check {
  background: var(--accent, #d4a03e);
  border-color: var(--accent, #d4a03e);
}
.welcome-checklist-item.is-done .welcome-check svg {
  animation: welcome-check-draw 400ms ease-out forwards;
}
.welcome-check-label { flex: 1; font-size: 0.92rem; position: relative; }
.welcome-checklist-item.is-done .welcome-check-label {
  color: var(--text-muted, #94a3b8);
}
.welcome-checklist-item.is-done .welcome-check-label::after {
  content: '';
  position: absolute; top: 50%; left: 0;
  height: 1.5px; background: currentColor;
  width: 100%;
  transform: scaleX(0);
  transform-origin: left;
  animation: welcome-strike 300ms 200ms ease-out forwards;
}
.welcome-check-cta {
  background: var(--bg-subtle, #f1f5f9);
  color: var(--accent, #d4a03e);
  padding: 4px 10px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}
.welcome-check-cta:hover { filter: brightness(0.96); }

.welcome-checklist-complete .welcome-checklist-header {
  background: linear-gradient(90deg, var(--accent, #d4a03e), #f4c97a);
  color: #fff;
}

/* === Keyframes === */
@keyframes welcome-fade-in { to { opacity: 1; } }
@keyframes welcome-fade-out { to { opacity: 0; } }
@keyframes welcome-modal-in { to { transform: scale(1); opacity: 1; } }
@keyframes welcome-modal-out { to { transform: scale(0.95); opacity: 0; } }
@keyframes welcome-slide-up { to { transform: translateY(0); opacity: 1; } }
@keyframes welcome-slide-in-right { to { transform: translateX(0); opacity: 1; } }
@keyframes welcome-slide-out-right { to { transform: translateX(120%); opacity: 0; } }
@keyframes welcome-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 1; }
}
@keyframes welcome-check-draw { to { stroke-dashoffset: 0; } }
@keyframes welcome-strike { to { transform: scaleX(1); } }

/* === Mobile === */
@media (max-width: 767px) {
  .welcome-modal {
    padding: 32px 24px 24px;
    max-width: 100%;
  }
  .welcome-checklist {
    bottom: 0; right: 0; left: 0;
    width: 100%; max-width: 100%;
    border-radius: 12px 12px 0 0;
    transform: translateY(100%);
    animation: welcome-slide-in-bottom 400ms ease-out forwards;
  }
  .welcome-checklist.welcome-closing {
    animation: welcome-slide-out-bottom 400ms ease-in forwards;
  }
  .welcome-checklist.welcome-checklist-collapsed .welcome-checklist-items { display: none; }
  .welcome-checklist.welcome-checklist-collapsed { width: auto; left: auto; right: 16px; }
}
@keyframes welcome-slide-in-bottom { to { transform: translateY(0); opacity: 1; } }
@keyframes welcome-slide-out-bottom { to { transform: translateY(100%); opacity: 0; } }

/* === Reduced Motion === */
@media (prefers-reduced-motion: reduce) {
  .welcome-overlay, .welcome-modal, .welcome-logo, .welcome-title,
  .welcome-subtitle, .welcome-card, .welcome-cta, .welcome-checklist,
  .welcome-check svg, .welcome-check-label::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
  .welcome-confetti { display: none; }
}

/* Sub-Touren Welcome-Modal Secondary-CTA */
.welcome-cta-group {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 16px 0 8px 0;
}
.welcome-cta-secondary {
  background: transparent;
  border: 1px solid var(--text-muted, #9ca3af);
  color: var(--text, #111827);
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.welcome-cta-secondary:hover {
  background: rgba(0,0,0,0.04);
  border-color: var(--text, #111827);
}
.welcome-snooze-toggle {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-muted, #6b7280);
  margin-top: 8px; cursor: pointer; user-select: none;
}
.welcome-snooze-toggle input { margin: 0; }

.welcome-card { position: relative; }
.card-completed-badge {
  position: absolute; top: 8px; right: 8px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #16a34a; color: white;
  display: flex; align-items: center; justify-content: center;
}

/* Workflow-Cards im Help-Modal */
.help-workflows h3 { color: var(--text-muted, #6b7280); }
/* Workflow-Cards nutzen die Projekt-Design-Tokens (--bg-card, --ink, --border-light),
   damit Light- UND Dark-Theme (data-theme="dark") automatisch matchen — kein eigener
   prefers-color-scheme-Override (verursachte vorher dunkelblauen Fremd-Look). */
.workflow-cards-list { display: flex; flex-direction: column; gap: 8px; }
.workflow-card {
  display: flex; align-items: center; gap: 12px;
  padding: 12px;
  border: 1px solid var(--border-light, #EDEBE5);
  border-radius: 10px;
  background: var(--bg-card, #FFFFFF);
  color: var(--ink, #1B1918);
  cursor: pointer; text-align: left; width: 100%;
  font-family: inherit; font-size: inherit;
  transition: border-color 0.15s, transform 0.15s;
}
.workflow-card:hover {
  border-color: var(--gold, #B8860B);
  transform: translateY(-1px);
}
.workflow-card:focus-visible { outline: 2px solid var(--gold, #B8860B); outline-offset: 2px; }
.workflow-card .wc-icon {
  flex-shrink: 0; width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  background: var(--border-light, #EDEBE5);
  color: var(--ink-4, #A9A39B);
  font-size: 18px;
}
.workflow-card .wc-text { flex: 1; min-width: 0; }
.workflow-card .wc-title { font-weight: 600; font-size: 14px; margin-bottom: 2px; color: var(--ink, #1B1918); }
.workflow-card .wc-desc { font-size: 12px; color: var(--ink-4, #A9A39B); }
.workflow-card .wc-badge {
  flex-shrink: 0; font-size: 11px; font-weight: 600;
  padding: 3px 8px; border-radius: 999px;
}
.workflow-card .wc-badge-done { background: rgba(13,148,136,0.12); color: var(--teal, #0D9488); display: inline-flex; align-items: center; }
.workflow-card .wc-badge-updated { background: rgba(184,134,11,0.12); color: var(--gold, #B8860B); }
