/* LMS theme: dark (auto-switching via prefers-color-scheme)
 *
 * Phase 3 oklch migration:
 * - Brand values that flip to the signature light-green primary stay close
 *   to the same oklch value used in default (0.918 0.166 130).
 * - Semantic ramps move to oklch for a perceptually-uniform gradient.
 *
 * Reference hex values are kept as comments for the design-system audit.
 */

[data-lms-theme="dark"] {
	/* hex: #b9f19d (signature light green — used as primary in dark) */
	--theme-primary: oklch(0.918 0.166 130);
	/* hex: #a6e987 */
	--theme-primary-light: oklch(0.88 0.18 130);
	/* hex: #b9f19d (signature accent) */
	--theme-accent: oklch(0.918 0.166 130);
	/* hex: #8fd96c */
	--theme-accent-strong: oklch(0.812 0.182 130);
	/* hex: #1e3a2a */
	--theme-accent-muted: oklch(0.27 0.04 165);
	/* hex: #5faf61 */
	--theme-focus: oklch(0.65 0.15 145);

	/* hex: #0f1a16 (canvas dark) */
	--theme-canvas: oklch(0.18 0.012 175);
	/* hex: #16241f (surface dark) */
	--theme-surface: oklch(0.22 0.015 175);
	/* hex: #1d2f28 (surface-alt) */
	--theme-surface-alt: oklch(0.26 0.018 175);
	/* hex: #16241f (surface-elevated) */
	--theme-surface-elevated: oklch(0.22 0.015 175);
	/* hex: #2d4339 (border dark) */
	--theme-border: oklch(0.34 0.025 175);

	/* hex: #f1f5f1 (text dark) */
	--theme-text: oklch(0.96 0.005 130);
	/* hex: #94a39a (muted text dark) */
	--theme-text-muted: oklch(0.65 0.012 175);
	--theme-success: oklch(0.55 0.065 175);
	--theme-warning: oklch(0.78 0.15 75);
	--theme-danger: oklch(0.62 0.20 25);

	--theme-shadow-sm: 0 1px 2px oklch(0 0 0 / 0.30);
	--theme-shadow: 0 4px 20px oklch(0 0 0 / 0.30);
	--theme-shadow-lg: 0 8px 30px oklch(0 0 0 / 0.40);
	--theme-shadow-panel: 0 1px 3px oklch(0 0 0 / 0.30);

	--theme-hero-border: oklch(0.918 0.166 130 / 0.15);
	--theme-hero-bg: oklch(0.22 0.015 175);
	--theme-hero-glow: transparent;
	--theme-hero-accent: oklch(0.918 0.166 130);

	--theme-nav-active-bg: oklch(0.918 0.166 130 / 0.10);
	--theme-nav-active-text: oklch(0.918 0.166 130);
	--theme-sidebar-section-text: oklch(0.45 0.018 175);
	--theme-sidebar-hover-bg: oklch(0.918 0.166 130 / 0.08);
	--theme-sidebar-active-bg: oklch(0.918 0.166 130 / 0.12);
	--theme-sidebar-active-text: oklch(0.918 0.166 130);
	--theme-sidebar-active-accent: oklch(0.918 0.166 130);
	--theme-sidebar-icon-bg: oklch(0.918 0.166 130 / 0.10);
	--theme-sidebar-icon-text: oklch(0.918 0.166 130);
	--theme-sidebar-icon-active-bg: oklch(0.918 0.166 130);
	--theme-sidebar-icon-active-text: oklch(0.18 0.012 175);
	--theme-sidebar-child-border: oklch(0.918 0.166 130 / 0.15);
	--theme-chip-bg: oklch(0.918 0.166 130 / 0.10);
	--theme-chip-text: oklch(0.918 0.166 130);
	--theme-pill-bg: oklch(0.918 0.166 130 / 0.10);
	--theme-pill-text: oklch(0.918 0.166 130);

	--theme-tile-bg: oklch(0.22 0.015 175);
	--theme-tile-border: oklch(0.34 0.025 175);
	--theme-tile-shadow: 0 1px 3px oklch(0 0 0 / 0.20);
	--theme-tile-shadow-hover: 0 4px 20px oklch(0 0 0 / 0.30);
	--theme-tile-border-hover: oklch(0.918 0.166 130 / 0.25);
	--theme-tile-icon-bg: oklch(0.918 0.166 130 / 0.10);
	--theme-tile-icon-text: oklch(0.918 0.166 130);
	--theme-tile-footer-border: oklch(0.34 0.025 175 / 0.95);
	--theme-tile-count-bg: oklch(0.918 0.166 130 / 0.10);
	--theme-tile-count-text: oklch(0.918 0.166 130);
	--theme-tile-count-muted-bg: oklch(0.65 0.012 175 / 0.10);
	--theme-tile-count-muted-text: oklch(0.65 0.012 175);
	--theme-tile-action-text: oklch(0.88 0.18 130);

	--theme-tone-cyan: oklch(0.78 0.13 195);
	--theme-tone-blue: oklch(0.65 0.13 250);
	--theme-tone-green: oklch(0.65 0.15 145);
	--theme-tone-orange: oklch(0.78 0.15 75);
	--theme-tone-red: oklch(0.62 0.20 25);
	--theme-tone-purple: oklch(0.72 0.18 285);
	--theme-tone-grey: oklch(0.65 0.012 175);
}

