/**
 * Simple appearance presets: color schemes + font stacks.
 * Applied via html[data-theme] and html[data-font].
 */

:root,
html[data-theme="content"] {
    --accent: #868686;
    --chrome-bg: #e8e8e8;
    --chrome-text: #868686;
    --chrome-border: #ffffff;
    --profile-bg: #f8f8f8;
    --menu-bg: #efefef;
    --panel-disabled: #efefef;
    --panel-disabled-text: #aaaaaa;
    --surface: #ffffff;
    --surface-text: #333333;
    /* Soft highlight wash (not a solid accent fill) */
    --selection: #f0f0f0;
    --selection-text: #a6a6a6;
    --selection-light: #f9f9f9;
    --selection-dark: #f8f8f8;
    --border: #c0c0c0;
    --link: #529ad5;
    --menu-item-bg: #f8f8f8;
    --brand-color: #555555;
    --panel-title-color: #da7959;
    --panel-title-weight: 300;
}

/*
 * Accent: paint chrome (header, profile, main menu) with the accent color.
 * Highlights get a translucent wash of that color — not a solid fill —
 * and keep readable content text. Chrome text flips light/dark for contrast.
 */
html[data-theme="accent"] {
    --accent: #54a12d;
    --chrome-bg: #54a12d;
    --chrome-text: #ffffff;
    --chrome-border: rgba(255, 255, 255, 0.22);
    --profile-bg: #54a12d;
    --menu-bg: #54a12d;
    --panel-disabled: #4a9128;
    --panel-disabled-text: rgba(255, 255, 255, 0.55);
    --surface: #ffffff;
    --surface-text: #333333;
    --selection: rgba(84, 161, 45, 0.22);
    --selection-text: #333333;
    --selection-light: rgba(84, 161, 45, 0.12);
    --selection-dark: #2d5718;
    --border: #c0c0c0;
    --link: #3d7a1f;
    --menu-item-bg: #54a12d;
    --brand-color: #ffffff;
    --panel-title-color: #54a12d;
    --panel-title-weight: 300;
}

html[data-theme="dark"] {
    --accent: #6cb6e8;
    --chrome-bg: #2a2a2a;
    --chrome-text: #b0b0b0;
    --chrome-border: #1e1e1e;
    --profile-bg: #2a2a2a;
    --menu-bg: #242424;
    --panel-disabled: #242424;
    --panel-disabled-text: #777777;
    --surface: #1e1e1e;
    --surface-text: #e0e0e0;
    --selection: #3a3a3a;
    --selection-text: #d0d0d0;
    --selection-light: #333333;
    --selection-dark: #181818;
    --border: #444444;
    --link: #6cb6e8;
    --menu-item-bg: #2a2a2a;
    --brand-color: #e0e0e0;
    --panel-title-color: #e0a080;
    --panel-title-weight: 300;
}

html[data-font="current"],
:root {
    --ui-font: Arial, Helvetica, sans-serif;
    --title-font: "Open Sans", Arial, Helvetica, sans-serif;
    --brand-font: "Roboto Slab", Arial, Helvetica, sans-serif;
}

html[data-font="clean"] {
    --ui-font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --title-font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --brand-font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---- Fonts ---- */

body {
    font-family: var(--ui-font);
    color: var(--surface-text);
    background: var(--surface);
}

.thin,
.label-like,
#dashboard_title,
.mp-name {
    font-family: var(--title-font);
}

.mp-header .mp-name {
    font-family: var(--title-font);
    font-weight: var(--panel-title-weight, 300);
    color: var(--panel-title-color, #da7959);
}

#m-header-title #m-header-brand {
    font-family: var(--brand-font);
    color: var(--brand-color);
}

/* ---- Shell chrome ---- */

#title-bar {
    background: var(--chrome-bg);
    color: var(--chrome-text);
}

#title-bar .title,
#m-header-search-form button {
    color: var(--chrome-text);
}

#m-header-search-form button {
    background-color: var(--chrome-bg);
}

#left-menu,
.page-content-wrapper > .ff-fix.with-background {
    background: var(--menu-bg);
}

#main {
    background: var(--surface);
}

#profile,
#access,
#user-coins {
    background: var(--profile-bg);
    color: var(--chrome-text);
}

#profile .name,
#profile .name a,
#access > li a {
    color: var(--chrome-text);
}

.navigable,
.big-menu > li {
    background-color: var(--menu-item-bg);
    color: var(--chrome-text);
}

