/* === buttons, generic === */

/* light theme palette: https://paletton.com/#uid=54G1h0kww++ls+hqJ+UPQ+++DL3 */
:root {
  /* violet */
  --primary: #A50EFF;
  --primary-alt: #C15DFD;

  /* orange */
  --secondary: #FF610D;
  --secondary-alt: #FF742A;

  --button-active: var(--text-color);

  --main-font: monospace;
  --main-letter-spacing: -0.5px;
  --background: #EFEFEF;
  --text-color: #111;

  --editor-head-background: var(--primary);
  --editor-background: white;
  --editor-head-color: var(--background);
  --editor-text-color: black;
  --selection: #BBB;

  --modal-background: white;

  --link-color: #0097D0;
  --link-active: var(--button-active);
  --link-hover: #0ABBFF;
  --link-visited: var(--link-color);
}

/* dark theme palette: https://paletton.com/#uid=54F1h0khSZu6p+FcM+3mvYGr2Wi */
html.dark {
  /* light violet */
  --primary: #C877FB;
  --primary-alt: #D89EFD;

  /* light orange */
  --secondary: #FF884C;
  --secondary-alt: #FFA171;

  --background: #070e19;
  --text-color: #efefef;

  --editor-head-background: var(--background);
  --editor-background: #0b1a35;
  --editor-head-color: var(--text-color);
  --editor-text-color: #d1edff;
  --selection: #555;

  --modal-background: var(--background);
  --link-color: #50CEF8;
  --link-hover: #2DC0F1;
}

* {
  box-sizing: border-box !important;
}

::selection {
  background: var(--selection);
}

html, body {
  height: 100%;
  margin: 0;
}

body {
  font-family: var(--main-font);
  letter-spacing: var(--main-letter-spacing);
  font-size: 1.3em;
  line-height: 1.3em;
  padding: 10px 20px;
  background: var(--background);
  color: var(--text-color);
}

.hl, h1 {
  color: var(--primary);
}

hr {
  border: 1px solid var(--primary-alt);
}

.small {
  font-size: 0.8em;
}

.mono {
  font-family: var(--monospace);
}

.italic {
  font-style: italic;
}

h1 {
  font-family: var(--monospace);
  line-height: 1.6rem;
  margin-bottom: 5px;
}

footer {
  text-align: right;
  font-family: monospace;
  height: 30px;
  margin-top: 30px;
}

/* === links === */
a { color: var(--link-color); }
a:hover { color: var(--link-hover) !important; }
a:active { color: var(--link-active) !important; }
a:visited { color: var(--link-visited); }

/* === layout === */
body {
  display: flex;
  flex-direction: column;
}

.flex-horizontal {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 5px;
  width: 100%;
}

.flex-horizontal:first-child {
  /* have toplinks on the right */
  flex-direction: row-reverse;
}

#main, #title {
  flex-grow: 1;
}

#buttons-wrapper {
  margin: 10px 0;
  gap: 7px;
}

#buttons-wrapper > div:first-child {
  margin-right: 10px;
}

#editors-wrapper {
  margin-top: 20px;
  height: 500px;
  resize: vertical;
  overflow: auto;
}

.textarea-column {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    max-width: calc(50% - 5px);
}

.textarea {
    flex-grow: 1;
    height: 0;
}

.textarea .CodeMirror {
  height: 100%;
  overflow: hidden;
  padding: 7px;
  border-radius: 0 0 0 20px;
}

#select-profile {
  margin-right: 1em;
}

#options {
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
}

#options > div {
    flex: 50%;
    padding: 0 10px 0 0;
}

@media (max-width: 650px) {
  body {
    /* Make it easy to scroll */
    padding: 10px 20px 7px 10px;
  }
  .flex-horizontal {
    display: initial !important;
  }
  #buttons-wrapper > div:first-child,
  #buttons-wrapper>div:nth-child(2) {
    margin-bottom: 18px;
  }
  html textarea {
    height: 300px;
    resize: none;
  }
  .textarea-column {
    margin-top: 20px;
    max-width: 100%;
  }
  #options > div {
      flex: 100%;
  }
}

/* === buttons === */

button {
  font-family: monospace;
  background-color: transparent;
  color: var(--primary);
  border: 0.1rem solid var(--primary);
  border-radius: .4rem;
  font-weight: 700;
  height: 2rem;
  padding: 0 10px;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
  outline: none !important;
}

button.small {
  font-size: .8rem;
  height: 1.5rem;
}

button:hover {
  color: var(--secondary-alt);
  border-color: var(--secondary-alt);
}

