/* SlapChop Studio - CSS Variable-based Theme Engine */

:root,
[data-theme="default-amber"],
[data-theme="amber"] {
    --theme-id: "default-amber";
    --theme-name: "Forge Amber";
    --theme-bg: #0c0a09;
    --theme-header-bg: rgba(12, 10, 9, 0.92);
    --theme-surface: #191512;
    --theme-surface-card: #1c1815;
    --theme-surface-hover: #26211d;
    --theme-border: #2e251e;
    --theme-border-highlight: #44362b;
    --theme-primary: #f59e0b;
    --theme-primary-hover: #d97706;
    --theme-primary-light: #fef3c7;
    --theme-primary-glow: rgba(245, 158, 11, 0.28);
    --theme-accent: #f97316;
    --theme-gradient: linear-gradient(135deg, #f59e0b 0%, #d97706 50%, #ea580c 100%);
    --theme-text-contrast: #0c0a09;
}

[data-theme="citadel-emerald"],
[data-theme="emerald"] {
    --theme-id: "citadel-emerald";
    --theme-name: "Citadel Emerald";
    --theme-bg: #06120e;
    --theme-header-bg: rgba(6, 18, 14, 0.92);
    --theme-surface: #0b1e17;
    --theme-surface-card: #0f271e;
    --theme-surface-hover: #16362a;
    --theme-border: #183e30;
    --theme-border-highlight: #225643;
    --theme-primary: #10b981;
    --theme-primary-hover: #059669;
    --theme-primary-light: #d1fae5;
    --theme-primary-glow: rgba(16, 185, 129, 0.28);
    --theme-accent: #14b8a6;
    --theme-gradient: linear-gradient(135deg, #10b981 0%, #0d9488 50%, #059669 100%);
    --theme-text-contrast: #04140e;
}

[data-theme="astartes-cobalt"],
[data-theme="cobalt"],
[data-theme="blue"] {
    --theme-id: "astartes-cobalt";
    --theme-name: "Astartes Cobalt";
    --theme-bg: #080d1a;
    --theme-header-bg: rgba(8, 13, 26, 0.92);
    --theme-surface: #0e172c;
    --theme-surface-card: #111d38;
    --theme-surface-hover: #18284d;
    --theme-border: #1e2f56;
    --theme-border-highlight: #284177;
    --theme-primary: #3b82f6;
    --theme-primary-hover: #2563eb;
    --theme-primary-light: #dbeafe;
    --theme-primary-glow: rgba(59, 130, 246, 0.28);
    --theme-accent: #06b6d4;
    --theme-gradient: linear-gradient(135deg, #3b82f6 0%, #2563eb 50%, #0284c7 100%);
    --theme-text-contrast: #080d1a;
}

[data-theme="warpstone-purple"],
[data-theme="purple"] {
    --theme-id: "warpstone-purple";
    --theme-name: "Warpstone Purple";
    --theme-bg: #0f0919;
    --theme-header-bg: rgba(15, 9, 25, 0.92);
    --theme-surface: #19112a;
    --theme-surface-card: #201636;
    --theme-surface-hover: #2b1d49;
    --theme-border: #322254;
    --theme-border-highlight: #463077;
    --theme-primary: #a855f7;
    --theme-primary-hover: #9333ea;
    --theme-primary-light: #f3e8ff;
    --theme-primary-glow: rgba(168, 85, 247, 0.28);
    --theme-accent: #ec4899;
    --theme-gradient: linear-gradient(135deg, #a855f7 0%, #9333ea 50%, #c026d3 100%);
    --theme-text-contrast: #0f0919;
}

[data-theme="blood-angels-red"],
[data-theme="red"] {
    --theme-id: "blood-angels-red";
    --theme-name: "Blood Angels Crimson";
    --theme-bg: #15080a;
    --theme-header-bg: rgba(21, 8, 10, 0.92);
    --theme-surface: #220e12;
    --theme-surface-card: #2c1217;
    --theme-surface-hover: #3d1920;
    --theme-border: #421b22;
    --theme-border-highlight: #5e2731;
    --theme-primary: #ef4444;
    --theme-primary-hover: #dc2626;
    --theme-primary-light: #fee2e2;
    --theme-primary-glow: rgba(239, 68, 68, 0.28);
    --theme-accent: #f97316;
    --theme-gradient: linear-gradient(135deg, #ef4444 0%, #dc2626 50%, #ea580c 100%);
    --theme-text-contrast: #15080a;
}

[data-theme="grimdark-slate"],
[data-theme="grimdark"],
[data-theme="slate"] {
    --theme-id: "grimdark-slate";
    --theme-name: "Grimdark Obsidian";
    --theme-bg: #090a0c;
    --theme-header-bg: rgba(9, 10, 12, 0.92);
    --theme-surface: #13161c;
    --theme-surface-card: #181c24;
    --theme-surface-hover: #222733;
    --theme-border: #282f3d;
    --theme-border-highlight: #394356;
    --theme-primary: #94a3b8;
    --theme-primary-hover: #64748b;
    --theme-primary-light: #f1f5f9;
    --theme-primary-glow: rgba(148, 163, 184, 0.24);
    --theme-accent: #cbd5e1;
    --theme-gradient: linear-gradient(135deg, #94a3b8 0%, #64748b 50%, #475569 100%);
    --theme-text-contrast: #090a0c;
}

/* Global Dynamic Theming Adapters */
html, body {
    background-color: var(--theme-bg) !important;
    transition: background-color 0.25s ease, color 0.25s ease;
}

header {
    background-color: var(--theme-header-bg) !important;
    border-color: var(--theme-border) !important;
}

/* Selection */
::selection {
    background-color: var(--theme-primary-glow) !important;
    color: var(--theme-primary-light) !important;
}

/* Primary Accents & Buttons */
[data-theme] .bg-emerald-600 {
    background-color: var(--theme-primary) !important;
    color: var(--theme-text-contrast) !important;
}

[data-theme] .hover\:bg-emerald-500:hover {
    background-color: var(--theme-primary-hover) !important;
}

[data-theme] .text-emerald-400 {
    color: var(--theme-primary) !important;
}

[data-theme] .text-emerald-300 {
    color: var(--theme-primary-light) !important;
}

[data-theme] .hover\:text-emerald-300:hover,
[data-theme] .hover\:text-emerald-400:hover {
    color: var(--theme-primary-light) !important;
}

[data-theme] .border-emerald-500,
[data-theme] .border-emerald-500\/40,
[data-theme] .border-emerald-500\/30 {
    border-color: var(--theme-primary) !important;
}

[data-theme] .focus\:border-emerald-500:focus {
    border-color: var(--theme-primary) !important;
}

[data-theme] .focus\:ring-emerald-500:focus {
    --tw-ring-color: var(--theme-primary) !important;
}

[data-theme] .bg-emerald-600\/20,
[data-theme] .bg-emerald-600\/30 {
    background-color: var(--theme-primary-glow) !important;
}

[data-theme] .shadow-emerald-950\/50,
[data-theme] .shadow-emerald-950\/60,
[data-theme] .shadow-emerald-900\/40 {
    box-shadow: 0 8px 20px -4px var(--theme-primary-glow) !important;
}

/* Gradients */
[data-theme] .from-emerald-600.to-teal-500,
[data-theme] .from-emerald-600.via-teal-500.to-amber-400 {
    background-image: var(--theme-gradient) !important;
}

[data-theme] .from-emerald-400.via-teal-300.to-amber-200 {
    background-image: var(--theme-gradient) !important;
}

/* Custom Theme Utility Classes */
.theme-card {
    background-color: var(--theme-surface-card);
    border-color: var(--theme-border);
}

.theme-card:hover {
    background-color: var(--theme-surface-hover);
    border-color: var(--theme-border-highlight);
}

.theme-btn-primary {
    background-image: var(--theme-gradient);
    color: var(--theme-text-contrast);
    font-weight: 700;
}

.theme-btn-primary:hover {
    opacity: 0.95;
    filter: brightness(1.08);
}

/* Stitch Grimdark Forge Workbench Design System Tokens */
:root {
    --surface-container-lowest: #0a0e18;
    --surface: #0f131d;
    --surface-container-low: #171b26;
    --surface-container: #1c1f2a;
    --surface-container-high: #262a35;
    --surface-container-highest: #313540;
    --surface-bright: #353944;
    --on-surface: #dfe2f1;
    --on-surface-variant: #94a3b8;
    --outline: #a08e7a;
    --outline-variant: #534434;
    --primary-stitch: #ffc174;
    --primary-container-stitch: #f59e0b;
    --secondary-stitch: #adc6ff;
    --secondary-container-stitch: #0566d9;
    --tertiary-stitch: #56e5a9;
    --tertiary-container-stitch: #30c88f;
    --error-stitch: #ffb4ab;
    --error-container-stitch: #93000a;
}

.bg-surface-lowest { background-color: var(--surface-container-lowest) !important; }
.bg-surface-base { background-color: var(--surface) !important; }
.bg-surface-low { background-color: var(--surface-container-low) !important; }
.bg-surface-card { background-color: var(--surface-container) !important; }
.bg-surface-high { background-color: var(--surface-container-high) !important; }
.bg-surface-highest { background-color: var(--surface-container-highest) !important; }

.font-headline { font-family: 'Geist', ui-sans-serif, system-ui, sans-serif; }
.font-body { font-family: 'Inter', ui-sans-serif, system-ui, sans-serif; }
.font-mono-metric { font-family: 'JetBrains Mono', monospace; }

.forge-glow {
    box-shadow: 0 0 16px rgba(245, 158, 11, 0.25);
}
.forge-glow-lg {
    box-shadow: 0 0 24px rgba(245, 158, 11, 0.35);
}
.emerald-glow {
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.3);
}
.stitch-card {
    background-color: #171b26;
    border: 1px solid rgba(83, 68, 52, 0.35);
    border-radius: 0.75rem;
    transition: all 0.2s ease;
}
.stitch-card:hover {
    background-color: #1c1f2a;
    border-color: rgba(245, 158, 11, 0.4);
}
