/* Typographics */
html {
}
body {
  font-family: "Dosis";
  margin: 0;
}

/* UI */
.popup-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
}
div.popup-shadow {
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  position: fixed;
  background-color: rgba(0, 0, 0, 0.75);
  z-index: 1;
}

div.popup {
  position: relative; /*to make zindex work*/
  height: 86vh;
  width: 70%;
  margin: 2em auto 0 auto;
  background-color: #fceb9e;
  padding: 0 1em 1em 1em;
  border-radius: 0.5em;
  z-index: 2;
  color: black;
  border: solid;
  border-width: 2px;
  border-color: black;
}
.toolbar {
  display: flex;
  justify-content: center;
}

.toolbar > span {
  margin-left: 5px;
  margin-right: 5px;
}
#save-cancel {
  margin-left: 1em;
}

#file-dialog-save-btn,
#btn-files-save-cancel,
#btn-files-cancel,
#btn-svg-export-dialog-close {
  border-radius: 50px;
  font-family: "Dosis";
  font-weight: bold;
  font-size: 12px;
  width: 10%;
  border-style: solid;
  border-width: 2px;
  border-color: black;
}
#file-dialog-save-btn {
  background-color: #4364c7;
  color: white;
}

#file-dialog-save-btn:hover {
  box-shadow: 0 0 5px 2px #4364c7;
}

#select-button {
  margin-left: 5px;
  margin-right: 5px;
  font-size: 14px;
  font-family: "Dosis";
  background-color: #fcfacd;
  padding: 2px 5px;
}

#delete-button {
  margin-left: 5px;
  margin-right: 5px;
  font-size: 14px;
  font-family: "Dosis";
  background-color: #fcfacd;
  padding: 2px 5px;
  right: 1em;
  position: absolute;
}
#btn-files-save-cancel,
#btn-files-cancel,
#btn-svg-export-dialog-close {
  background-color: #d5ddf3;
  color: black;
}

#btn-files-cancel,
#btn-files-save-cancel {
  margin-top: 16px;
}
.popup-container h1 {
  margin: 0.3em 0 0.3em 0;
  text-align: center;
  color: #4364c7;
}

#file-dialog-save-as {
  background-color: #fcfacd;
  border: solid;
  border-color: black;
  border-width: 2px;
  font-family: "Dosis";
  width: 80%;
  margin-left: 1em;
  margin-right: 1em;
}

::placeholder {
  font-family: "Dosis";
}

.dialog-content {
  margin: 1em 1em 10px 1em;
  display: flex;
  align-items: center;
  justify-content: center;
}

#toggle-presets,
#toggle-all-grids,
#toggle-all-rules {
  border-radius: 50px;
  background-color: #d5ddf3;
  font-family: "Dosis";
  font-size: 14px;
  font-weight: bold;
  color: black;
  border-style: solid;
  border-width: 2px;
  border-color: black;
  margin-left: 2px;
  margin-right: 2px;
}

#toggle-presets.button-active,
#toggle-all-grids.button-active,
#toggle-all-rules.button-active {
  color: #ffffff;
  background-color: #4364c7;
}

#toggle-all-grids.button-disabled,
#toggle-all-rules.button-disabled,
#toggle-presets.button-disabled {
  background-color: #f0f0f0;
  color: #c0c0c0;
  border-color: #c0c0c0;
}

/*Main layout*/

#main {
  display: table;
  text-align: center;
  width: 100%;
}

#header {
  left: 0;
  top: 0;
  width: 100%;
  height: 0.5in;
  background-color: #fceb9e;
  display: flex;
  justify-content: center;
  align-items: center;
  border-bottom-style: solid;
  border-bottom-width: 2px;
  border-color: black;
  font-weight: 800;
  font-size: 20px;
}
#variant-menu {
  position: absolute;
  left: 0.5in;
  display: flex;
  justify-content: center;
  align-items: center;
  padding-right: 10px;
}
#variant-button {
  background-color: #fceb9e;
}
#variant-button svg {
  fill: #4364c7;
  width: 15;
  height: 12;
  margin: none;
}
#variant-name {
  color: #4364c7;
  margin-left: 5px;
}

