/*** Injectable Estradiol Simulator Advanced by Blahaj Luna and Aly @ Transfeminine Science (transfemscience.org) ***/
/*** Copyright of Transfeminine Science and all rights reserved (please don't reproduce) ***/

/* Light mode */
:root {
  --background-color: rgb(255, 255, 255);
  --font-color: rgb(92, 89, 98);
  --heading-color: rgb(39, 38, 43);
  --link-color: rgb(129, 83, 237);
  --graph-html-legend-item-hover-background-color: rgb(245, 245, 245);
  --about-section-font-color: rgb(128, 128, 128);

  --selection-background-color: rgb(191, 168, 246);
  --selection-font-color: rgb(255, 255, 255);

  --input-font-color: rgb(39, 38, 43);
  --input-background-color: rgb(255, 255, 255);
  --input-border-color: rgb(133, 133, 133);
  --input-border-width: 1px;
  --input-outline-color: rgb(0, 0, 0);
  --button-background-color: rgb(239, 239, 239);
  --button-font-color: rgb(68, 68, 68);
  --button-border-color: rgb(133, 133, 133);
  --button-disabled-background-color: rgb(247, 247, 247);
  --button-disabled-font-color: rgb(200, 200, 200);
  --button-disabled-border-color: rgb(205, 205, 205);
  --large-button-font-color: rgb(0, 0, 0);
  --large-button-background-color: rgb(239, 239, 239);
  --large-button-border-color: rgb(20, 20, 20);
  --about-hide-button-background-color: rgb(240, 240, 240);
  --about-hide-button-border-color: rgb(192, 192, 192);

  --toggle-slider-background-color: rgb(204, 204, 204);
  --toggle-slider-before-background-color: rgb(255, 255, 255);
  --toggle-slider-active-background-color: rgb(163, 131, 239);
  --context-menu-item-background-color: rgb(255, 255, 255);
  --context-menu-item-background-color-hover: rgb(232, 232, 233);
  --context-menu-item-font-color: rgb(32, 33, 36);  
  --context-menu-border-color: rgb(227, 228, 231);
  --context-menu-dividing-lines-color: rgb(227, 228, 231);

  --tooltip-background-color: rgb(85, 85, 85);
  --tooltip-font-color: rgb(255, 255, 255);
  --tooltip-border-color: rgb(85, 85, 85) transparent transparent transparent;

  --scrollbar-thumb-color: rgb(191, 191, 191);
  --scrollbar-thumb-color-hover: rgb(163, 163, 163);

  --graph-font-color: rgb(39, 38, 43);
  --graph-axis-label-color: rgb(92, 89, 98);
  --graph-axis-tick-color: rgb(92, 89, 98);
  --graph-grid-line-color: rgb(235, 240, 248);
  --graph-background-color: rgb(255, 255, 255);
}

