:root {
  --background-color-light: #f5f7fa;
  --background-color-dark: #2a2a2a;
  --sidebar-color-light: #1b1c1d;

  --theme-light-color: rgba(152, 152, 152, 0.3);
  --tcm-blue-color: rgb(99,145,210);
  --mediux-color: #945af2;

  /* Same as fomantic ui red */
  --support-button-color: #db2828;

  /* Accessibility colors */
  --accessible-red-color: #ff203b;
  --accessible-green-color: #1256ff;
  --accessible-blue-color: rgb(26, 133, 255);
  --accessible-orange-color: rgb(212, 17, 89);
}

body {
  background-color: #1b1c1d;
}

/* Mediux button styling */
.ui.mediux.button {
  color: var(--mediux-color) !important;
}
.ui.mediux.button:hover {
  box-shadow: inset 0 -0.2em 0 var(--mediux-color);
}

/* Accessibility coloring */
body.accessible .ui .red.bar {
  background-color: var(--accessible-red-color) !important;
}
body.accessible .ui .green.bar {
  background-color: var(--accessible-green-color) !important;
}
body.accessible .ui .blue.bar {
  background-color: var(--accessible-blue-color) !important;
}
body.accessible .ui .orange.bar {
  background-color: var(--accessible-orange-color) !important;
}

.inverted.form input {
  /* background: #e4e4e4 !important; */
  background: #1b1c1d !important;
  color: white !important;
}

/* Fix header in place, lock window positioning */
body > div:first-of-type {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
}

#main-content {
  /* Ensure main content is scrollable */
  overflow-x: hidden;
  /* Add margin for main content to space from header and sidebar */
  padding: 15px 15px 15px 115px;
  /* padding: 15px 15px 15px 15px; */
  /* Always position below header */
  z-index: 98;
}

/* FLoating log messages (toasts) */
#__current_log {
  /* Position message in the lower-right corner */
  position: fixed;
  bottom: 0.8em;
  right: 1em;
  /* Color semi-transparent black with a blue right border */
  color: white;
  background-color: rgba(21, 21, 21, 90%);
  border-right: 3px solid rgb(76, 154, 247);
  /* Add slight shadow */
  box-shadow: rgba(0, 0, 0, 60%) 5px 5px 5px;
  /* Curve edges */
  border-radius: 0.4em;
  padding: 0.785em 1em;
  /* Limit width */
  max-width: 400px;
  /* Position above all other content */
  z-index: 9999;
}

/* Stylize "code" color text */
code.color {
  /* Add stylized bubble */
  padding: .1em .2em;
  background-color: rgba(110, 118, 129, 0.4);
  border-radius: 6px;
  /* Do not italicize color name */
  font-style: normal;
}

/* Color inline color circles */
span.color.circle {
  /* --color: transparent; */
  border-radius: 50%;
  width: 8px;
  height: 8px;
  display: inline-block;
  background-color: var(--color, var(--default-color, transparent));
  border: 0.5px solid var(--color, var(--default-color, #ffffff7d));
  /* Add space between color bubble and name */
  margin-left: 4px;
}

img ~ .color.palette {
  margin-top: 0.3em;
}
/* Palette colors are styled separately */
.color.palette > span.color {
  /* --color: transparent; */
  width: 45px; /* 35px; */
  height: 85px; /* 75px; */
  display: inline-block;
  background-color: var(--color, transparent);
  /* border: 0.5px dashed var(--alt-color, white); */
  /* Add spacing */
  margin-left: 4px;
  /* Round edges of palette swatches */
  border-radius: 0.4rem;
  /* Show pointer on hover to indicate selectability */
  cursor: pointer;
}
.small.color.palette > span.color {
  width: 30px;
  height: 50px;
}

/* Header element alignment */
#page-header {
  align-items: center;
  display: flex;
  height: 70px;
  flex: 0 0 auto;
  /* Drop shadow so header is separated from rest of page */
  box-shadow: 1px 1px 10px -3px rgba(252, 252, 252, 0.8);
}
#page-header >* {
  display: flex;
  align-items: center;
}
/* Remove extra margin from header button */
#page-header .ui.button > .icon {
  margin: unset;
}
/* Right aligned header elements */
#page-header > [data-position="right"] {
  justify-content: flex-end;
  flex-grow: 1;
  margin-right: 25px;
  @media (max-width: 768px) {
    margin-right: unset;
  }
}
#page-header > [data-position="right"] >* {
  margin-right: 10px;
}
#tcm-logo {
  /* Pad the entire width of the sidebar */
  flex: 0 0 94px; /* 0 0 109px */
  /* Center logo horizontally */
  justify-content: center;
}

/* Global background gradient */
body {
  background-image: linear-gradient(to bottom right, var(--background-color-light), #d9d9d9);
  /* linear-gradient(to bottom right, var(--background-color-dark), #313131) */ 
}

/* Don't put any scrollbars in the sidebar */
#nav-menu > .sidebar {
  overflow: hidden;
}

