/* ============================================
   LONELY.RIP -- Design System
   ============================================ */

/* Google Fonts -- Inter */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ============================================
   CSS Custom Properties
   ============================================ */
:root {
  /* Farben */
  --bg-primary: #0a0a1a;
  --bg-secondary: #0d0d24;
  --bg-tertiary: #111133;
  --surface: rgba(15, 20, 40, 0.8);
  --surface-hover: rgba(20, 28, 55, 0.9);
  --surface-border: rgba(100, 140, 255, 0.08);
  --surface-border-hover: rgba(100, 140, 255, 0.18);

  /* Akzentfarben */
  --accent-primary: #00f0ff;
  --accent-primary-rgb: 0, 240, 255;
  --accent-secondary: #8b5cf6;
  --accent-secondary-rgb: 139, 92, 246;
  --accent-success: #00ff88;
  --accent-success-rgb: 0, 255, 136;
  --accent-error: #ff3366;
  --accent-error-rgb: 255, 51, 102;
  --accent-warning: #ffaa00;

  /* Text */
  --text-primary: #f0f0f8;
  --text-secondary: #7a8ba8;
  --text-muted: #4a5568;
  --text-accent: var(--accent-primary);

  /* Typografie */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 2rem;
  --font-size-4xl: 2.5rem;
  --font-size-5xl: 3.5rem;

  /* Abstande */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;
  --spacing-3xl: 4rem;

  /* Radien */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Schatten */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow-primary: 0 0 20px rgba(var(--accent-primary-rgb), 0.3);
  --shadow-glow-secondary: 0 0 20px rgba(var(--accent-secondary-rgb), 0.3);

  /* Transitionen */
  --transition-fast: 150ms ease;
  --transition-base: 300ms ease;
  --transition-slow: 500ms ease;

  /* Glassmorphism */
  --glass-bg: rgba(15, 20, 40, 0.6);
  --glass-border: rgba(100, 140, 255, 0.1);
  --glass-blur: 20px;
}

/* ============================================
   2026 Minimal Black Surface
   ============================================ */
:root {
  --bg-primary: #050505;
  --bg-secondary: #090909;
  --bg-tertiary: #101010;
  --surface: #090909;
  --surface-hover: #111111;
  --surface-border: rgba(255, 255, 255, 0.1);
  --surface-border-hover: rgba(255, 255, 255, 0.22);
  --accent-primary: #f5f5f5;
  --accent-primary-rgb: 245, 245, 245;
  --accent-secondary: #adadad;
  --accent-secondary-rgb: 173, 173, 173;
  --accent-success: #b7f5d2;
  --accent-success-rgb: 183, 245, 210;
  --accent-error: #ff7187;
  --accent-error-rgb: 255, 113, 135;
  --text-primary: #f4f4f4;
  --text-secondary: #a1a1a1;
  --text-muted: #656565;
  --glass-bg: #090909;
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-blur: 0px;
  --scrollbar-track: #070303;
  --scrollbar-thumb: #30040a;
  --scrollbar-thumb-hover: #56111c;
  --radius-sm: 0;
  --radius-md: 0;
  --radius-lg: 0;
  --radius-xl: 0;
  --radius-full: 0;
  --transition-fast: 110ms ease-out;
  --transition-base: 180ms ease-out;
  --shadow-lg: none;
}

html,
body {
  background: var(--bg-primary);
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

body {
  line-height: 1.45;
}

.bg-animation {
  display: none;
}

.bg-grid {
  background-image: radial-gradient(circle at center, rgba(255, 255, 255, 0.055) 0.7px, transparent 0.7px);
  background-size: 34px 34px;
  mask-image: radial-gradient(circle, black 0%, transparent 72%);
  opacity: 0.36;
}

.glass-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.text-gradient {
  background: none;
  color: var(--text-primary);
  -webkit-text-fill-color: currentColor;
  text-shadow: none;
}

.input-field {
  color: var(--text-primary);
  background: #070707;
  border: 1px solid var(--surface-border);
  box-shadow: none;
}

.input-field:focus {
  border-color: rgba(255, 255, 255, 0.36);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.055);
}