/* Dark mode */
@media only screen {
  [data-theme="dark"] {
    --background-color: rgb(36, 38, 44);
    --font-color: rgb(230, 225, 232);
    --heading-color: rgb(245, 246, 250);
    --link-color: rgb(189, 163, 255);
    --graph-html-legend-item-hover-background-color: rgb(28, 28, 28);
    --about-section-font-color: rgb(192, 192, 192);

    --selection-background-color: rgb(176, 133, 240);
    --selection-font-color: rgb(255, 255, 255);

    --input-font-color: rgb(230, 225, 232);
    --input-background-color: rgb(63, 62, 71);
    --input-border-color: rgb(50, 50, 50) rgb(80, 80, 80) rgb(80, 80, 80) rgb(50, 50, 50);    
    --input-border-width: 2px;
    --input-outline-color: rgb(255, 255, 255);
    --button-background-color: rgb(68, 68, 68);
    --button-font-color: rgb(239, 239, 239);
    --button-border-color: rgb(100, 100, 100) rgb(50, 50, 50) rgb(100, 100, 100) rgb(50, 50, 50);
    --button-disabled-background-color: rgb(50, 50, 50);
    --button-disabled-font-color: rgb(125, 125, 125);
    --button-disabled-border-color: rgb(75, 75, 75) rgb(75, 75, 75) rgb(75, 75, 75) rgb(75, 75, 75);
    --large-button-font-color: rgb(230, 225, 232);
    --large-button-background-color: rgb(30, 29, 34);
    --large-button-border-color: rgb(20, 20, 20);
    --about-hide-button-background-color: rgb(68, 68, 68);
    --about-hide-button-border-color: rgb(50, 50, 50);

    --toggle-slider-background-color: rgb(77, 76, 85);
    --toggle-slider-before-background-color: rgb(238, 238, 238);
    --toggle-slider-active-background-color: rgb(163, 131, 239);

    --tooltip-background-color: rgb(17, 17, 17);
    --tooltip-font-color: rgb(255, 255, 255);
    --tooltip-border-color: rgb(17, 17, 17) transparent transparent transparent;
    --context-menu-item-background-color: rgb(36, 38, 44);
    --context-menu-item-background-color-hover: rgb(63, 64, 66);
    --context-menu-item-font-color: rgb(232, 234, 237);
    --context-menu-border-color: rgb(60, 64, 67);
    --context-menu-dividing-lines-color: rgb(60, 64, 67);

    --scrollbar-thumb-color: rgb(67, 67, 78);
    --scrollbar-thumb-color-hover: rgb(30, 29, 33);

    --graph-font-color: rgb(230, 225, 232);
    --graph-axis-label-color: rgb(230, 225, 232);
    --graph-axis-tick-color: rgb(230, 225, 232);
    --graph-grid-line-color: rgb(77, 77, 77);
    --graph-background-color: rgb(36, 38, 44);
  }
}

html, body {
  box-sizing: border-box;
  overflow-x: hidden; /* For tooltip to prevent overflow resulting in page scroll */
  padding: 0px;
  margin: 0px;
  -ms-text-size-adjust: none; /* Disable font size scaling on mobile devices */
  -moz-text-size-adjust: none; /* Disable font size scaling on mobile devices */
  -webkit-text-size-adjust: none; /* Disable font size scaling on mobile devices */
  text-size-adjust: none; /* Disable font size scaling on mobile devices */
}

*, *:before, *:after {
  box-sizing: inherit;
}

html {
  width: 100%;
  height: 100%;
}

body {
  background-color: var(--background-color);
  color: var(--font-color);
  font-family: -apple-system,BlinkMacSystemFont,"helvetica neue",helvetica,roboto,noto,"segoe ui",arial,sans-serif;
  padding-top: 25px;
  padding-bottom: 25px;
  padding-left: 20px;
  padding-right: 20px;
}

@media only screen and (max-width: 500px) {
  body {
    padding-left: 15px;
    padding-right: 15px;
  }
}

/* Responsive sizing for narrow-width mobile */
@media only screen and (max-width: 380px) {
  body {
    padding-left: 10px;
    padding-right: 10px;
  }
}

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

div, span {
  border: 0px solid black; /* Debug */
}

#header-content {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: nowrap;
  margin-top: 0px;
  margin-bottom: 10px;
}

#icon {
  width: 45px; /* Old larger style: 33px */
  min-width: 45px; /* Old larger style: 33px */
  /*display: inline-block;*/ /* Uncomment this line to enable icon */
  display: none; /* Remove this line to enable icon */
  margin-right: 5px;
  margin-top: 5px;
  margin-bottom: 5px;
  background-image: url("android-chrome-512x512.png");
  background-repeat: no-repeat;
  background-position: left center;
  background-size: contain;
}

#title {
  text-align: center;
}

/* Responsive font size to avoid title wrapping on narrow-width mobile */
@media only screen and (max-width: 380px) {
  #title {
    font-size: 6.99vw; /* 6.99 to not wrap at 320px */
    /* white-space: nowrap; */ /* Actually this can result in overflow with font scaling so don't use */
  }
}

