/**
 * FizzyPeak — Global Polish Layer (2026-04-24)
 * Ergänzt base.css / components.css / layout.css mit einheitlichen
 * Pattern-Klassen + Micro-Polish die in allen Tabs konsistent wirken.
 *
 * Wird NACH den anderen Stylesheets geladen → überschreibt inline-Drift.
 */

/* ───────────────────────────────────────────────────────
   1. FOCUS-VISIBLE — konsistente Keyboard-Navigation
   ─────────────────────────────────────────────────────── */
*:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
button:focus:not(:focus-visible),
a:focus:not(:focus-visible),
input:focus:not(:focus-visible) { outline: none; }

/* ───────────────────────────────────────────────────────
   2. SCROLLBARS — subtile, markengerechte
   ─────────────────────────────────────────────────────── */
* { scrollbar-width: thin; scrollbar-color: rgba(167, 139, 250, 0.3) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: rgba(167, 139, 250, 0.2);
  border-radius: 100px;
  border: 2px solid transparent;
  background-clip: padding-box;
  transition: background var(--transition-fast);
}
*::-webkit-scrollbar-thumb:hover { background: rgba(167, 139, 250, 0.4); background-clip: padding-box; }

/* ───────────────────────────────────────────────────────
   3. SECTION-HEADING — einheitliches Pattern
   ─────────────────────────────────────────────────────── */
.section-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 var(--space-md, 16px);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--color-text);
}
.section-heading::before {
  content: '';
  width: 3px;
  height: 18px;
  background: var(--gradient-primary);
  border-radius: 100px;
  flex-shrink: 0;
}
.section-heading .section-heading-title { flex: 1; }
.section-heading .section-heading-action { margin-left: auto; }
.section-sub {
  color: var(--color-text-muted);
  font-size: 0.875rem;
  margin: -8px 0 var(--space-md);
  line-height: 1.55;
}

/* ───────────────────────────────────────────────────────
   4. CONFIG-ROW — Label links, Control rechts
   ─────────────────────────────────────────────────────── */
.config-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}
.config-row:hover { border-color: var(--color-border-light); background: rgba(255, 255, 255, 0.025); }
.config-row-label { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.config-row-label strong { font-weight: 600; font-size: 0.9375rem; color: var(--color-text); }
.config-row-label span { font-size: 0.8125rem; color: var(--color-text-muted); line-height: 1.4; }
.config-row-control { flex-shrink: 0; }

/* ───────────────────────────────────────────────────────
   5. CHIPS — einheitliche Feature-/Status-Chips
   ─────────────────────────────────────────────────────── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.4;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--color-text-muted);
  white-space: nowrap;
}
.chip-success { background: rgba(16, 185, 129, 0.12); border-color: rgba(16, 185, 129, 0.3); color: #34d399; }
.chip-warning { background: rgba(245, 158, 11, 0.12); border-color: rgba(245, 158, 11, 0.3); color: #fbbf24; }
.chip-danger  { background: rgba(239, 68, 68, 0.12);  border-color: rgba(239, 68, 68, 0.3);  color: #f87171; }
.chip-info    { background: rgba(59, 130, 246, 0.12); border-color: rgba(59, 130, 246, 0.3); color: #60a5fa; }
.chip-ai      { background: rgba(99, 102, 241, 0.12); border-color: rgba(99, 102, 241, 0.3); color: #818cf8; }
.chip-clip    { background: rgba(249, 115, 22, 0.12); border-color: rgba(249, 115, 22, 0.3); color: #fb923c; }
.chip-pro     { background: rgba(236, 72, 153, 0.12); border-color: rgba(236, 72, 153, 0.3); color: #f472b6; }
.chip-live    { background: rgba(239, 68, 68, 0.15);  border-color: rgba(239, 68, 68, 0.4);  color: #ef4444; }
.chip-live::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; box-shadow: 0 0 8px currentColor;
  animation: chipLivePulse 1.4s ease-in-out infinite;
}
@keyframes chipLivePulse { 0%,100% { opacity: 1; } 50% { opacity: .4; } }

/* ───────────────────────────────────────────────────────
   6. STAT-CARD — Zahl + Label prominent
   ─────────────────────────────────────────────────────── */
.stat-card {
  padding: 18px 20px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  overflow: hidden;
  transition: border-color var(--transition-fast), transform var(--transition-fast);
}
.stat-card::before {
  content: '';
  position: absolute; inset: 0;
  background: var(--gradient-subtle);
  opacity: 0;
  transition: opacity var(--transition-fast);
  pointer-events: none;
}
.stat-card:hover { border-color: rgba(167, 139, 250, 0.3); transform: translateY(-1px); }
.stat-card:hover::before { opacity: 1; }
.stat-card-label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-dim);
  position: relative; z-index: 1;
}
.stat-card-value {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  line-height: 1.1;
  color: var(--color-text);
  position: relative; z-index: 1;
}
.stat-card-delta {
  font-size: 0.75rem;
  font-weight: 600;
  position: relative; z-index: 1;
}
.stat-card-delta.positive { color: var(--color-success); }
.stat-card-delta.negative { color: var(--color-danger); }