#dropdown-content-1,
#dropdown-content-2,
#dropdown-content-3 {
  display: none;
  position: absolute;
  background-color: #d5ddf3;
  box-shadow: 0px 10px 10px 0px rgba(0, 0, 0, 0.4);
}
/*.dropdown:current .dropdown-content {
  display: block;
}*/
#dropdown-content-1 button,
#dropdown-content-2 button,
#dropdown-content-3 button {
  display: block;
  color: black;
  background-color: transparent;
  padding: 10px;
  text-decoration: none;
  margin: 0;
  width: 100%;
  text-align: left;
  font-size: 14px;
  font-family: "Dosis";
  font-weight: bold;
}
#dropdown-content-1 button:hover,
#dropdown-content-2 button:hover,
#dropdown-content-3 button:hover {
  color: #ffffff;
  background-color: #4364c7;
}

#btn-guide:hover,
#btn-svg-export-dialog-close:hover,
#toggle-all-grids:hover,
#btn-files-save-cancel:hover,
#btn-files-cancel:hover,
#btn-examples:hover,
#btn-conway-examples:hover,
#btn-immigration-examples:hover,
#btn-rainbow-examples:hover {
  /*color: #ffffff;
  background-color: #4364c7;*/
  box-shadow: 0 0 5px 2px #4364c7;
}
#toggle-presets.hover:hover,
#toggle-all-rules.hover:hover,
#btn-db-save.hover:hover,
#btn-db-load.hover:hover,
#btn-mode-edit.hover:hover,
#btn-mode-pan.hover:hover,
#btn-nav-home.hover:hover,
#btn-export-svg.hover:hover,
#btn-set-grid.hover:hover,
#btn-set-rule.hover:hover {
  /*color: #ffffff;
  background-color: #4364c7;*/
  box-shadow: 0 0 5px 2px #4364c7;
}

#references {
  color: #4364c7;
  text-decoration: none;
  position: absolute;
  right: 0.5in;
}
#references a:hover {
  text-decoration: underline;
}

#main-row {
  display: table-row;
}

#toolbar {
  text-align: center;
  display: table-cell;
  vertical-align: top;
  padding-right: 0.25in;
  padding-top: 0.25in;
  padding-bottom: 0.25in;
}

.slider {
  width: 75px;
  height: 20px;
  -webkit-appearance: none;
  appearance: none;
  background: #4364c7;
  border-radius: 50px;
  border: solid;
  border-color: black;
  border-width: 2px;
  outline: none;
  -webkit-transition: 0.2s; /* 0.2 seconds transition on hover */
  transition: opacity 0.2s;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: white;
  cursor: pointer;
}

.slider::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: white;
  cursor: pointer;
}

#rsg {
  display: flex;
  flex-direction: column;
  height: 100%;
  /*margin-top: 154.25px;*/
  margin-top: 100px;
  align-items: center;
}

#slider {
  padding-top: 0.25in;
}

#speed {
  padding-bottom: 0.1in;
  font-weight: bold;
}

#speed-value {
  font-weight: bold;
}

#main-content {
  vertical-align: top;
  display: table-cell;
}

.add-emp {
  font-weight: 600;
}

.caption {
  font-size: 10px;
  text-align: center;
  font-weight: bold;
  margin-left: 10px;
}

ol,
ul {
  padding-inline-start: 15px;
}

ul {
  margin-top: 0;
}
/*To position floating toolbars*/
#floating-wrapper {
  position: relative;
}
div.overlay-toolbar {
  position: absolute;
  display: inline-block;
  top: 1em;
}

#left-sidebar {
  vertical-align: top;
  height: 82vh;
  padding-left: 0.5in;
  padding-top: 0.25in;
  padding-right: 0.25in;
  display: flex;
  flex-direction: column;
  width: clamp(12rem, 24vw, 20rem);
}

#btn-db-save,
#btn-db-load,
#btn-export-svg,
#btn-mode-edit,
#btn-mode-pan,
#btn-nav-home,
#btn-guide,
#btn-examples {
  border-radius: 50px;
  background-color: #d5ddf3;
  font-family: "Dosis";
  font-size: 14px;
  font-weight: bold;
  color: black;
  border-style: solid;
  border-width: 2px;
  border-color: black;
  margin-left: 2px;
  margin-right: 2px;
}