#body-content {
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
  display: flex;
  flex-wrap: wrap;
}

#col-graph {
  width: 60%;
}

@media only screen and (max-width: 900px) {
  #col-graph {
    order: 1;
  }
}

#col-graph, #graph-and-legend-container, #graph-html-legend {
  background-color: var(--background-color);
  color: var(--font-color);
}

#graph-html-legend {
  text-align: center;
  cursor: default;
  padding-top: 4px;
  padding-bottom: 8px;
  line-height: 1.35;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

#graph-html-legend-items {
  margin: 0 auto;
  width: 85%;
}

.graph-html-legend-item {
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
  padding-top: 4px;
  padding-bottom: 4px;
  padding-left: 3px;
  padding-right: 3px;
  border-radius: 3px;
  margin-right: 2px;
}

.graph-html-legend-item:hover {
  background-color: var(--graph-html-legend-item-hover-background-color);
}

.graph-html-legend-item-text {
  pointer-events: none;
}

.graph-html-legend-item-circle {
  height: 13px;
  width: 13px;
  background-color: gray;
  border-color: black;
  border-width: 2.5px;
  border-radius: 50%;
  margin-right: 3px;
  display: inline-block;
  vertical-align: middle;
  pointer-events: none;
}

.graph-html-legend-item-text-hidden {
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}

#footer-content {
  width: 100%;
  max-width: 1100px;
  margin: auto;
  text-align: center; 
  margin-top: 15px;
}

@media only screen and (max-width: 900px) {
  #footer-content {
    order: 2;
    margin-top: -5px;
  }
}

h1 {
  font-size: 35px;
  font-weight: 300;
  line-height: 1.25;
  margin-top: 0px;
  margin-bottom: 9px;
}

h2 {
  font-size: 24px;
  font-weight: 400;
  line-height: 1.25;
  margin-top: 8px;
  margin-bottom: 14px;
}

h1, h2 {
  color: var(--heading-color);
}

@media only screen and (max-width: 500px) {
  h1 {
    font-size: 27px;
  }

  h2 {
    font-size: 21px;
  }
}

a {
  color: var(--link-color);
}

select {
  padding: 1px;
}

select, input:not([type="button"]) {
  border-style: solid;
  font-size: 15px;
  border-radius: 3px;
}

select {
  padding: 1px;
}

input:not([type="button"]) {
  width: 42px;
  padding-top: 1px;
  padding-bottom: 1px;
  padding-left: 3px;
  padding-right: 3px;
}

select, input:not([type="button"]) {
  font-size: 15px;
  border-radius: 3px;
  color: var(--input-font-color);
  background-color: var(--input-background-color);
  border-style: solid;
  border-width: var(--input-border-width);
  border-color: var(--input-border-color);
}

select:active, input:active:not([type="button"]) {
  font-size: 15px;
}

/* Prevent automatic zooming on input elements on tap on iOS devices */
@supports (-webkit-touch-callout: none) {
  select, input, select:active, input:active {
    font-size: 16px;
  }
}

input:focus, select:focus, button:focus, textarea:focus {
  outline: 2px solid var(--input-outline-color);
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 30px;
  height: 17px;
  line-height: 1.0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--toggle-slider-background-color);
  border-radius: 17px;
  -webkit-transition: .2s;
  transition: .2s;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 13px;
  width: 13px;
  left: 2px;
  bottom: 2px;
  background-color: var(--toggle-slider-before-background-color);
  border-radius: 50%;
  -webkit-transition: .2s;
  transition: .2s;
}

input + .toggle-slider {
  -webkit-transition: none;
  transition: none;
}

input:checked + .toggle-slider {
  background-color: var(--toggle-slider-active-background-color);
}