/* ───────────────────────────────────────────────────────
   7. EMPTY-STATE — verbessert: Icon-Orb + CTA
   ─────────────────────────────────────────────────────── */
.empty-state {
  padding: 48px 24px;
  text-align: center;
  background: rgba(255, 255, 255, 0.015);
  border: 1px dashed rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
}
.empty-state-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  background: var(--gradient-subtle);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  border: 1px solid rgba(167, 139, 250, 0.2);
  color: var(--color-accent);
}
.empty-state h3 {
  font-size: 1.0625rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--color-text);
}
.empty-state p {
  color: var(--color-text-muted);
  font-size: 0.875rem;
  max-width: 420px;
  margin: 0 auto 20px;
  line-height: 1.55;
}

/* ───────────────────────────────────────────────────────
   8. CARD — subtiler Hover-Lift (überall konsistent)
   ─────────────────────────────────────────────────────── */
.card {
  transition: border-color var(--transition, 220ms) ease, transform var(--transition, 220ms) ease, box-shadow var(--transition, 220ms) ease;
}
.card.card-interactive {
  cursor: pointer;
}
.card.card-interactive:hover {
  transform: translateY(-2px);
  border-color: rgba(167, 139, 250, 0.35);
  box-shadow: 0 16px 36px -16px rgba(124, 58, 237, 0.35);
}

/* ───────────────────────────────────────────────────────
   9. SKELETON — Loading-States statt Spinner (wenn möglich)
   ─────────────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg,
    rgba(255,255,255,0.04) 0%,
    rgba(255,255,255,0.08) 50%,
    rgba(255,255,255,0.04) 100%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.4s ease-in-out infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeletonShimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-text { height: 14px; margin-bottom: 8px; width: 80%; }
.skeleton-text-short { width: 40%; }
.skeleton-card { height: 140px; }

/* ───────────────────────────────────────────────────────
   10. TOAST — wenn tabs ihre eigenen Toasts machen
   ─────────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  padding: 12px 16px;
  background: rgba(20, 20, 31, 0.95);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(12px);
  min-width: 260px;
  max-width: 420px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
  color: var(--color-text);
  animation: toastSlideIn 220ms cubic-bezier(.22, 1, .36, 1);
  pointer-events: auto;
}
.toast-success { border-left: 3px solid var(--color-success); }
.toast-error   { border-left: 3px solid var(--color-danger); }
.toast-warning { border-left: 3px solid var(--color-warning); }
.toast-info    { border-left: 3px solid var(--color-info); }
@keyframes toastSlideIn { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ───────────────────────────────────────────────────────
   11. FORM-INPUT — soft Focus-Ring überall
   ─────────────────────────────────────────────────────── */
.form-input:focus, .form-select:focus, input[type="text"]:focus, input[type="email"]:focus,
input[type="password"]:focus, input[type="number"]:focus, input[type="url"]:focus, textarea:focus {
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.15);
  border-color: var(--color-accent);
  outline: none;
}

/* ───────────────────────────────────────────────────────
   12. DIVIDER
   ─────────────────────────────────────────────────────── */
.divider-soft {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-border-light), transparent);
  margin: var(--space-lg) 0;
  border: none;
}

/* ───────────────────────────────────────────────────────
   13. HELP-TEXT / TOOLTIP-LIKE
   ─────────────────────────────────────────────────────── */