/* Style for the header on all pages */
#page-header {
  /* height: 70px; */
  background-color: var(--sidebar-color-light);
  z-index: 99; /* Position above all elements */
}

/* Remove outline from logo */
#tcm-logo img {
  max-height: 50px;
  @media (max-width: 768px) {
    /* Remove fixed width on logo */
    width: unset;
    flex: 0 0 70px;
  }
}
#tcm-logo, #tcm-logo:hover {
  box-shadow: none;
}

/* Position sidebar below header */
#nav-menu .sidebar {
  top: 70px;
}

/* Format for the search results */
.search.content {
  display: inline-block;
  vertical-align: middle;
  /* Cut off any long series name */
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
}
.search.content > img {
  height: 50px;
  width: 35px;
  vertical-align: middle;
  margin-right: 8px;
}
.search.result {
  padding: 7px !important;
}

/* Format right aligned fields and inputs */
.right.aligned.field,
.right.aligned.field input {
  text-align: right;
}
/* Adjacent input fields need additional top margin */
input ~ input {
  margin-top: 4px !important;
}

/* Dropdown headers are red */
.ui.dropdown >* .header {
  color: crimson !important;
}

/* Add shadow around search input when selected */
#search-bar input:focus {
  box-shadow: 0 0 1.1em 0 var(--tcm-blue-color) !important;
}

/* Support button */
#support-button {
  /* Add glow effect */
  border-radius: 0.25em;
  box-shadow: 0 0 1.1em 0 var(--support-button-color);
  @media (max-width: 768px) {
    /* Hide support button on mobile */
    display: none;
  }
}
/* Don't leave any additional margin */
#support-button .button {
  margin: 0;
}

html.ios {
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}
html.ios,
html.ios body {
  height: initial !important;
}

/* Scrollbar customization */
::-webkit-scrollbar {
  width: 0.5em;
}
::-webkit-scrollbar-track {
  background: rgba(12, 12, 12, 0.2);
  border-radius: 100vw;
  margin-block: 0.5em;
}
::-webkit-scrollbar-thumb {
  background: var(--tcm-blue-color);
  border-radius: 100vw;
  border: 0.25em solid var(--tcm-blue-color);
}

/* Firefox support */
@supports (scrollbar-color: red blue) {
  * {
    scrollbar-color: var(--tcm-blue-color) rgba(12,12,12, 0.2);
  }
}

/* Mobile formatting */
@media only screen and (hover: none) and (pointer: coarse) {
  /* Prevent iOS auto-zoom on input focus (happens for font sizes <16px) */
  input:focus,
  select:focus,
  textarea:focus {
    font-size: 16px !important;
  }
}

@media (max-width: 768px) {
  /* Do not use absolute positioning, let items stack themselves */
  #page-header > div {
    position: unset;
  }

  /* Shrink search input */
  #header-search input {
    width: 100px;
  }

  /* Hide icons */
  #nav-menu i {
    display: none;
  }

  /* Use reduced padding */
  #main-content {
    /* padding-left: 95px; */
    padding-left: 15px;
  }
  #nav-menu {
    display: none;
  }
  #nav-menu .item {
    padding: 1.25em 0.1em;
  }
  #nav-menu .sidebar {
    top: 70px;
  }
}

/* Add glow effect on selected input fields */
body.dark *:not(td) input:active,
body.dark *:not(td) input:focus,
body.dark *:not(td).dropdown:not(.inline):not(.icon):hover {
  /* Dark theme */
  box-shadow: 0px 0px 15px white !important;
}
body:not(.dark) *:not(td) input:active,
body:not(.dark) *:not(td) input:focus,
body:not(.dark) *:not(td) .dropdown:not(.inline):not(.icon):hover {
  /* Light theme */
  box-shadow: 0px 0px 15px #b6b6b6 !important;
}

/* Format help notes */
p.help {
  color: #737373;
  font-size: 0.95em;
  font-style: italic;
  padding-top: 0.2em;
}

/* Make help text for active inputs more evident */
body.dark input:active ~ p.help,
body.dark input:focus ~ p.help,
body.dark .input ~ p.help:hover,
body.dark .dropdown:hover ~ p.help,
body.dark .dropdown.active ~ p.help,
body.dark .checkbox.field:hover p.help,
body.dark .fields:hover ~ p.help {
  /* Dark theme */
  color: #cce2ff; /* #d7dfeb */
}
body:not(.dark) input:active ~ p.help,
body:not(.dark) input:focus ~ p.help,
body:not(.dark) .dropdown:hover ~ p.help,
body:not(.dark) .dropdown.active ~ p.help,
body:not(.dark) .checkbox.field:hover p.help,
body:not(.dark) .fields:hover ~ p.help {
  /* Light theme */
  color: #171515;
}

.blueprint.card [data-action="blacklist"]:hover {
  color: #db2828 !important;
}
.blueprint.card [data-action="import"]:hover {
  color: #2ecc40;
}