button.fill {
  color: var(--background) !important;
  background-color: var(--primary);
}

button.fill:hover {
  background-color: var(--secondary-alt);
}

button.secondary {
  color: var(--secondary);
  border-color: var(--secondary);
  background-color: var(--background);
}

button.secondary:hover {
  color: var(--primary-alt);
  border-color: var(--primary-alt);
}

button:active {
  background-color: var(--background);
  border-color: var(--button-active);
  color: var(--button-active);
}

button.fill:active {
  background-color: var(--button-active);
  border-color: var(--button-active);
}

/* === editor area === */

.textarea-head {
  font-family: var(--monospace);
  background: var(--editor-head-background);
  color: var(--editor-head-color);
  font-size: 18px;
  padding: 5px;
  text-align: center;
  height: 30px;
  overflow: hidden;
}

.textarea {
  font-family: var(--monospace);
}

textarea:focus {
  border-color: var(--primary-alt);
}

/* === options === */

#div-reveal-options .content {
  padding: 15px 8px;
  margin: 5px 0;
}

#options label {
  font-weight: bold;
}

#options span.help {
  display: block;
  margin: 4px 0 10px 5px;
  font-size: 0.8em;
}

input {
  font-family: var(--monospace);
  background: var(--editor-background);
  color: var(--text-color);
  outline: none;
  border: none;
}

input:focus {
    filter: brightness(2.5);
}

/* === accordion options === */

#options-wrapper {
  overflow: hidden;
}

#div-reveal-options {
  max-height: 1000px;
  transition: all .5s ease-in;
}

.hide {
  max-height: 0 !important;
  transition: all .2s ease-out;
}

/* === About modal === */

.modal {
  display: none;
  position: fixed;
  z-index: 1;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.6);
}

.modal-content {
  background-color: var(--modal-background);
  margin: 2em auto;
  padding: 20px;
  border: 1px solid #888;
  width: 80%;
  max-width: 900px;
  line-height: 1.2em;
  word-break: break-word;
}

.modal .close {
  color: var(--secondary);
  float: right;
  font-size: 28px;
  font-weight: bold;
}

.modal .close:hover,
.modal .close:focus {
  color: var(--primary-alt);
  text-decoration: none;
  cursor: pointer;
}

/* === toolbar links (icons from https://iconmonstr.com/) === */

.svg-icon-holder {
  display: inline-block;
  height: 28px;
  width: 28px;
  cursor: pointer;
}

.svg-icon-holder svg {
  fill: var(--secondary);
}

.svg-icon-holder:hover svg {
  fill: var(--primary-alt);
}

.svg-icon-holder:active svg {
  fill: var(--button-active);
}

/* === checkboxes and inputs === */

/* Disable Number Arrow
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}*/

/* Base for label styling */
[type="checkbox"] {
  visibility: hidden;
  display: inline-block;
  width: 0;
  margin: 0;
  padding: 0;
}

[type="checkbox"]:not(:checked)+span,
[type="checkbox"]:checked+span {
  position: relative;
  padding-left: 2em;
  cursor: pointer;
}

/* checkbox aspect */
[type="checkbox"]:not(:checked)+span:before,
[type="checkbox"]:checked+span:before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 1.5rem;
  height: 1rem;
  background: var(--editor-background);
  border: 1px solid var(--editor-background);
}

/* checked mark aspect */
[type="checkbox"]:checked+span:after {
  content: '\2715';
  /* '✕' */
  position: absolute;
  top: .5rem;
  left: .5rem;
  color: var(--text-color);
  line-height: 0;
  -webkit-transition: all .2s;
  transition: all .2s;
  font-family: var(--monospace);
  font-weight: bold;
}

/* Accessibility */
[type="checkbox"]:checked:focus+span:before,
[type="checkbox"]:not(:checked):focus+span:before {
  /*box-shadow: inset 0 1px 3px rgba(0,0,0, .1), 0 0 0 6px rgba(203, 34, 237, .2);*/
  border-color: #444;
}

/* Select */

select {
  background: var(--editor-background);
  border: none;
  font-family: monospace;
  font-size: .9em;
  color: var(--text-color);
  padding: 2px 5px;
  outline: none !important;
}

/* Warnings */
#warnings-wrapper {
    margin-top: 10pt;
    text-align: center;
}

.warn {
    display: inline-block;
    background: #ffd311;
    color: #070e19;
    padding: 2pt 8pt;
    font-size: 0.7em;
    font-style: italic;
    border-radius: 10pt;
}

.warn::before {
    content: "❗";
    margin-right: 0.5em;
}
