
:root {
  --color-todo: rgb(255, 242, 242);

  --color-ident: rgb(243, 243, 243); /* same as vZome default background */
  --color-ident-selected: rgb(109, 112, 114); /* each RGB channel is 1/2 of unselected value */
  
  --color-text: rgb(127, 127, 127);
  --color-text-selected: rgb(240, 240, 240);
  --color-text-selected-dark: rgb(15, 15, 15);

  --color-blu-strut: rgb(0, 118, 149);
  --color-yel-strut: rgb(240, 160, 0);
  --color-red-strut: rgb(175, 0, 0);
  --color-grn-strut: rgb(0, 141, 54);

  --color-teal-dark: rgb(0, 157, 219);
  --color-teal-lite: rgb(182, 234, 255);
  --color-red-dark: rgb(207, 0, 0);
  --color-red-lite: rgb(253, 158, 158);

  --color-blu-panel: rgb(127, 186, 202);
  --color-yel-panel: rgb(247, 207, 127);
  --color-red-panel: rgb(215, 127, 127);
  --color-grn-panel: rgb(127, 198, 154);

  --checkbox-scale: 1.25;
}

html, body {
  height: 100%;
  width: 100%;
  margin: 0; /* This is essential to avoid a small white border around the whole main div. */
  user-select: none;
  font-family: 'Karla', Helvetica, sans-serif;
  color: #646464;
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(min-content, 1fr) minmax( 0, 1fr );
  grid-template-rows: min-content min-content minmax( 0, 1fr );
  grid-template-areas:
    "intro intro refs"
    "descrip viewer viewer" /*TODO:Add description for this molecule card */
    "table viewer viewer";
  gap: 7px;
  height: 100vh;
  max-width: 1600px;
  margin: auto;
}

.intro {
  margin-inline-start: 2rem;
  grid-area: intro;
  max-width: 800px;
}

.references {
  grid-area: refs;
  min-width: 320px;
  background-color: rgba(240, 240, 240, 0.85);
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
}

.viewer {
  position: relative;
  grid-area: viewer;
  width: 100%;
}

#viewer {
  width: 99%;
  height: 99%;
  /* aspect-ratio: minmax(0.33,3); */

}

.description-box {
  grid-area: descrip;
  margin-inline: 2rem;
  margin-top: 0.5rem;
}

#model-description {
  background-color: rgba(240, 240, 240, 0.85);
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.9rem;
  max-width: 800px;
  /* Since this is EXPERIEMNTAL, set to display:none for the main branch build until it works */
  display: none; 
}

#model-description summary {
  font-weight: bold;
  cursor: pointer;
}

#description-text {
  margin-top: 0.5rem;
  white-space: pre-line;
}

.table {
  grid-area: table; /* added for the grid above */
  overflow: auto;
  margin-block-end: 8px;
  margin-inline-start: 8px;

}

.label {
  cursor: default; /* disable the "I-beam" text cursor */
  position: absolute;
  z-index: 300;
  top: 0.3rem;
  left: 2rem;
  padding-right: 0.5em;
}



.label,
#zome-switch {
  background-color: rgba(243, 243, 243, 0.7);
  padding: 0.5rem 0.5rem;
  border-radius: 1rem;
}

#zome-switch {
  cursor: default; /* disable the "I-beam" text cursor */
  position: absolute;
  z-index: 300;
  top: 1.5rem;
  right: 1.5rem;
  font-size: 14px; /* Same as perspective switch, even though it's hidden */
}

input[type=checkbox]
{
  /* Resized Checkboxes */
  /* See other approaches at https://stackoverflow.com/questions/306924/can-i-change-the-checkbox-size-using-css */
  -ms-transform: scale(var(--checkbox-scale)); /* IE */
  -moz-transform: scale(var(--checkbox-scale)); /* FF */
  -webkit-transform: scale(var(--checkbox-scale)); /* Safari and Chrome */
  -o-transform: scale(var(--checkbox-scale)); /* Opera */
  transform: scale(var(--checkbox-scale));
  margin-left: 0.5em;
}

