/* Fonts lokal gebündelt (@fontsource) — die Box-UI braucht kein Internet für Schrift. */
@import "@fontsource/inter/300.css";
@import "@fontsource/inter/400.css";
@import "@fontsource/inter/500.css";
@import "@fontsource/inter/600.css";
@import "@fontsource/inter/700.css";
@import "@fontsource/space-grotesk/400.css";
@import "@fontsource/space-grotesk/500.css";
@import "@fontsource/space-grotesk/600.css";
@import "@fontsource/space-grotesk/700.css";
@import "@fontsource/jetbrains-mono/400.css";
@import "@fontsource/jetbrains-mono/500.css";
@import "tailwindcss";

/* Design-System: EINE Akzentfarbe Teal, bewusst dark-only (Glassmorphismus-Look).
   Karten-Optik lebt in .mc-card / .mc-card-sm (unten) — Komponenten sagen es explizit,
   statt dass CSS Utility-Klassen-Kombinationen errät. */

:root {
  --background: 224 30% 6%;
  --foreground: 210 20% 92%;
  --card: 224 25% 10%;
  --card-foreground: 210 20% 94%;
  --popover: 224 28% 9%;
  --popover-foreground: 210 20% 94%;
  --primary: 172 72% 50%;
  --primary-foreground: 224 47% 8%;
  --muted: 220 16% 14%;
  --muted-foreground: 215 14% 64%;
  --accent: 220 16% 16%;
  --accent-foreground: 210 20% 94%;
  --border: 222 18% 23%;
  --input: 222 18% 23%;
  --ring: 172 72% 50%;
  --radius: 0.75rem;
  color-scheme: dark;
}

@theme inline {
  --color-background: hsl(var(--background));
  --color-foreground: hsl(var(--foreground));
  --color-card: hsl(var(--card));
  --color-card-foreground: hsl(var(--card-foreground));
  --color-popover: hsl(var(--popover));
  --color-popover-foreground: hsl(var(--popover-foreground));
  --color-primary: hsl(var(--primary));
  --color-primary-foreground: hsl(var(--primary-foreground));
  --color-muted: hsl(var(--muted));
  --color-muted-foreground: hsl(var(--muted-foreground));
  --color-accent: hsl(var(--accent));
  --color-accent-foreground: hsl(var(--accent-foreground));
  --color-border: hsl(var(--border));
  --color-input: hsl(var(--input));
  --color-ring: hsl(var(--ring));
  --radius-lg: var(--radius);
  --radius-md: calc(var(--radius) - 2px);
  --radius-sm: calc(var(--radius) - 4px);
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
  --font-space: "Space Grotesk", sans-serif;
}

html,
body,
#root {
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

* {
  border-color: hsl(var(--border) / 0.85);
  outline-color: hsl(var(--primary) / 0.5);
}

/* Sichtbarer Fokus für Tastatur-Nutzer auf allen interaktiven Elementen. */
:focus-visible {
  outline: 2px solid hsl(var(--primary) / 0.7);
  outline-offset: 2px;
}

/* Eingabefelder: Teal-Fokus statt Browser-Default (ungeschichtet → gewinnt ohne !important). */
input:focus, textarea:focus, select:focus {
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 2px hsl(var(--primary) / 0.15);
  outline: none;
}

/* Schmale Teal-Scrollbars im Glas-Look (EINE Definition). */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: hsl(var(--primary) / 0.25);
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: hsl(var(--primary) / 0.5);
}

/* ==========================================================================
   Karten-Optik (ehem. „HUD 3.0"-Layer, jetzt explizite Klassen ohne !important;
   ungeschichtete Regeln schlagen Tailwind-Utilities von selbst)
   ========================================================================== */

/* Große Inhalts-Karte: Glas-Grund, Farbverlaufs-Linie oben, sanftes Anheben bei Hover. */
.mc-card {
  position: relative;
  overflow: hidden;
  border-radius: 1rem;
  border: 1px solid hsl(var(--border) / 0.95);
  background-color: hsl(var(--card) / 0.85);
  box-shadow: 0 10px 30px -15px rgb(0 0 0 / 0.45), inset 0 1px 0 0 rgb(255 255 255 / 0.05);
  transition:
    transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.mc-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3.5px;
  background: linear-gradient(90deg, hsl(var(--primary)), #6366f1, #a855f7);
  opacity: 0.75;
  transition: opacity 0.3s ease;
}
.mc-card:hover {
  transform: translateY(-3px);
  background-color: hsl(var(--card) / 0.92);
  border-color: hsl(var(--primary) / 0.35);
  box-shadow: 0 20px 40px -20px rgb(0 0 0 / 0.65), 0 0 18px 2px hsl(var(--primary) / 0.05);
}
.mc-card:hover::before {
  opacity: 1;
}

/* Kleine Karte / Listen-Container: ruhiger, ohne Verlaufs-Linie und Anheben. */
.mc-card-sm {
  border-radius: 0.75rem;
  border: 1px solid hsl(var(--border) / 0.9);
  background-color: hsl(var(--card) / 0.88);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.mc-card-sm:hover {
  background-color: hsl(var(--card) / 0.95);
  border-color: hsl(var(--primary) / 0.3);
}

/* Aktiver Navigations-Eintrag in der Sidebar (ausgeklappt / eingeklappt). */
.nav-active {
  background: linear-gradient(90deg, hsl(var(--primary) / 0.18), rgb(99 102 241 / 0.12));
  color: hsl(var(--primary));
  border-left: 3.5px solid hsl(var(--primary));
  border-radius: 0 var(--radius) var(--radius) 0;
  padding-left: calc(0.75rem - 3.5px);
  box-shadow: inset 0 1px 0 0 rgb(255 255 255 / 0.02);
}
.nav-active-collapsed {
  background: hsl(var(--primary) / 0.18);
  color: hsl(var(--primary));
  box-shadow: 0 0 12px 1px hsl(var(--primary) / 0.1);
  border: 1px solid hsl(var(--primary) / 0.3);
}

/* SVG-Fluss-Animation (Modell-Cockpit-Verdrahtung). */
@keyframes flow-cyan {
  0% {
    stroke-dasharray: 6 3;
    stroke-dashoffset: 18;
  }
  100% {
    stroke-dasharray: 6 3;
    stroke-dashoffset: 0;
  }
}

.animate-flow-cyan {
  animation: flow-cyan 1.2s linear infinite;
}

/* Bewegungs-Sensibilität respektieren: Animationen/Transitions praktisch aus. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* WQHD & 4K Monitor Responsive Scaling (Fluid Typography & UI Scaling) */
@media (min-width: 1440px) {
  html {
    font-size: 16.5px;
  }
}
@media (min-width: 1920px) {
  html {
    font-size: 17.5px;
  }
}
@media (min-width: 2560px) {
  html {
    font-size: 19px;
  }
}
@media (min-width: 3440px) {
  html {
    font-size: 20px;
  }
}
