@custom-variant dark (&:is(.dark *));

:root {
  --font-size: 16px;
  --background: #ffffff;
  --foreground: oklch(0.145 0 0);
  --card: #ffffff;
  --card-foreground: oklch(0.145 0 0);
  --popover: oklch(1 0 0);
  --popover-foreground: oklch(0.145 0 0);
  --primary: #030213;
  --primary-foreground: oklch(1 0 0);
  --secondary: oklch(0.95 0.0058 264.53);
  --secondary-foreground: #030213;
  --muted: #ececf0;
  --muted-foreground: #717182;
  --accent: #e9ebef;
  --accent-foreground: #030213;
  --destructive: #d4183d;
  --destructive-foreground: #ffffff;
  --border: rgba(0, 0, 0, 0.1);
  --input: transparent;
  --input-background: #f3f3f5;
  --switch-background: #cbced4;
  --font-weight-medium: 500;
  --font-weight-normal: 400;
  @custom-variant dark (&:is(.dark *));
}

/* Глобальная тёмная подложка */
html,
body {
  background: radial-gradient(120% 120% at 20% 20%, rgba(52, 168, 83, 0.08), transparent),
              radial-gradient(140% 140% at 80% 0%, rgba(0, 255, 170, 0.05), transparent),
              #030604 !important;
  color: #e6efe8;
  min-height: 100vh;
}

/* Светлая тема */
[data-theme="light"] html,
[data-theme="light"] body,
html[data-theme="light"],
html[data-theme="light"] body {
  background: #f4f6f4 !important;
  color: #111 !important;
}
html[data-theme="light"] {
  --background: #f4f6f4;
  --foreground: #111111;
  --card: #ffffff;
  --card-foreground: #111111;
  --primary: #1a7a3c;
  --primary-foreground: #ffffff;
  --secondary: #e4f0e8;
  --secondary-foreground: #1a7a3c;
  --muted: #e8ede9;
  --muted-foreground: #4a5c4d;
  --border: rgba(0,0,0,0.12);
  --input-background: #edf2ee;
}

/* Авто-тема: следует системной */
@media (prefers-color-scheme: light) {
  html[data-theme="auto"] {
    --background: #f4f6f4;
    --foreground: #111111;
    --card: #ffffff;
    --card-foreground: #111111;
    --primary: #1a7a3c;
    --primary-foreground: #ffffff;
    --secondary: #e4f0e8;
    --muted: #e8ede9;
    --muted-foreground: #4a5c4d;
    --border: rgba(0,0,0,0.12);
    --input-background: #edf2ee;
  }
  html[data-theme="auto"],
  html[data-theme="auto"] body {
    background: #f4f6f4 !important;
    color: #111 !important;
  }
}

html { font-size: var(--font-size); }
h1 { font-size: var(--text-2xl); font-weight: var(--font-weight-medium); line-height: 1.5; }
h2 { font-size: var(--text-xl); font-weight: var(--font-weight-medium); line-height: 1.5; }
h3 { font-size: var(--text-lg); font-weight: var(--font-weight-medium); line-height: 1.5; }
h4 { font-size: var(--text-base); font-weight: var(--font-weight-medium); line-height: 1.5; }
label { font-size: var(--text-base); font-weight: var(--font-weight-medium); line-height: 1.5; }
button { font-size: var(--text-base); font-weight: var(--font-weight-medium); line-height: 1.5; }
input { font-size: var(--text-base); font-weight: var(--font-weight-normal); line-height: 1.5; }

/* Toast notifications */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 10000;
  animation: toastSlideIn 0.3s ease;
}
.toast-success { background: #4caf50; }
.toast-error { background: #ef5350; }
.toast-info { background: #667eea; }
.toast-hiding { animation: toastSlideOut 0.3s ease forwards; }

@keyframes toastSlideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes toastSlideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(400px);
    opacity: 0;
  }
}