select.input-field:focus,
.header-tool select:focus,
select.input-field:focus-visible,
.header-tool select:focus-visible,
select:focus {
  outline: none;
  box-shadow: none;
  border-color: var(--scrollbar-thumb-hover);
}

select option {
  background: #070707;
  color: var(--text-primary);
}

select option:hover,
select option:checked {
  background: var(--scrollbar-thumb);
  color: #fff;
}

.btn {
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: color var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

.btn--primary {
  color: #050505;
  background: #f2f2f2;
  border: 1px solid #f2f2f2;
  box-shadow: none;
}

.btn--primary:hover {
  color: #050505;
  background: #ffffff;
  transform: translateY(-1px);
  box-shadow: none;
}

.btn--ghost {
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--surface-border);
}

.btn--ghost:hover {
  color: var(--text-primary);
  border-color: var(--surface-border-hover);
  background: #101010;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}

/* ============================================
   Reset und Basis
   ============================================ */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ============================================
   Animierter Hintergrund
   ============================================ */
.bg-animation {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.bg-animation::before,
.bg-animation::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  animation: float 20s ease-in-out infinite;
}

.bg-animation::before {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(var(--accent-primary-rgb), 0.15), transparent 70%);
  top: -200px;
  right: -100px;
  animation-delay: 0s;
}

.bg-animation::after {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(var(--accent-secondary-rgb), 0.12), transparent 70%);
  bottom: -150px;
  left: -100px;
  animation-delay: -10s;
}

.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.2;
}

.bg-orb--1 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(var(--accent-success-rgb), 0.15), transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: float 25s ease-in-out infinite reverse;
}

.bg-orb--2 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(var(--accent-primary-rgb), 0.1), transparent 70%);
  top: 30%;
  right: 20%;
  animation: float 18s ease-in-out infinite;
  animation-delay: -5s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -40px) scale(1.05); }
  50% { transform: translate(-20px, 20px) scale(0.95); }
  75% { transform: translate(15px, 35px) scale(1.02); }
}

/* Grid-Overlay */
.bg-grid {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(100, 140, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(100, 140, 255, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
}

/* ============================================
   Utility Klassen
   ============================================ */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-lg);
}

.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.text-gradient {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-md) var(--spacing-xl);
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  font-weight: 600;
  line-height: 1;
  color: var(--text-primary);
  background: transparent;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  user-select: none;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
  transition: left var(--transition-slow);
}

.btn:hover::before {
  left: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn--primary {
  background: linear-gradient(135deg, rgba(var(--accent-primary-rgb), 0.2), rgba(var(--accent-secondary-rgb), 0.2));
  border-color: rgba(var(--accent-primary-rgb), 0.4);
  color: var(--accent-primary);
}

.btn--primary:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(var(--accent-primary-rgb), 0.3), rgba(var(--accent-secondary-rgb), 0.3));
  border-color: rgba(var(--accent-primary-rgb), 0.6);
  box-shadow: var(--shadow-glow-primary);
  transform: translateY(-1px);
}

.btn--primary:active:not(:disabled) {
  transform: translateY(0);
}

.btn--ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-secondary);
}

.btn--ghost:hover:not(:disabled) {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
}

.btn--full {
  width: 100%;
}

/* ============================================
   Inputs
   ============================================ */