#showEdges {
  margin-left: 0.5rem;
  margin-right: 0.5rem;
}

#download {
  display: none;
}

#zome-switch.no-rgrp {
  display: none;
}

#zome-switch.rgrp {
  display: flex;
}



/*
  This CSS originally copied largely as-is from:

      https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Styling_tables
*/

/* spacing */

table {
  border-spacing: 0;
  cursor: default; /* disable the "I-beam" text cursor */
  table-layout: auto;
  width: 100%;
  font-size: smaller;
}

thead th:nth-child(1)   /* id column */
{
  text-align: center;
  /*width: 4ch;*/
}
tbody td:nth-child(1)   /* id column */
{
  text-align: right;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background-color: brown;
}


th,
td {
  border: 1px solid gray;
  padding: 3px;
  padding-right: 0.4em;
  white-space: nowrap;
  
}

th.ident, td.done {
  background-color: var(--color-ident);
  font-weight: bold;
}

th:not(.ident) {
  background-color: var(--color-todo);
}

tr.ident td.ident {
  background-color: var(--color-ident);
  font-size: large;
  /*width: 45ch; /* J77 and J78 have 45 characters in their names. No others are longer. */
}

td.todo {
  background-color: var(--color-todo);
  font-style: italic;
}

td.ident td.molec-mass {
  font-size: large;
}
td.category {
  font-size: smaller;
}

td {
  background-color: var(--color-yel-panel);
}
tr.selected > td {
  /* default color if no other molecule type is specified*/
  background-color: var(--color-yel-strut);

  font-style: italic;
  font-weight: bold;
}

tr.molec-mm > td:not(.ident){
  background-color: var(--color-blu-panel);
}
tr.molec-aa > td:not(.ident) {
  background-color: var(--color-teal-lite);
}
tr.molec-dn > td:not(.ident), tr.molec-rn > td:not(.ident) {
  background-color: var(--color-red-lite);
}

tr.selected.molec-mm > td {
  background-color: var(--color-blu-strut);
}
tr.selected.molec-aa > td {
  background-color: var(--color-teal-dark);
  font-style: italic;
  font-weight: bold;
}
tr.selected.molec-dn > td, tr.selected.molec-rn > td {
  background-color: var(--color-red-dark);
}


th
{
  background-color: whitesmoke;
}

/* selected table row */

tr.selected,
tr.selected td {
  border: 1px solid black;
  color: var(--color-text-selected);
  font-weight: bold;
}

tr.selected td.done {
  background-color: var(--color-ident-selected)
}

/* typography */

html {
  font-family: "helvetica neue", helvetica, arial, sans-serif;
}

th {
  letter-spacing: 2px;
}

td {
  letter-spacing: 1px;
}

thead, tbody {
  text-align: left;
}

tfoot th {
  text-align: right;
}

/* graphics and colors */

thead,
tfoot {
  /* position:fixed; */
  background: whitesmoke;
}

thead th,
tfoot th,
tfoot td {
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.1),
    rgba(0, 0, 0, 0.2)
  );
}

@media ( max-aspect-ratio: 10/10 ) {

  .main-grid {
    display: grid;
    grid-template-columns: 1fr;
    /* grid-template-rows: min-content minmax( 0, 5fr ) minmax( 0, 3fr ); */
    grid-template-rows: min-content min-content min-content minmax( 0, 3fr ) 2.5fr;
    grid-template-areas:
      "intro"
      "viewer"
      "descrip"
      "table"
      "refs";
    height: 120vh;
    margin: auto;
  }

  
  .viewer {
    height: 70dvw;
    max-height: 60dvh;
    min-height: 240px;
    text-align: center;
  }
  .label{
    font-size: 5dvw;
  }

  .intro h1 {
    display: block;
    font-size: 1.5em;
    margin-block-start: 0.37em;
    margin-block-end: 0.2em;
    font-weight: bold;
}
  .intro {
    grid-area: intro;
  }
  
  /* .intro-text,
  .references {
    display: none;
  } */
  
}