/* ============================================
   Theme System - Mighty System
   ============================================ */

/* Light Theme (Default) */
[data-theme="light"], :root {
    --bg-primary: #f5f5f7;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f0f0f2;
    --bg-elevated: #e8e8ec;

    --border-subtle: #e2e2e6;
    --border-default: #d1d1d6;
    --border-strong: #b8b8be;

    --text-primary: #1a1a1e;
    --text-secondary: #52525b;
    --text-muted: #8e8e93;

    --accent: #0071e3;
    --accent-hover: #0060c0;
    --accent-muted: rgba(0, 113, 227, 0.1);

    --success: #22c55e;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;

    --sidebar-bg: #ffffff;
    --topbar-bg: #ffffff;
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Dark Theme */
[data-theme="dark"] {
    --bg-primary: #0a0a0b;
    --bg-secondary: #141416;
    --bg-tertiary: #1c1c1f;
    --bg-elevated: #242428;

    --border-subtle: #2a2a2e;
    --border-default: #3a3a3f;
    --border-strong: #4a4a50;

    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;

    --accent: #22d3ee;
    --accent-hover: #06b6d4;
    --accent-muted: rgba(34, 211, 238, 0.15);

    --success: #22c55e;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;

    --sidebar-bg: #141416;
    --topbar-bg: #141416;
    --card-shadow: none;
}

/* Midnight Blue Theme */
[data-theme="midnight"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #273548;
    --bg-elevated: #334155;

    --border-subtle: #334155;
    --border-default: #475569;
    --border-strong: #64748b;

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --accent: #60a5fa;
    --accent-hover: #3b82f6;
    --accent-muted: rgba(96, 165, 250, 0.15);

    --success: #34d399;
    --warning: #fbbf24;
    --error: #f87171;
    --info: #60a5fa;

    --sidebar-bg: #1e293b;
    --topbar-bg: #1e293b;
    --card-shadow: none;
}

/* Emerald Theme */
[data-theme="emerald"] {
    --bg-primary: #f0fdf4;
    --bg-secondary: #ffffff;
    --bg-tertiary: #ecfdf5;
    --bg-elevated: #d1fae5;

    --border-subtle: #d1fae5;
    --border-default: #a7f3d0;
    --border-strong: #6ee7b7;

    --text-primary: #14532d;
    --text-secondary: #166534;
    --text-muted: #4ade80;

    --accent: #059669;
    --accent-hover: #047857;
    --accent-muted: rgba(5, 150, 105, 0.1);

    --success: #22c55e;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;

    --sidebar-bg: #ffffff;
    --topbar-bg: #ffffff;
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* Sunset Theme */
[data-theme="sunset"] {
    --bg-primary: #1c1017;
    --bg-secondary: #271820;
    --bg-tertiary: #33202a;
    --bg-elevated: #3f2835;

    --border-subtle: #3f2835;
    --border-default: #5c3a4a;
    --border-strong: #7a4d60;

    --text-primary: #fdf2f8;
    --text-secondary: #f9a8d4;
    --text-muted: #be185d;

    --accent: #f472b6;
    --accent-hover: #ec4899;
    --accent-muted: rgba(244, 114, 182, 0.15);

    --success: #34d399;
    --warning: #fbbf24;
    --error: #fb7185;
    --info: #818cf8;

    --sidebar-bg: #271820;
    --topbar-bg: #271820;
    --card-shadow: none;
}

/* Ocean Theme */
[data-theme="ocean"] {
    --bg-primary: #eff6ff;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e0f2fe;
    --bg-elevated: #bae6fd;

    --border-subtle: #bae6fd;
    --border-default: #7dd3fc;
    --border-strong: #38bdf8;

    --text-primary: #0c4a6e;
    --text-secondary: #075985;
    --text-muted: #0ea5e9;

    --accent: #0284c7;
    --accent-hover: #0369a1;
    --accent-muted: rgba(2, 132, 199, 0.1);

    --success: #22c55e;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #0ea5e9;

    --sidebar-bg: #ffffff;
    --topbar-bg: #ffffff;
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* ============================================
   Theme Switcher UI Styles
   ============================================ */
.theme-switcher {
    position: relative;
}

.theme-toggle-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-default);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 500;
    transition: all 0.15s ease;
}

.theme-toggle-btn:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border-color: var(--border-strong);
}

.theme-toggle-btn i {
    font-size: 0.875rem;
}

.theme-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    padding: 0.375rem;
    min-width: 180px;
    z-index: 1000;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.theme-dropdown.open {
    display: block;
}

.theme-option {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    width: 100%;
    padding: 0.5rem 0.625rem;
    background: transparent;
    border: none;
    border-radius: 5px;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 500;
    transition: all 0.12s ease;
    text-align: left;
}

.theme-option:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.theme-option.active {
    background: var(--accent-muted);
    color: var(--accent);
}

.theme-swatch {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--border-default);
    flex-shrink: 0;
}

.theme-option.active .theme-swatch {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-muted);
}

/* Swatch colors */
.swatch-light { background: linear-gradient(135deg, #ffffff, #f5f5f7); }
.swatch-dark { background: linear-gradient(135deg, #1c1c1f, #0a0a0b); }
.swatch-midnight { background: linear-gradient(135deg, #1e293b, #0f172a); }
.swatch-emerald { background: linear-gradient(135deg, #34d399, #059669); }
.swatch-sunset { background: linear-gradient(135deg, #f472b6, #ec4899); }
.swatch-ocean { background: linear-gradient(135deg, #38bdf8, #0284c7); }