#btn-guide.enabled,
#btn-examples.enabled {
  z-index: 10;
  position: relative;
}
#btn-db-save,
#btn-db-load,
#btn-export-svg,
#btn-mode-edit,
#btn-mode-pan {
  width: 25%;
}

#btn-nav-home {
  width: 35%;
}

#btn-play-start,
#btn-play-stop {
  display: block;
  width: 60;
  height: 60;
  border-radius: 50%;
  border-color: black;
  border-width: 2px;
  border-style: solid;
  margin-top: 10px;
  margin-bottom: 10px;
  background-color: #4364c7;
}

#btn-play-start svg {
  width: 20px;
  height: 20px;
  fill: white;
}
#btn-play-stop svg {
  width: 30px;
  height: 30px;
  fill: white;
}
#btn-reset,
#btn-step {
  display: block;
  width: 40;
  height: 40;
  background-color: #d5ddf3;
  border-radius: 50%;
  border-color: black;
  border-width: 2px;
  border-style: solid;
}

#btn-reset svg,
#btn-step svg {
  width: 15px;
  height: 15px;
  fill: black;
}

#btn-reset.hover-svg:hover,
#btn-step.hover-svg:hover {
  /*background-color: #4364c7;
  & svg {
    fill: white;
  }*/
  box-shadow: 0 0 5px 2px #4364c7;
}

#tiling,
#rules,
#statusbar,
#navigator {
  background-color: #fceb9e;
  border-radius: 20px;
  /*margin-top: 0.15in;*/
  padding: 10px;
  font-size: 18px;
  font-weight: bolder;
  border: solid 2px black;
}

#tiling-dash,
#statusbar-dash {
  margin-top: 0.15in;
  margin-bottom: 0.15in;
}

#rules-dash,
#navigator-dash {
  height: 100%;
  display: flex;
}

#rules,
#navigator {
  width: 100%;
}

#navigator-dash {
  overflow: hidden;
}
.guide-title {
  font-size: 18px;
  font-weight: bolder;
  margin-bottom: 10px;
}

.guide-content {
  font-size: 14px;
  text-align: left;
}

.close-guide {
  font-size: 14px;
  margin-top: 10px;
  width: 100%;
  height: 30px;
  color: #4364c7;
  font-weight: 600;
}

.close-guide:hover {
  text-decoration: underline;
}
.dim {
  /* For Internet Explorer 
  box-shadow: 0 0 0 1000px rgba(0, 0, 0, 0.3);*/

  /* For other browsers 
  box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.3);*/
  box-shadow: 0 0 0 1000px #fcfacd8a;
  box-shadow: 0 0 0 100vmax #fcfacd8a;
}

.unselected {
  border-style: dashed;
  border-color: #4364c7;
  border-width: 3px;
}
.selected {
  border-style: solid;
  border-color: red;
  border-width: 3px;
}

.hover-dash:hover {
  border-style: solid;
  border-color: red;
  border-width: 3px;
}

#guide-intro,
#examples-guide,
#variant-menu-guide,
#tiling-guide,
#save-load-guide,
#canvas-guide,
#rules-guide,
#simulation-control-guide,
#disk-control-guide,
#statusbar-guide,
#navigator-guide {
  position: absolute;
  text-align: center;
  background-color: #d5ddf3;
  border-radius: 20px;
  border: solid 2px black;
  padding: 10px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50%;
  max-width: 480px;
}

#btn-conway-examples,
#btn-immigration-examples,
#btn-rainbow-examples {
  border-radius: 50px;
  background-color: #fcfacd;
  font-family: "Dosis";
  font-weight: bold;
  font-size: 12px;
  color: black;
  width: 30%;
  border-style: solid;
  border-width: 2px;
  border-color: black;
}

#variant-examples-buttons {
  display: flex;
  justify-content: space-evenly;
  margin-top: 10px;
  margin-bottom: 10px;
}
#navigator-cluster-list {
  margin-top: 10px;
  margin-left: 10px;
  margin-right: 10px;
  margin-bottom: 10px;
  max-height: 230px;
  overflow-y: scroll;
  scrollbar-color: #fcfacd #fceb9e;
  scrollbar-width: thin;
}