input:focus + .toggle-slider {
  /* box-shadow: 0 0 1px var(--toggle-slider-active-background-color); */
  outline: 2px solid var(--input-outline-color);
}

input:checked + .toggle-slider:before {
  -webkit-transform: translateX(13px);
  -ms-transform: translateX(13px);
  transform: translateX(13px);
}

input[type="button"] {
  color: var(--large-button-font-color);
  background-color: var(--large-button-background-color);
  border-color: var(--large-button-border-color);
  border-width: 1px;
}

#concentration-units {
  min-width: 50px;
}

.option {
  line-height: 1.65;
  margin-bottom: 10px;
}

.col-divider {
  width: 5%;
}

@media only screen and (max-width: 900px) {
  .col-divider {
    display: none;
  }
}

#col-options-about {
  width: 35%;
}

@media only screen and (max-width: 900px) {
  #col-options-about {
    order: 3;
  }
}

@media only screen and (max-width: 900px) {
  #col-graph {
    margin-bottom: 15px;
  }

  #col-graph, #col-options-about {
    width: 100%;
  }
}

.heading-container {
  text-align: center;
}

#y-axis-max {
  width: 52px;
}

#cis-cycle-data-row {
  display: none;
}

#reset-button {
  width: 60px;
  height: 24px;
}

/* Hide certain elements */
#baseline-level-container,
#reset-button-container {
  display: none;
}

#about-section {
  margin-top: 25px;
}

#about {
  font-size: 10pt; /* ~13px (don't change to px—looks worse) */
  line-height: 1.35;
  color: var(--about-section-font-color);
  margin-top: 10px;
  margin-bottom: 10px;
}

#about-hidden {
  display: none;
}

#about-hide-button {
  color: var(--about-section-font-color);
  font-weight: bolder;
  background-color: var(--about-hide-button-background-color);
  border-style: solid;
  border-width: 1px;  
  border-color: var(--about-hide-button-border-color);
  border-radius: 10px;
  padding-left: 3px;
  padding-right: 3px;
  cursor: pointer;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

#share-container {
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: left;
}

#share-link {
  width: 100%;
  max-width: 228px;
  font-size: 12px;
  padding: 4px;
  margin-left: 4px;
}

#mode-simple-button, #mode-advanced-button {
  min-width: 75px;
  padding-top: 3px;
  padding-bottom: 3px;
  padding-left: 6px;
  padding-right: 6px;
  margin-right: 7px;
  border-style: solid;
  border-width: 1px;
  border-radius: 3px;
  cursor: pointer;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

#mode-simple-button:disabled, #mode-advanced-button:disabled {
  cursor: auto;
}

#share-button, #download-button {
  width: 26px;
  height: 24px;
  margin-left: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-style: solid;
  border-width: 1px;
  border-radius: 3px;
  cursor: pointer;
}

@media only screen and (max-width: 500px) {
  #share-link {
    max-width: 224px;
  }

  #share-button, #download-button {
    width: 30px;
    height: 28px;
  }
}

#mode-simple-button, #mode-advanced-button, #share-button, #download-button, #copy-icon, #download-icon, #reset-button {
  background-color: var(--button-background-color);
  color: var(--button-font-color);
  border-color: var(--button-border-color);
}

#mode-simple-button:disabled, #mode-advanced-button:disabled {
  background-color: var(--button-disabled-background-color);
  color: var(--button-disabled-font-color);
  border-color: var(--button-disabled-border-color);
}

@media only screen and (max-width: 500px) {
  #mode-simple-button, #mode-advanced-button, #share-button, #download-button, #copy-icon, #download-icon, #reset-button {
    font-size: 15px;
  }
}

