
/*
 * Psono Dark Theme - Contrast Fixes
 * Designed for the existing dark JSON theme.
 */

:root {
  color-scheme: dark;
}

/* General text and page headings */
body {
  color: #edf3fa;
}

.MuiPaper-root {
  color: #edf3fa !important;
}

/* Text buttons: Close, Advanced, Show History, etc. */
.MuiButton-root:not(.MuiButton-contained) {
  color: #dce7f2 !important;
}

.MuiButton-root:not(.MuiButton-contained):hover {
  background-color: #344658 !important;
  color: #ffffff !important;
}

/* Keep primary green buttons readable */
.MuiButton-containedPrimary {
  color: #09251d !important;
}

.MuiButton-containedPrimary:hover {
  background-color: #77e4c3 !important;
  color: #09251d !important;
}

.MuiButton-root.Mui-disabled {
  color: #8796a7 !important;
}

/* Icons and toolbar buttons */
.MuiIconButton-root,
.MuiSvgIcon-root,
.MuiToggleButton-root {
  color: #c6d2df;
}

.MuiIconButton-root:hover,
.MuiToggleButton-root:hover {
  background-color: #344658 !important;
}

.MuiToggleButton-root.Mui-selected {
  background-color: #30584c !important;
  color: #77e4c3 !important;
}

/*
 * Datastore entry hover.
 * Psono hard-codes a light background here.
 * Select the tree row by its structure rather
 * than relying on generated class names.
 */
div:has(> button[aria-label] ~ .MuiButtonGroup-root) {
  color: #edf3fa !important;
}

div:has(> button[aria-label] ~ .MuiButtonGroup-root):hover {
  background-color: #304253 !important;
  border-color: #455b70 !important;
}

div:has(> button[aria-label] ~ .MuiButtonGroup-root):hover > button {
  color: #ffffff !important;
}

/* Folder hover and selection */
button[aria-expanded]:not(.MuiButtonBase-root):hover,
button[aria-expanded]:not(.MuiButtonBase-root).selected {
  background-color: #304253 !important;
  color: #ffffff !important;
}

/* Dropdown and context menus */
.MuiMenuItem-root {
  color: #edf3fa !important;
}

.MuiMenuItem-root:hover,
.MuiMenuItem-root.Mui-selected {
  background-color: #304253 !important;
  color: #ffffff !important;
}

.MuiListItemIcon-root {
  color: #b7c7d9 !important;
}

/* Markdown/rich-text editor content */
.ProseMirror,
.tiptap,
[contenteditable="true"].ProseMirror {
  background-color: #1e2935 !important;
  color: #edf3fa !important;
  caret-color: #edf3fa !important;
}

.ProseMirror p,
.ProseMirror li,
.ProseMirror h1,
.ProseMirror h2,
.ProseMirror h3,
.tiptap p,
.tiptap li {
  color: inherit;
}

.ProseMirror a,
.tiptap a {
  color: #77e4c3 !important;
}

/* Text fields */
.MuiInputBase-input {
  color: #edf3fa !important;
}

.MuiInputLabel-root {
  color: #a4b8cb;
}

/* Accessible focus indication */
.MuiButton-root:focus-visible,
.MuiIconButton-root:focus-visible {
  outline: 2px solid #77e4c3;
  outline-offset: 2px;
}


/* Remove why border on entries. */
/*div:has(> button[aria-label] + .MuiButtonGroup-root) {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}*/

/* Second attempt at removing borders */
/* Psono datastore entries: replace white outlines */
div:has(> button[aria-label] + .MuiButtonGroup-root) {
    border: 1px solid #354456 !important;
    outline: none !important;
    box-shadow: none !important;
}

/* Subtle border on hover */
div:has(> button[aria-label] + .MuiButtonGroup-root):hover {
    border-color: #455b70 !important;
}