#rule-variants {
  margin-top: 10px;
  margin-left: 10px;
  margin-right: 10px;
  margin-bottom: 5px;
}

#rule-variant-labels {
  text-align: left;
  display: flex;
  font-size: 14px;
  align-items: center;
}

#rule-selction-label,
#updating-label {
  width: 50%;
}

#rule-selection-menu .dropdown {
  width: 50%;
}

#rule-selection-menu {
  text-align: left;
  display: flex;
  font-size: 14px;
  align-items: center;
  margin-top: 2px;
}

#rule-selection-button,
#updating-button {
  width: 90%;
  text-align: left;
  font-family: "Dosis";
  font-weight: bold;
  background: #d5ddf3;
}

#rule-entry,
#rule-entry-1,
#rule-entry-2 {
  text-align: left;
  font-family: "Dosis";
  font-weight: bold;
  background: #fcfacd;
  border-style: solid;
  border-width: 2px;
  border-color: black;
  margin-top: 2px;
  margin-bottom: 2px;
}

#rule-entry-1,
#rule-entry-2 {
  width: 49.5%;
}
#rule-entry {
  width: 100%;
}

#rule-entry-1 {
  margin-right: 10px;
}

#additional-rules-container {
  display: flex;
  margin: 7px 10px 0 10px;
  justify-content: space-between;
}

#rules-container {
  margin-left: 10px;
  margin-right: 10px;
  display: flex;
  justify-content: space-between;
}
.reveal {
  margin-left: 10px;
  margin-right: 10px;
  display: flex;
  justify-content: space-between;
}

#tiling-input {
  display: flex;
  margin-top: 10px;
  font-size: 32px;
  font-weight: 400;
  align-items: center;
  justify-content: center;
}
#entry-p,
#entry-q {
  background-color: #fcfacd;
  border-style: solid;
  border-width: 2px;
  border-color: black;
  font-size: 18px;
  font-weight: bold;
  text-align: center;
  margin-left: 2.5px;
  margin-right: 2.5px;
  font-family: "Dosis";
}

#btn-set-grid,
#btn-set-rule {
  margin-top: 10px;
  border-radius: 50px;
  background-color: #d5ddf3;
  font-family: "Dosis";
  font-weight: bold;
  font-size: 12px;
  color: black;
  width: 30%;
  border-style: solid;
  border-width: 2px;
  border-color: black;
}

#right-sidebar {
  vertical-align: top;
  padding-right: 0.5in;
  padding-top: 0.25in;
  display: flex;
  flex-direction: column;
  height: 82vh;
}

#canvas {
  border-radius: 50%;
  width: clamp(240px, 32vw, 520px);
}

#canvas-container {
  text-align: center;
  padding: 1em;
  border: 0;
  margin: 1em;
  background-color: white;
  display: flex;
  width: clamp(240px, 32vw, 520px);
}

#files-table-container {
  max-height: 290px;
  overflow-y: scroll;
  scrollbar-color: #fcfacd #fceb9e;
  scrollbar-width: thin;
}

.replace-checkbox {
  width: 24px;
}

.hidden {
  display: none;
}

.cover {
  visibility: hidden;
}

hr {
  border-color: black;
  border-width: 1.4px;
}

table.files-table {
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  border-collapse: collapse;
  overflow: auto;
}

table.files-table th {
  text-align: left;
}
tr.files-file-row {
  border: solid 2px black;
}

tr.files-file-row:hover {
  background-color: #fcfacd;
}

tr.files-grid-row,
tr.files-func-row {
  border: solid 2px black;
}

tr.files-grid-row {
  background-color: #4364c7;
  color: white;
}
tr.files-grid-row td {
  padding: 0.1em 0 0.1em 0.5em;
}

tr.files-func-row {
  color: black;
  background-color: #d5ddf3;
}
tr.files-func-row td {
  padding: 0.1em 0 0.1em 1em;
}

/*Dialog: SVG export*/
#svg-image-container {
  text-align: center;
  overflow: auto;
}
#svg-image-container img {
  border: solid 1px silver;
  height: 65vh;
}