/* For button hover tooltips */
.tooltip {
  position: relative;
  display: inline-block;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.tooltip .tooltiptext {
  visibility: hidden;
  width: 150px;
  white-space: nowrap;
  text-align: center;
  border-radius: 6px;
  padding: 5px;
  position: absolute;
  z-index: 1;
  bottom: 150%;
  left: 50%;
  margin-left: -75px;
  opacity: 0;
  transition: opacity 0.3s;
}

.tooltip .tooltiptext {
  background-color: var(--tooltip-background-color);
  color: var(--tooltip-font-color);
}

.tooltip .tooltiptext::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
}

.tooltip .tooltiptext::after {
  border-color: var(--tooltip-border-color);
}

.tooltip:hover .tooltiptext {
  visibility: visible;
  opacity: 1;
}

#rows-container {
  overflow-x: auto;
  padding-bottom: 10px;
}

#rows-table {
  margin-left: auto;
  margin-right: auto;
  text-align: left;
  border-spacing: 10px 2px;
  white-space: nowrap;
}

#default-row {
  display: none;
}

.circle {
  border-width: 2.5px;
  border-style: solid;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  -moz-border-radius: 50%;
  -webkit-border-radius: 50%;
}

.dose-interval-container, .dose-limit, .steady-state-container {
  opacity: 0.6;
}

.clone-row, .remove-row {
  width: 90px;
  height: 24px;
}

#add-row-container {
  margin-top: 5px;
  padding-bottom: 5px;
}

@media only screen and (max-width: 900px) {
  #add-row-container {
    margin-top: 15px;
    padding-bottom: 20px;
  }
}

#add-row {
  width: 140px;
  height: 24px;
}

/* Context menu */

#overlay {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: none;
}

@media only screen and (max-width: 500px) {
  #overlay.context-menu-visible {
    display: block;
  }
}

#context-menu {
  position: fixed;
  z-index: 99999;
  width: 150px;
  box-shadow: rgba(0, 0, 0, 0.20) 0px 1px 4px;
  /*border-radius: 1px;*/
  visibility: hidden;
  pointer-events: none;
  border-width: 1px;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

#context-menu {
  border-color: var(--context-menu-border-color);
}

.context-menu-visible {
  visibility: visible !important;
  pointer-events: auto;
}

#context-menu .context-menu-item {
  padding: 8px 10px;
  font-size: 13px;
  cursor: pointer;
  border-radius: inherit;
  pointer-events: auto;
  white-space: nowrap;
}

#context-menu .context-menu-item {
  background-color: var(--context-menu-item-background-color);
  color: var(--context-menu-item-font-color);
}

@media only screen and (min-width: 500px) {
  #context-menu .context-menu-item:hover {
    background-color: var(--context-menu-item-background-color-hover);
  }
}

/* For mobile */
@media only screen and (max-width: 500px) {
  #context-menu {
    top: 50%;
    left: 50%;
    width: 80%;
    transform: translate(-50%, -50%);
    border-radius: 5px;
  }

  #context-menu .context-menu-item {
    font-size: 18px;
    margin-bottom: 1px;
    border-radius: 0px;
    padding: 15px 15px;
  }

  #context-menu .context-menu-item:first-of-type {
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
  }

  #context-menu .context-menu-item:last-of-type {
    border-bottom-left-radius: 5px;
    border-bottom-right-radius: 5px;
  }

  html[data-iframe] #context-menu {
    top: 175px;
    transform: translate(-50%, 0%);
  }
}

/* Needed on mobile for context menu to work right */
@media only screen and (max-width: 500px) {
  body {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
  }
}

#context-menu {
  background-color: var(--context-menu-dividing-lines-color); /* For dividing lines between menu items */
}

/* Scrollbar */

::-webkit-scrollbar {
  background-color: var(--background-color);
  border: none;
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-thumb {
  background-color: var(--scrollbar-thumb-color);
  border: 1px solid var(--scrollbar-thumb-color);
}

::-webkit-scrollbar-thumb:hover {
  background-color: var(--scrollbar-thumb-color-hover);
  box-shadow: inset 0px 0px 3px 0px rgba(0, 0, 0, 0.2);
  border: none;
}

