/* THEMES.CSS - MARTIAL LAW EDITION
   Defines the DNA of the application's visual identity.
   All colors extracted from src/lib/pdf-templates.
*/

:root {
    /* Default to Corporate if no theme selected */
    --primary: #1e293b;
    /* Slate 800 */
    --secondary: #334155;
    /* Slate 700 */
    --accent: #3b82f6;
    /* Blue 500 (Safer accent than Navy for screen) */
    --text-main: #f8fafc;
    /* Slate 50 */
    --text-muted: #94a3b8;
    /* Slate 400 */
    --bg-body: #0f172a;
    /* Slate 900 */
    --bg-panel: rgba(30, 41, 59, 0.95);
    /* Slate 800 with opacity */
    --border-color: rgba(255, 255, 255, 0.1);
    --glow-color: rgba(59, 130, 246, 0.5);
}

/* 1. CORPORATE THEME (Professional, Slate, Clean) */
[data-theme="corporate"] {
    --primary: #1e293b;
    --secondary: #475569;
    --accent: #3b82f6;
    --text-main: #ffffff;
    --text-muted: #cbd5e1;
    --bg-body: #f1f5f9;
    /* Slate 100 - Light body for corporate? Or keep dark? User said "Elegance". Let's stick to Dark Elegant for Dashboard context usually, or match PDF. PDF uses Slate 800 fill. */
    --bg-body: #0f172a;
    --bg-panel: rgba(30, 41, 59, 0.95);
    --border-color: rgba(148, 163, 184, 0.2);
    --glow-color: rgba(59, 130, 246, 0.1);
    /* Subtle glow */
}

/* 2. NEON THEME (Deep Space, High Contrast, Cyberpunk) */
[data-theme="neon"] {
    --primary: #0f172a;
    /* Deep Space Base */
    --secondary: #1e293b;
    --accent: #60a5fa;
    /* Blue 400 - Extracted from PDF */
    --text-main: #e2e8f0;
    /* Slate 200 */
    --text-muted: #94a3b8;
    --bg-body: #020617;
    /* Very Dark */
    --bg-panel: rgba(15, 23, 42, 0.9);
    --border-color: #3b82f6;
    /* Blue 500 Border */
    --glow-color: #60a5fa;
    /* Strong Blue Glow */
}

/* 3. EMERALD THEME (Finance, Growth, Green) */
[data-theme="emerald"] {
    --primary: #022c22;
    /* Emerald 950 */
    --secondary: #064e3b;
    /* Emerald 900 */
    --accent: #10b981;
    /* Emerald 500 */
    --text-main: #ecfdf5;
    /* Emerald 50 */
    --text-muted: #6ee7b7;
    /* Emerald 300 */
    --bg-body: #064e3b;
    --bg-panel: rgba(6, 78, 59, 0.9);
    --border-color: #059669;
    --glow-color: #10b981;
}

/* 4. LIGHT THEME (High Readability, Print Friendly) */
[data-theme="light"] {
    --primary: #ffffff;
    --secondary: #f1f5f9;
    --accent: #2563eb;
    /* Blue 600 */
    --text-main: #0f172a;
    /* Slate 900 */
    --text-muted: #64748b;
    /* Slate 500 */
    --bg-body: #f8fafc;
    /* Slate 50 */
    --bg-panel: rgba(255, 255, 255, 0.95);
    --border-color: #cbd5e1;
    /* Slate 300 */
    --glow-color: rgba(37, 99, 235, 0);
    /* No glow in light mode */
}


/* TOTALITARIAN ENFORCEMENT CLASSES */
/* Applies variables to all standard elements */

body {
    background-color: var(--bg-body);
    color: var(--text-main);
}

.card,
.glass-panel,
.panel {
    background-color: var(--bg-panel) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-main) !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 0 15px var(--glow-color);
    /* Glow enforcement */
    transition: all 0.3s ease;
}

/* Buttons */
.btn-primary,
button[type="submit"],
.cta-button {
    background-color: var(--accent) !important;
    color: #ffffff !important;
    /* Always white text on accent */
    border: 1px solid var(--accent) !important;
    box-shadow: 0 0 10px var(--glow-color);
}

.btn-secondary {
    background-color: var(--secondary) !important;
    color: var(--text-main) !important;
    border: 1px solid var(--border-color) !important;
}

/* Inputs */
input,
select,
textarea {
    background-color: rgba(0, 0, 0, 0.2) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-main) !important;
}

[data-theme="light"] input,
[data-theme="light"] select,
[data-theme="light"] textarea {
    background-color: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
}

/* Headings */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-main) !important;
}

/* Tables */
table {
    color: var(--text-main) !important;
}

th {
    background-color: var(--secondary) !important;
    color: var(--text-main) !important;
    border-bottom: 2px solid var(--border-color) !important;
}

td {
    border-bottom: 1px solid var(--border-color) !important;
    color: var(--text-muted);
}

tr:hover td {
    color: var(--text-main) !important;
    background-color: var(--secondary) !important;
}

/* Sidebar Specifics if not using glass-panel */
aside,
.sidebar {
    background-color: var(--bg-panel) !important;
    border-right: 1px solid var(--border-color) !important;
}

/* Icons */
.lucide,
svg {
    stroke: var(--text-muted);
}

.active .lucide {
    stroke: var(--accent) !important;
}

/* Utility Overrides for Tailwind Classes */
/* This is a brute force way to make bg-slate-800 obey the theme if we cant change the class names */
/* EXTENSION: Style Wheel Widget */
.style-wheel-container {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    z-index: 100;
    transition: all 0.3s ease;
}

.style-wheel-btn {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background: var(--bg-panel);
    border: 1px solid var(--accent);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5), 0 0 10px var(--glow-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 20;
}

.style-wheel-btn:hover {
    transform: rotate(90deg) scale(1.1);
    background: var(--accent);
    color: #fff;
}

.style-options {
    position: absolute;
    bottom: 0;
    left: 0;
    pointer-events: none;
    opacity: 0;
    transition: all 0.3s ease;
}

.style-wheel-container.open .style-options {
    pointer-events: auto;
    opacity: 1;
}

.style-option {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 0;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.style-wheel-container.open .style-option {
    width: auto;
    height: 3rem;
    padding: 0 1rem 0 0.5rem;
    overflow: visible;
}

/* Fan out implementation */
.style-wheel-container.open .style-option:nth-child(1) {
    transform: translateY(-5rem);
}

.style-wheel-container.open .style-option:nth-child(2) {
    transform: translateY(-9rem);
}

.style-wheel-container.open .style-option:nth-child(3) {
    transform: translateY(-13rem);
}

.style-preview {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.style-option:hover {
    background: var(--accent);
    color: #fff;
    transform: scale(1.05) !important;
}

/* Maintain positions on hover */
.style-wheel-container.open .style-option:nth-child(1):hover {
    transform: translateY(-5rem) scale(1.05);
}

.style-wheel-container.open .style-option:nth-child(2):hover {
    transform: translateY(-9rem) scale(1.05);
}

.style-wheel-container.open .style-option:nth-child(3):hover {
    transform: translateY(-13rem) scale(1.05);
}