.help-text {
  padding: 12px 14px;
  background: rgba(59, 130, 246, 0.06);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  line-height: 1.55;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.help-text::before {
  content: 'i';
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6875rem;
  font-weight: 700;
  font-style: italic;
  font-family: Georgia, serif;
}

/* ───────────────────────────────────────────────────────
   14. TAB-PANEL — vertikaler Rhythmus + Stagger-Animation
   ─────────────────────────────────────────────────────── */
.tab-panel.active {
  animation: tabFadeIn 240ms cubic-bezier(.22, 1, .36, 1);
}
@keyframes tabFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.tab-panel .card,
.tab-panel .page-header,
.tab-panel .stat-card {
  animation: cardFadeIn 400ms cubic-bezier(.22, 1, .36, 1) both;
}
.tab-panel .card:nth-child(2) { animation-delay: 40ms; }
.tab-panel .card:nth-child(3) { animation-delay: 80ms; }
.tab-panel .card:nth-child(4) { animation-delay: 120ms; }
.tab-panel .card:nth-child(5) { animation-delay: 160ms; }
@keyframes cardFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ───────────────────────────────────────────────────────
   15. RESPONSIVE TWEAKS
   ─────────────────────────────────────────────────────── */
@media (max-width: 780px) {
  .page-header h1 { font-size: 1.375rem; }
  .section-heading { font-size: 1rem; }
  .stat-card-value { font-size: 1.5rem; }
  .config-row { flex-direction: column; align-items: stretch; gap: 10px; }
  .config-row-control { align-self: flex-start; }
}

/* ───────────────────────────────────────────────────────
   16. REDUCED-MOTION RESPECT
   ─────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ───────────────────────────────────────────────────────
   17. PLATFORM-AKZENTE (für Chips/Icons — NICHT für Flächen)
   ─────────────────────────────────────────────────────── */
.platform-twitch  { color: #9146FF; }
.platform-kick    { color: #53FC18; }
.platform-youtube { color: #FF0000; }
.platform-tiktok  { color: #00F2EA; }
.platform-facebook{ color: #1877F2; }
.platform-instagram{ color: #E4405F; }
.platform-discord { color: #5865F2; }

/* ───────────────────────────────────────────────────────
   18. BUTTON — pill-Style optional + icon-alignment
   ─────────────────────────────────────────────────────── */
.btn-pill { border-radius: var(--radius-pill); }
.btn svg { flex-shrink: 0; }

/* ───────────────────────────────────────────────────────
   19. GRID-HELPER
   ─────────────────────────────────────────────────────── */
.grid-auto-sm { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.grid-auto-md { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.grid-auto-lg { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 20px; }

/* ───────────────────────────────────────────────────────
   20. FIX-UP für bestehende inline-Style-Drift (einzelne Pattern)
   ─────────────────────────────────────────────────────── */
/* Border-Radius-Drift — alle inline-style border-radius unter 20px werden auf Token */
.tab-panel [style*="border-radius:4px"],
.tab-panel [style*="border-radius: 4px"],
.tab-panel [style*="border-radius:6px"],
.tab-panel [style*="border-radius: 6px"] { border-radius: var(--radius-sm) !important; }
.tab-panel [style*="border-radius:8px"],
.tab-panel [style*="border-radius: 8px"] { border-radius: var(--radius-sm) !important; }

/* ───────────────────────────────────────────────────────
   21. PERFORMANCE-OPTIMIERUNG (2026-04-24)
   GPU-Layer-Hints + Reflow-Containment für smooth-scroll
   ─────────────────────────────────────────────────────── */

/* Hot paths bekommen GPU-Layer */
.card-interactive,
.btn-primary,
.btn,
.plan-card,
.stat-card { will-change: transform; }

/* Cards isolieren ihr Reflow → Scrollen bleibt smooth */
.card, .stat-card, .plan-card { contain: layout style; }

/* Hidden Tabs werden nicht gerendert bis sichtbar */
.tab-panel:not(.active) { content-visibility: auto; contain-intrinsic-size: 1px 500px; }

/* Kein Layout-Shift wenn Scrollbar erscheint */
html { scrollbar-gutter: stable; }

/* Smooth-Scroll für anchor-Links (z.B. #pricing) */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* Images: hint lazy-decoding */
img { content-visibility: auto; }

/* Inputs: no input-lag auf Mobile */
input, textarea, select, button { touch-action: manipulation; }

/* Tap-highlight entfernen (iOS/Android) */
button, a, [role="button"] { -webkit-tap-highlight-color: transparent; }

/* Scroll-Container nutzen GPU */
.scroll-container, [style*="overflow-y:auto"], [style*="overflow-y: auto"] {
  -webkit-overflow-scrolling: touch;
}

/* Smooth-Transition für alle transform-only-Properties */
.card, .stat-card, .plan-card, .chip, .btn, .badge {
  transition-property: transform, opacity, background-color, border-color, box-shadow;
  transition-duration: var(--transition-fast, 140ms);
  transition-timing-function: cubic-bezier(.22, 1, .36, 1);
}
