/* =====================================================================
   MrkTim Design Tokens
   Enda stället där färger, mått och typografi definieras.
   Komponenter och sidor ska referera dessa variabler – aldrig hårdkoda.
   ===================================================================== */

:root {
	color-scheme: dark;

	/* ---- Färger: bakgrunder & ytor ---- */
	--color-bg: #0d0d0d;
	--color-sidebar: #101010;
	--color-surface: #181818;
	--color-surface-alt: #242424;
	--color-surface-hover: #2a2a2a;
	--color-surface-active: #303030;

	/* ---- Färger: kanter ---- */
	--color-border: #333333;
	--color-border-subtle: #282828;
	--color-border-strong: #444444;

	/* ---- Färger: text ---- */
	--color-text: #ffffff;
	--color-text-secondary: #b3b3b3;
	--color-text-muted: #808080;
	--color-text-on-accent: #0d0d0d;

	/* ---- Färger: accent ---- */
	--color-accent: #1db954;
	--color-accent-hover: #1ed760;
	--color-accent-active: #169c46;
	--color-accent-subtle: rgba(29, 185, 84, 0.12);
	--color-accent-border: rgba(29, 185, 84, 0.4);

	/* ---- Färger: semantik ---- */
	--color-success: var(--color-accent);
	--color-success-subtle: var(--color-accent-subtle);
	--color-warning: #e3b341;
	--color-warning-subtle: rgba(227, 179, 65, 0.12);
	--color-danger: #e5484d;
	--color-danger-hover: #f2555a;
	--color-danger-subtle: rgba(229, 72, 77, 0.12);
	--color-danger-border: rgba(229, 72, 77, 0.4);
	--color-info: #b3b3b3;

	/* ---- Typografi ---- */
	--font-sans: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
	--font-mono: "JetBrains Mono", "Cascadia Code", Consolas, "SF Mono", monospace;

	--text-xs: 0.75rem;
	--text-sm: 0.875rem;
	--text-base: 1rem;
	--text-lg: 1.125rem;
	--text-xl: 1.375rem;
	--text-2xl: 1.75rem;

	--leading-tight: 1.25;
	--leading-normal: 1.5;

	--weight-normal: 400;
	--weight-medium: 500;
	--weight-semibold: 600;
	--weight-bold: 700;

	/* ---- Spacing (4px-skala) ---- */
	--space-1: 0.25rem;
	--space-2: 0.5rem;
	--space-3: 0.75rem;
	--space-4: 1rem;
	--space-5: 1.25rem;
	--space-6: 1.5rem;
	--space-8: 2rem;
	--space-10: 2.5rem;
	--space-12: 3rem;

	/* ---- Radius ---- */
	--radius-sm: 4px;
	--radius-md: 6px;
	--radius-lg: 10px;
	--radius-full: 999px;

	/* ---- Skuggor (sparsamt) ---- */
	--shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
	--shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
	--shadow-drawer: 8px 0 24px rgba(0, 0, 0, 0.6);

	/* ---- Kontrollmått (touch-vänliga som default) ---- */
	--control-height: 2.75rem;      /* 44px – mobil */
	--control-height-sm: 2.25rem;   /* 36px */
	--control-padding-x: var(--space-3);
	--touch-target-min: 2.75rem;

	/* ---- Layout ---- */
	--topbar-height: 3.5rem;
	--sidebar-width: 15rem;
	--content-max-width: 72rem;
	--page-padding: var(--space-4);

	/* ---- Fokus ---- */
	--focus-ring: 0 0 0 2px var(--color-bg), 0 0 0 4px var(--color-accent);

	/* ---- Transitions ---- */
	--transition-fast: 120ms ease;
	--transition-base: 180ms ease;

	/* ---- Z-index ---- */
	--z-topbar: 40;
	--z-drawer: 50;
	--z-backdrop: 45;
	--z-toast: 100;
}

/* Desktop: kompaktare kontroller, mer luft runt sidan */
@media (min-width: 1024px) {
	:root {
		--control-height: 2.5rem;    /* 40px */
		--control-height-sm: 2rem;
		--page-padding: var(--space-8);
	}
}

@media (prefers-reduced-motion: reduce) {
	:root {
		--transition-fast: 0ms;
		--transition-base: 0ms;
	}
}