.input-group {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.input-group label {
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

.input-field {
  width: 100%;
  padding: var(--spacing-md) var(--spacing-lg);
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  color: var(--text-primary);
  background: rgba(10, 10, 30, 0.6);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  outline: none;
  transition: all var(--transition-base);
}

.input-field::placeholder {
  color: var(--text-muted);
}

.input-field:focus {
  border-color: rgba(var(--accent-primary-rgb), 0.5);
  box-shadow: 0 0 0 3px rgba(var(--accent-primary-rgb), 0.1);
}

.input-field:hover:not(:focus) {
  border-color: var(--surface-border-hover);
}

.input-field--error {
  border-color: rgba(var(--accent-error-rgb), 0.5);
}

.input-field--error:focus {
  box-shadow: 0 0 0 3px rgba(var(--accent-error-rgb), 0.1);
}

.input-error {
  font-size: var(--font-size-xs);
  color: var(--accent-error);
  min-height: 1rem;
}

/* Honeypot -- unsichtbar fuer echte User */
.honey-field {
  position: absolute;
  left: -9999px;
  opacity: 0;
  height: 0;
  width: 0;
  pointer-events: none;
  tab-index: -1;
}

/* ============================================
   Checkbox
   ============================================ */
.checkbox-group {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: rgba(10, 10, 30, 0.6);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
  flex-shrink: 0;
}

.checkbox-group input[type="checkbox"]:checked {
  background: rgba(var(--accent-primary-rgb), 0.2);
  border-color: rgba(var(--accent-primary-rgb), 0.5);
}

.checkbox-group input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 5px;
  height: 9px;
  border: solid var(--accent-primary);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkbox-group label {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

/* ============================================
   Alerts / Nachrichten
   ============================================ */
.alert {
  padding: var(--spacing-md) var(--spacing-lg);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  display: none;
  align-items: center;
  gap: var(--spacing-sm);
  animation: slideIn 0.3s ease;
}

.alert--visible {
  display: flex;
}

.alert--dismiss {
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 300ms ease, transform 300ms ease;
}

.alert--error {
  background: rgba(var(--accent-error-rgb), 0.1);
  border: 1px solid rgba(var(--accent-error-rgb), 0.3);
  color: var(--accent-error);
}

.alert--success {
  background: rgba(var(--accent-success-rgb), 0.1);
  border: 1px solid rgba(var(--accent-success-rgb), 0.3);
  color: var(--accent-success);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   Ladeanimation
   ============================================ */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(var(--accent-primary-rgb), 0.2);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.btn .spinner {
  width: 16px;
  height: 16px;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
  :root {
    --font-size-5xl: 2.5rem;
    --font-size-4xl: 2rem;
    --font-size-3xl: 1.5rem;
  }

  .container {
    padding: 0 var(--spacing-md);
  }
}

@media (max-width: 480px) {
  :root {
    --font-size-5xl: 2rem;
    --font-size-4xl: 1.75rem;
    --font-size-3xl: 1.25rem;
  }
}

/* ============================================
   Scrollbar
   ============================================ */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #30040a, #100405);
  border-radius: var(--radius-full);
  border: 1px solid #090303;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, var(--scrollbar-thumb-hover), #1a0508);
}

/* ============================================
   Selection
   ============================================ */
::selection {
  background: rgba(var(--accent-primary-rgb), 0.3);
  color: var(--text-primary);
}

/* Final surface overrides intentionally sit after the legacy component rules. */
html,
body {
  background: var(--bg-primary);
}

.bg-animation {
  display: none;
}

.bg-grid {
  background-image: radial-gradient(circle at center, rgba(255, 255, 255, 0.055) 0.7px, transparent 0.7px);
  background-size: 34px 34px;
  mask-image: radial-gradient(circle, black 0%, transparent 72%);
  opacity: 0.36;
}

.glass-card {
  background: var(--glass-bg);
  border-color: var(--glass-border);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.text-gradient {
  background: none;
  color: var(--text-primary);
  -webkit-text-fill-color: currentColor;
  text-shadow: none;
}

.input-field,
.input-field:hover {
  color: var(--text-primary);
  background: #070707;
  border-color: var(--surface-border);
  box-shadow: none;
}

.input-field:focus {
  border-color: rgba(255, 255, 255, 0.36);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.055);
}

.btn--primary,
.btn--primary:hover {
  color: #050505;
  background: #f2f2f2;
  border-color: #f2f2f2;
  box-shadow: none;
}

.btn--primary:hover {
  background: #fff;
  transform: translateY(-1px);
}

.btn--ghost,
.btn--ghost:hover {
  box-shadow: none;
}