.big-menu > li {
    border-bottom-color: var(--chrome-border);
}

.big-menu > li > a {
    color: var(--chrome-text);
}

.menu-sortable-handler {
    color: var(--chrome-text);
}

/* Accent chrome: solid accent fill + light text on header / profile / menu */
html[data-theme="accent"] #title-bar,
html[data-theme="accent"] #profile,
html[data-theme="accent"] #access,
html[data-theme="accent"] #left-menu,
html[data-theme="accent"] .navigable,
html[data-theme="accent"] .big-menu > li {
    background-color: var(--chrome-bg);
    background-image: none;
    color: var(--chrome-text);
}

html[data-theme="accent"] #profile {
    border-bottom-color: var(--chrome-border);
}

/* Accent highlights: translucent wash only — keep content text dark */
html[data-theme="accent"] ul.page-list li.selected > .page-item-inside,
html[data-theme="accent"] tr.selected td,
html[data-theme="accent"] .panel-type-switcher a .week-selected,
html[data-theme="accent"] .theme-bg,
html[data-theme="accent"] .accent-bg,
html[data-theme="accent"] .blue-bg,
html[data-theme="accent"] .green-bg {
    background: var(--selection);
    color: var(--selection-text);
    border-color: transparent;
}

/* ---- Workspace board ---- */

.mp-panel {
    background-color: var(--surface);
    border-right-color: var(--selection-dark);
    color: var(--surface-text);
}

.mp-panel.disabled {
    background: var(--panel-disabled);
}

.mp-panel.disabled * {
    color: var(--panel-disabled-text) !important;
    text-shadow: none;
}

html[data-theme="dark"] .mp-panel.disabled * {
    text-shadow: none !important;
}

.panel-type-switcher .current {
    background: var(--chrome-bg);
}

ul.page-list li.selected > .page-item-inside {
    background: var(--selection);
    color: var(--selection-text);
}

ul.page-list li.selected > .page-item-inside .extra-expanded-item-info {
    background: var(--selection-light);
    color: var(--surface-text);
}

.mp-content-task ul.page-list li.selected > .page-item-inside {
    background: var(--selection-light);
}

.panel-type-switcher a .week-selected {
    background: var(--selection);
}

tr.selected td {
    background: var(--selection) !important;
    color: var(--selection-text) !important;
}

.endpoint-arrow:after,
.endpoint-arrow-start:after {
    background-color: var(--selection);
    border: 1px solid var(--selection-dark);
}

.theme-bg,
.content-bg,
.accent-bg,
.dark-bg,
.blue-bg,
.green-bg {
    background: var(--selection);
    border-color: var(--selection);
}

.page-item .undo-resort {
    color: var(--selection-text);
}

.dp-week-selected > td[data-handler],
.dp-week-selected > td.dp-checked {
    background: var(--selection);
}

.ch-header {
    background: var(--chrome-bg);
    border-color: var(--border);
}

.fc-event {
    background-color: var(--selection);
    border: 1px solid var(--selection-dark);
}

.ch-body.hovered-upload-area:after {
    border-color: var(--selection);
}

.ch-menu-wrapper > ul > li:hover {
    background-color: var(--selection);
    border-color: var(--selection-dark);
    color: var(--chrome-text);
}

.ch-actions i.active {
    background: var(--surface);
    border-top: 1px solid var(--border);
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
}

.fb-button {
    background-color: var(--selection);
    border-color: var(--selection-dark);
    color: var(--chrome-text);
}

.conv-list-table > tr.active {
    background-color: var(--selection);
    color: var(--selection-text);
}

.conv-list-table > tr.active:hover {
    background: var(--selection);
}

.conv-list-table > tr.active .conv-last-activity {
    color: var(--selection-text);
}

.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_date.xdsoft_default,
.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_date.xdsoft_current,
.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box > div > div.xdsoft_time.xdsoft_current,
.xdsoft_datetimepicker .xdsoft_label > .xdsoft_select > div > div.xdsoft_option.xdsoft_current {
    background: var(--selection);
    box-shadow: none;
}

.wl-mode-switcher .active,
.wl-mode-switcher .active:hover {
    background: var(--selection);
}

a,
a:link {
    color: var(--link);
}

/* Dark mode: soften a few high-contrast leftovers */
html[data-theme="dark"] .mp-panel.disabled {
    border-left-color: transparent;
}

html[data-theme="dark"] #title-bar {
    border-bottom: 1px solid var(--border);
}