/* Tweak controls */
.numdisplay {
  min-width: 3em;
  display: inline-block;
  text-align: right;
  background-color: transparent;
  font-weight: 750;
  font-size: 14px;
  margin-top: 5px;
}

.control-group {
  padding: 0.5em 0;
  margin: 0;
  /*border-top: solid #ccc 1px;*/
}
.control-group:first-child {
  border-top: none;
}
div.control-table {
  display: table;
  margin-left: auto;
  margin-right: auto;
}
div.control-table > div {
  display: table-row;
}
div.control-table > div > div {
  display: table-cell;
  text-align: left;
}
button {
  margin: 0.2em 0;
  padding: 0;

  display: inline-block;
  border: none;
  color: #000000;
  border-radius: 0.2em;
  -webkit-border-radius: 0.2em;
  -moz-border-radius: 0.2em;
  width: auto;
  height: auto;
  font-size: 1em;
  padding: 0.5em;
  -text-shadow: 0 1px 0 #ffffff;
  background-color: #e0e0e0;
}

button.button-small {
  margin: 0;
  padding: 0;

  display: inline-block;
  border: none;
  color: #000000;
  border-radius: 0;
  width: auto;
  height: auto;
  font-size: 1em;
  padding: 0;
  -text-shadow: 0 1px 0 #ffffff;
  background-color: #e0e0e0;
}

button:disabled,
button[disabled]:hover {
  background-color: #f0f0f0;
  color: #c0c0c0;
}
button:hover {
  background-color: #c0e0e0;
}
button:active {
  background-color: #c0f0f0;
}

#btn-mode-edit.button-active,
#btn-mode-pan.button-active,
#btn-guide.button-active,
#btn-examples.button-active,
#btn-conway-examples.button-active,
#btn-immigration-examples.button-active,
#btn-rainbow-examples.button-active {
  color: #ffffff;
  background-color: #4364c7;
}

#btn-guide.button-active:hover,
#btn-examples.button-active:hover {
  box-shadow: 0 0 5px 2px #4364c7;
}

#btn-play-start.hover-svg:hover,
#btn-play-stop.hover-svg:hover {
  box-shadow: 0 0 5px 2px #4364c7;
}

button.dangerous:hover {
  background-color: #e0c0c0;
}
button.dangerous:active {
  background-color: #f0c0c0;
}

#state-selector {
  display: flex;
  flex-direction: column;
  width: 100%;
  justify-content: center;
  align-items: center;
  font-weight: bold;
}
#state-selector button {
  color: white;
}
#state-selector button.btn-selected {
  padding: 0.8em;
}

input {
  background-color: white;
  border: solid 1px #c0c0c0;
  padding: 0.3em 0.1em;
}

input.short {
  width: 2em;
}
input.medium {
  width: 4.5em;
}
input.wide {
  width: 100%;
}

#navigator table {
  border-collapse: collapse;
  margin: 0 auto;
  font-size: 14px;
  width: 100%;
}
/* Navigator styles */
#navigator tr:hover {
  background-color: #fcfacd;
}
#navigator td {
  text-align: center;
  border: solid 1px silver;
}

#navigator table a {
  display: block;
  text-decoration: none;
  color: black;
}

textarea.code-entry {
  height: 20em;
}

/*Validating inputs*/
input.input-ok {
  color: black;
}
input.input-editing {
  color: blue;
}
input.input-bad {
  color: red;
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/*Images*/

#disk-container {
  display: flex;
  flex-direction: column;
}

#greyscale {
  display: flex;
  justify-content: center;
  align-items: center;
}
#greyscale img {
  height: 8vh;
}

.flex-container {
  display: flex;
  align-items: center;
}
.flex-container img {
  height: 25vh;
}
#explanation-container {
  margin-left: 10px;
}
/*Media queries*/
@media screen and (min-width: 1150px) {
  #left-sidebar {
    width: clamp(12rem, 28vw, 20rem);
  }
  #canvas,
  #canvas-container {
    width: clamp(260px, 32vw, 520px);
  }
}

@media screen and (min-width: 1024px) and (max-width: 1149px) {
  #left-sidebar {
    width: clamp(12rem, 24vw, 20rem);
  }
  #canvas,
  #canvas-container {
    width: clamp(260px, 32vw, 520px);
  }
}