/* Auto-switch to dark when system prefers dark mode and theme is "auto" */
@media (prefers-color-scheme: dark) {
	[data-lms-theme="auto"] {
		--theme-primary: oklch(0.918 0.166 130);
		--theme-primary-light: oklch(0.88 0.18 130);
		--theme-accent: oklch(0.918 0.166 130);
		--theme-accent-strong: oklch(0.812 0.182 130);
		--theme-accent-muted: oklch(0.27 0.04 165);
		--theme-focus: oklch(0.65 0.15 145);
		--theme-canvas: oklch(0.18 0.012 175);
		--theme-surface: oklch(0.22 0.015 175);
		--theme-surface-alt: oklch(0.26 0.018 175);
		--theme-surface-elevated: oklch(0.22 0.015 175);
		--theme-border: oklch(0.34 0.025 175);
		--theme-text: oklch(0.96 0.005 130);
		--theme-text-muted: oklch(0.65 0.012 175);
		--theme-success: oklch(0.55 0.065 175);
		--theme-warning: oklch(0.78 0.15 75);
		--theme-danger: oklch(0.62 0.20 25);
		--theme-shadow-sm: 0 1px 2px oklch(0 0 0 / 0.30);
		--theme-shadow: 0 2px 8px oklch(0 0 0 / 0.30);
		--theme-shadow-lg: 0 8px 24px oklch(0 0 0 / 0.40);
		--theme-shadow-panel: 0 1px 3px oklch(0 0 0 / 0.30);
		--theme-hero-border: oklch(0.918 0.166 130 / 0.15);
		--theme-hero-bg: oklch(0.22 0.015 175);
		--theme-hero-glow: transparent;
		--theme-hero-accent: oklch(0.918 0.166 130);
		--theme-nav-active-bg: oklch(0.918 0.166 130 / 0.10);
		--theme-nav-active-text: oklch(0.918 0.166 130);
		--theme-sidebar-section-text: oklch(0.45 0.018 175);
		--theme-sidebar-hover-bg: oklch(0.918 0.166 130 / 0.08);
		--theme-sidebar-active-bg: oklch(0.918 0.166 130 / 0.12);
		--theme-sidebar-active-text: oklch(0.918 0.166 130);
		--theme-sidebar-active-accent: oklch(0.918 0.166 130);
		--theme-sidebar-icon-bg: oklch(0.918 0.166 130 / 0.10);
		--theme-sidebar-icon-text: oklch(0.918 0.166 130);
		--theme-sidebar-icon-active-bg: oklch(0.918 0.166 130);
		--theme-sidebar-icon-active-text: oklch(0.18 0.012 175);
		--theme-sidebar-child-border: oklch(0.918 0.166 130 / 0.15);
		--theme-chip-bg: oklch(0.918 0.166 130 / 0.10);
		--theme-chip-text: oklch(0.918 0.166 130);
		--theme-pill-bg: oklch(0.918 0.166 130 / 0.10);
		--theme-pill-text: oklch(0.918 0.166 130);
		--theme-tile-bg: oklch(0.22 0.015 175);
		--theme-tile-border: oklch(0.34 0.025 175);
		--theme-tile-shadow: 0 1px 3px oklch(0 0 0 / 0.20);
		--theme-tile-shadow-hover: 0 4px 16px oklch(0 0 0 / 0.30);
		--theme-tile-border-hover: oklch(0.918 0.166 130 / 0.25);
		--theme-tile-icon-bg: oklch(0.918 0.166 130 / 0.10);
		--theme-tile-icon-text: oklch(0.918 0.166 130);
		--theme-tile-footer-border: oklch(0.34 0.025 175 / 0.95);
		--theme-tile-count-bg: oklch(0.918 0.166 130 / 0.10);
		--theme-tile-count-text: oklch(0.918 0.166 130);
		--theme-tile-count-muted-bg: oklch(0.65 0.012 175 / 0.10);
		--theme-tile-count-muted-text: oklch(0.65 0.012 175);
		--theme-tile-action-text: oklch(0.88 0.18 130);
		--theme-tone-cyan: oklch(0.78 0.13 195);
		--theme-tone-blue: oklch(0.65 0.13 250);
		--theme-tone-green: oklch(0.65 0.15 145);
		--theme-tone-orange: oklch(0.78 0.15 75);
		--theme-tone-red: oklch(0.62 0.20 25);
		--theme-tone-purple: oklch(0.72 0.18 285);
		--theme-tone-grey: oklch(0.65 0.012 175);
	}
}
