/* 
 * MARK: Themes
 */
/* #region Themes */
[data-theme="light"] {
  /* ------ Text and header ------ */
  --text-color: #000000;
  --header-color: #333333;

  /* ------ Links ------ */
  --link-default: #0066cc;
  --link-visited: #551a8b; 

  /* ------ Main styles ------ */
  --bg-color1: #ffffff;
  --bg-color2: #f2f2f2;
  --bg-color3: #f9f9f9;
  --border-color: #b8b8b8;
  --bg-hover: #dcdcdc;
  --footer-icon-hover: #dcdcdc;
  --header-btn-hover: #5c5c5c; 
  
  /* ------ Sequence viewer ------ */
  --axis: #a3a3b6;
  --base-hover: #dcdcdc;
  --base-selected: #51aff3; 
  --base-search: #bef724;
  --base-search-highlight: #df63dd;
  --base-sub: #f672f6;
  --base-sub-border: #7c137c;
  --selection-cursor: #6a0dad;

  /* ------ Misc ------ */
  --shadow-color: #00000026;
  --invert-filter: invert(0%);
}

[data-theme="dark"] {
  /* ------ Text and header ------ */
  --text-color: #e0e0e0;
  --header-color: #181818;
  
  /* ------ Links ------ */
  --link-default: #80b3ff; /* Light blue */
  --link-visited: #c080ff; /* Soft purple */

  /* ------ Main styles ------ */
  --bg-color1: #121212;
  --bg-color2: #1e1e1e;
  --bg-color3: #252525;
  --border-color: #505050;
  --bg-hover: #2c2c2c;
  --footer-icon-hover: #ffcc80; /* Soft amber */
  --header-btn-hover: #3a3a3a;
  
  /* ------ Sequence viewer ------ */
  --axis: #8a7b7b;
  --base-hover: #484848;
  --base-selected: #3d97fd;
  --base-search: #ff7043;
  --base-search-highlight: #ff4081;
  --base-sub: #de4d96;
  --base-sub-border: #ffc6e8;
  --selection-cursor: #fffc4e;

  /* ------ Misc ------ */
  --shadow-color: #00000066;
  --invert-filter: invert(85%);
}
/* #endregion Themes */


:root {
  --header-height: 55px;
  --footer-height: 45px;

  --sidebar-width: 350px;
  --toolbar-width: 45px;
}

/* 
 * MARK: Body
 */
html, body {
  --hr: #d9823a;
  --ins: #c83478;
  --tbr: #448f47;
  --subhr: #8ccaf2;
  --subtbr: #6b609d;

  --btn-red: #FF5E5E;
  --btn-green: #4CAF50;
  --btn-blue: #214d7c;
  --btn-orange: #FF8000;
  --btn-gray: #808980;

  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 0;
  overflow: hidden;

  font-family: Arial, sans-serif;
  font-size: 12px;
  color: var(--text-color);
  background-color: var(--bg-color1);

}


/* 
 * MARK: Custom elemenets
 */
/* #region Custom_elements */
/* 
 * MARK: Links
 */
a {
  color: var(--link-default);
}

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

.underlined-link {
  font-weight: bold;
  color: var(--text-color);

  text-decoration: none;

  position: relative;

  padding-right: 17px;
  margin: 5px 0px;
}

.underlined-link::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: -5px; /* Controls underline position */
  width: 100%;
  height: 3px; /* Thickness of underline */
  background-color: var(--btn-green);

  transition: filter 0.1s ease-in
}

.underlined-link:hover::before {
  filter: brightness(1.5);
}

.underlined-link-orange::before {
  background-color: var(--btn-orange);
}

.underlined-link::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  width: 14px;
  height: 14px;
  background-image: url("data:image/svg+xml,%3Csvg width='800px' height='800px' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='Interface / External_Link'%3E%3Cpath id='Vector' d='M10 5H8.2C7.08 5 6.52 5 6.09 5.22C5.72 5.41 5.41 5.72 5.22 6.09C5 6.52 5 7.08 5 8.2V15.8C5 16.92 5 17.48 5.22 17.91C5.41 18.28 5.72 18.59 6.09 18.78C6.52 19 7.08 19 8.2 19H15.8C16.92 19 17.48 19 17.91 18.78C18.28 18.59 18.59 18.28 18.78 17.91C19 17.48 19 16.92 19 15.8V14M20 9V4M20 4H15M20 4L13 11' stroke='%23000000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/g%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  transform: translateY(-50%);
  filter: var(--invert-filter);
}

input {
  padding: 5px;

  color: var(--text-color);
  background-color: var(--bg-color1);
  border: none;
  border-radius: 5px;
}

/* 
 * MARK: Checkboxes
 */
input[incorrect="true"] {
  outline: 2px solid var(--btn-red) !important;
}

textarea[incorrect="true"] {
  outline: 2px solid var(--btn-red) !important;
}

.custom-checkbox {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  font-size: 14px;
  position: relative;
}
.custom-checkbox::before {
  content: "";
  width: 15px;
  height: 15px;
  border: 2px solid #666;
  background-color: var(--bg-color1);
  display: inline-block;
  margin-right: 8px;
  border-radius: 4px;
  transition: background 0.3s ease;
  text-align: center;
  line-height: 15px;
}
input[type="checkbox"]:checked + .custom-checkbox::before {
  background-color: #4CAF50; /* Green background */
  border-color: #4CAF50;
}
input[type="checkbox"]:checked + .custom-checkbox::before {
  content: "✔";
  color: white;
  font-size: 12px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
}


/* 
 * MARK: Buttons
 */
.button-round {
  display: flex;
  align-items: center;
  justify-content: center;

  cursor: pointer;
  border-radius: 5px;
  padding: 10px 20px;
  text-align: center;
  text-decoration: none;
  color: white;
  transition: filter 0.25s;
  font-weight: bold;
  -webkit-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
.button-round:hover {
  filter: brightness(1.2);
}
.button-round[disabled] {
  pointer-events: none;
  filter: grayscale(100%) brightness(0.8);
}

.button-red { background-color: var(--btn-red) }
.button-green { background-color: var(--btn-green) }
.button-blue { background-color: var(--btn-blue) }
.button-blue { background-color: var(--btn-blue) }
.button-orange { background-color: var(--btn-orange) }
.button-gray { background-color: var(--btn-gray) }
/* #endregion Custom_elements */


/* 
 * MARK: Layout
 */
/* #region Layout */
.content-wrapper {
  width: 100vw;
  height: 100vh;

  display: grid;
  grid-template-columns:[sidebar] var(--sidebar-width) [viewer] minmax(0, auto) [toolbar] var(--toolbar-width);
  grid-template-rows: [header] var(--header-height) [viewer] minmax(0, auto) [footer] var(--footer-height);
  
  grid-template-areas:
        "header header header"
        "sidebar viewer toolbar"
        "sidebar footer footer";
}
.header {
  grid-area: header;
}
.sidebar {
  grid-area: sidebar;
}
.viewer {
  max-width: calc(100vw - var(--sidebar-width) - var(--toolbar-width));
  grid-area: viewer;
  position: relative;
}
.toolbar {
  grid-area: toolbar;
}
.footer {
  grid-area: footer;
}
/* #endregion Layout */


/* 
 * MARK: HEADER
 */
/* #region Header */
.header {
  display: flex;
  flex-direction: row;
  gap: 20px;

  padding: 0 10px;

  background-color: var(--header-color);
  border-bottom: 2px solid var(--border-color);
}

/* Import buttons */
.header-import-buttons {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
}
/* #endregion Header */


/* 
 * MARK: Plasmid tabs
 */
/* #region Plasmid_tabs */
.plasmid-tabs-wrapper {
  flex-grow: 1;

  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 10px;
  
  position: relative;

  width: 500px;
}

.plasmid-tabs-scroll-button {
  display: flex;
  flex-direction: row;
  align-items: center;

  margin: 5px 0px;

  color: white;
  background-color: transparent;
  font-size: 22px;
}
.plasmid-tabs-scroll-button:hover {
  background-color: var(--header-btn-hover);
}
.plasmid-tabs-scroll-button[disabled] {
  cursor: auto;
  opacity: 15%;

  -webkit-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
.plasmid-tabs-scroll-button[disabled]:hover {
  background-color: transparent;
}


.plasmid-tabs-container-wrapper {
  flex-grow: 1;

  display: flex;
  align-items: stretch;
  justify-content: flex-start;

  margin-top: 10px;

  max-width: 100%;
  overflow-y: hidden;
  overflow-x: auto;
  scroll-behavior: smooth;

  scrollbar-width: thin;
  scrollbar-color: #FFFFFF1F transparent;
}

.plasmid-tabs-container {
  display: flex;
  align-items: stretch;
  gap: 10px;

  height: 35px;
}

.plasmid-tab {
  display: flex;
  align-items: stretch;
  justify-content: center;

  border-radius: 5px;
  text-align: center;
  background-color: rgba(0, 0, 0, 0);
  white-space:nowrap;
  transition: background-color 0.25s;
}
.plasmid-tab:hover {
  background-color: var(--header-btn-hover);
}
.plasmid-tab-selected {
  font-weight: bold;
  background-color: var(--btn-green);

  transition: filter 0.25s;
}
.plasmid-tab-selected:hover {
  background-color: var(--btn-green);
  filter: brightness(1.2);
}

.plasmid-tab-button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  
  padding: 0 10px 0 20px;

  color: white;
  cursor: pointer;
}

.plasmid-tab-dropdown-button {
  display: flex;
  align-items: center;

  padding: 0 10px 0 10px;
  
  color: white;
  cursor: pointer;
	border-radius: 0 5px 5px 0px;
  transition: background-color 0.25s, filter 0.25s;
}
.plasmid-tab-dropdown-button:hover {
	background-color: var(--btn-green);
  filter: brightness(1.2);
}

.plasmid-tab-dropdown-menu {
  position: fixed;

  max-width: 400px;
  margin: 0;
  padding: 5px;

  background-color: var(--bg-color1);
  border: 2px solid var(--border-color);
  box-shadow: 0 4px 8px var(--shadow-color);
}

.plasmid-tab-dropdown-menu-section-title {

  margin: 0;
  padding: 5px;

  background-color: var(--header-color);
  color: #fff;
  font-weight: bold;
  font-size: 14px;
}

html[data-theme="dark"] .plasmid-tab-dropdown-menu-section-title {
  background-color: var(--border-color);
}

.plasmid-tab-dropdown-menu ul {
  padding: 0;
  margin: 0;
  list-style: none;
}

.plasmid-tab-dropdown-menu ul span {
  color: var(--text-color);
  padding: 8px 10px;
  cursor: pointer;
  display: block;
}

.plasmid-tab-dropdown-menu ul span:hover {
  background-color: var(--bg-hover);
}
/* #endregion Plasmid_tabs */


/* 
 * MARK: Sidebar 
 */
/* #region Sidebar */
.sidebar {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: flex-start;

  max-height: 100%;
  overflow: hidden;

  background-color: var(--bg-color2);
}

.sidebar-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;

  max-height: 100%;
  overflow: hidden;
}

.sidebar-resizer {
  position: relative;
  width: 5px;

  background-color: var(--bg-color2);
  border-left: 2px solid var(--border-color);
  border-right: 2px solid var(--border-color);
  
  cursor: ew-resize;
}

.sidebar-resizer::after {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;

  position: absolute;
  top: 0;
  width: 100%;
  height: 100%;

  content: "|";
  color: var(--border-color);
  font-size: 18px;
  font-weight: bold;
}
.sidebar-resizer:hover::after {
  filter: brightness(0.8);
}

.features-table-container {
  flex: 1;
  overflow-y: auto;
}

.features-table {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 5px;

  padding: 3px;
}
/* #endregion Sidebar */

/* 
 * MARK: Primers table
 */
/* #region Primers_table */
#primers-table-container {
  max-height: 50%;
  overflow-x: hidden;
  overflow-y: auto;
}
#primers-table-container:has(div.primers-set) {
  border-bottom: 2px var(--border-color) solid;
}

.primers-table
.primers-set
.primers-set-body
.primers-container
.primer-container {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
}

.primers-table {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.primers-table:has(div) {
  padding: 10px;
}

.primers-set {
  gap: 15px;
}

.primers-set-header {
  display: flex;
  align-items: stretch;
  justify-content: space-between;

  height: 30px;
  margin-bottom: 5px;

  border-bottom: 2px solid var(--border-color);
}

.primers-set-header-title {
  display: flex; 
  align-items: center;
  justify-content: center;

  font-size: 16px;
  font-weight: bold;
}

.primers-set-header-rename-button {

  font-size: 16px;
  font-weight: bold;
}

.primers-set-header-rename-button span {
  background-image: url('/static/assets/icons/pencil.svg');
}


.primers-set-body {
  gap: 10px;
}

.primers-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.primer-container {
  gap: 5px;
}
.primer-container > *:not(:first-child) {
  margin-left: 10px;
}

.primer-header {
  display: flex;
  align-content: stretch;
  justify-content: space-between;
}

.primer-title {
  font-size: 14px;
  font-weight: bold;
}

.primer-header-buttons-container {
  display: flex;
}

.primer-sequence-regions {
  word-break: break-all;
  line-height: 2;
}

.primer-sequence {
  padding: 2px 3px;

  color: white;
  font-weight: bold;
  letter-spacing: 0.1rem;
  align-items: center;
}
.primer-sequence-hr { background-color: var(--hr) }
.primer-sequence-ins { background-color: var(--ins) }
.primer-sequence-tbr { background-color: var(--tbr) }
.primer-sequence-subhr { background-color: var(--subhr) }
.primer-sequence-subtbr { background-color: var(--subtbr) }

.primer-header-button {
  display: inline-flex !important;

  height: 20px;
  width: 20px !important;
  padding: 2px !important;
  margin-right: 5px;
  vertical-align: middle;
}

.primer-copy-button span {
  background-image: url('/static/assets/icons/copy.svg');
}

.primer-highlight-button[active] {
  background-color: var(--footer-icon-hover);
}

.primer-highlight-button span {
  background-image: url('/static/assets/icons/highlight.svg');
}

.primer-increment-buttons-wrapper {
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
  align-content: stretch;
  justify-content: flex-start;
  gap: 5px;
}

.primer-increment-buttons-container {
  display: flex;
  align-content: stretch;
  justify-content: flex-start;
  gap: 2px;

  width: fit-content;
}

.primer-increment-buttons-divider {
  width: 2px;
  background-color: var(--border-color);
}

.primer-increment-buttons-label {
  align-content: center;

  width: fit-content;
}

.primer-increment-label {
  align-content: center;

  font-weight: bold;
}

.primer-increment-button {
  display: inline-flex !important;

  height: 20px;
  width: 20px !important;
  padding: 4px !important;
  vertical-align: middle;
}

.primer-increment-plus span {
  background-image: url('/static/assets/icons/plus.svg');
}

.primer-increment-minus span {
  background-image: url('/static/assets/icons/minus.svg');
}


.primer-info {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.primer-info span {
  font-weight: bold;
}
/* #endregion Primers_table */


/* 
 * MARK: Features table
 */
/* #region Features_table */
.collapsible-header {
  width: 100%;
  padding: 8px;

  cursor: pointer;
  border: none;
  text-align: left;
  outline: none;
  font-size: 14px;
}
.collapsible-header:hover {
  filter: brightness(1.1);
  outline: 2px solid red;
}
.collapsible-header:after {
  float: left;

  margin-right: 12px;

  content: '\002B';
  color: black;
  font-size: 14px;
  font-weight: bold;
}
.collapsible-header-active:after {
  content: "\2212";
}

.collapsible-content {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 5px;

  overflow: hidden;
  
  transition: max-height 0.3s ease-out, padding 0.3s ease-out;
}
.collapsible-content:not([visible]) {
  max-height: 0px;
  padding: 0 10px;
}
.collapsible-content[visible] {
  max-height: 400px;
  padding: 10px 10px;
}

.collapsible-content-hgroup {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 10px;

  height: 100%;
}

.collapsible-content-hgroup {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 10px;
}

.collapsible-content-hgroup-label {
  display: flex;
  align-items: center;

  height: 26px;
  min-width: 25%;

  font-weight: bold;
}

.collapsible-content-hgroup-input {
  flex-grow: 1;
  display: flex;
  justify-content: space-between;
}

.collapsible-content-hgroup-input:has(input[type=checkbox]) {
  display: flex;
  align-items: center;

  height: 26px;
}

.collapsible-content-hgroup-input span {
  margin: 5px;
}

.collapsible-content-hgroup-input input,
.collapsible-content-hgroup-input select,
.collapsible-content-hgroup-input textarea {
  width: 100%;
  padding: 5px;

  background-color: var(--bg-color1);
  border: none;
  color: var(--text-color);
  border-radius: 4px;
}

input, select, textarea {
  box-sizing: border-box;
  -moz-box-sizing: border-box;
  -webkit-box-sizing: border-box;
}

.collapsible-content-hgroup-input select:hover {
  cursor: pointer;
}

.collapsible-content-hgroup-input input[type=checkbox] {
  width: 18px;
  height: 18px;
}

.collapsible-content-hgroup-input textarea {
  min-height: 70px;
  max-height: 200px;
  resize: vertical;
}

.clr-field {
  width: 37px;
}
.clr-field button {
  width: 100%;
}
/* #endregion Features_table */


/* 
 * MARK: Toolbar
 */
/* #region Toolbar */
.toolbar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;

  padding: 10px 5px;
  
  background-color: var(--bg-color2);
  border-left: 2px var(--border-color) solid;
}
.toolbar div:last-child {
  margin-top: auto;
}

.toolbar-divider {
  display: block;

  width: 100%;
  height: 2px;

  background-color: var(--border-color);
}

.toolbar-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;

  width: 100%;
}

.toolbar-button {
  display: flex;
  border-radius: 5px;

  width: 100%;
  aspect-ratio: 1 / 1;
  padding: 5px;
  box-sizing: border-box;

  background-size: contain;
  background-repeat: no-repeat;
  background-position: center center;

  filter: var(--invert-filter);
  cursor: pointer;
}
.toolbar-button:hover {
  background-color: var(--footer-icon-hover);
}
.toolbar-button[selected] {
  background-color: var(--footer-icon-hover);
}
.toolbar-button[selected]:hover {
  cursor: auto;
}
.toolbar-button[disabled] {
  opacity: 15%;
  pointer-events: none;
  cursor: auto;
}

.toolbar-button span {
  width: 100%;
  height: 100%;

  background-size: contain;
  background-repeat: no-repeat;
  background-position: center center;

  cursor: pointer;
}


.toolbar-panel {
  position: absolute !important;
  z-index: 9999;

  transform: translate(-100%, 0) !important;
  transform-origin: bottom right;

  justify-content: flex-end !important;
}

.toolbar-panel-body,
.toolbar-panel-collapsible-content {
  display: flex;
  flex-direction: column;
  align-items: stretch;

  overflow-y: auto;
  overflow-x: hidden;
}

.toolbar-panel-collapsible {
  width: 100%;

  display: flex;
  flex-direction: column;
  align-items: stretch;
}


.toolbar-panel:not([visible]) {
  visibility: hidden;
}

.toolbar-panel[visible] {
  visibility: visible;
}

.toolbar-panel-title {
  padding: 10px 15px;
}

.toolbar-panel-section {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 5px;

  width: 97%;
}


.toolbar-panel-section-title {
  font-weight: bold;
  font-size:  14px;
}

.toolbar-panel-section-hgroup {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;

  width: 100%;
  box-sizing: border-box;
}

.toolbar-panel-section-hgroup span {
  flex-grow: 1;
}

.toolbar-panel-section-hgroup label {
  display: flex;
  align-items: center;

  height: 26px;
  min-width: 50%;
  
  font-weight: bold;
}

.toolbar-panel-section-hgroup-input {
  flex-grow: 1;
  display: flex;
  align-items: center;
  gap: 10px;

  -webkit-user-select: none; /* Safari */
  -ms-user-select: none; /* IE 10 and IE 11 */
  user-select: none; /* Standard syntax */
}

.toolbar-panel-section-hgroup-input span {
  vertical-align: middle;
}

.toolbar-panel-section-hgroup-input input {
  flex-grow: 1;

  width: 100%;
  padding: 5px 10px;

  background-color: var(--bg-color1);
  border: none;
  color: var(--text-color);
  border-radius: 4px;
}

.toolbar-panel-section-hgroup-input input[type="checkbox"] {
  height: 18px;
  width: 18px;

  align-self: flex-start;
  flex-grow: unset;
}

.input-suffix {
  position: relative;
}

.input-suffix input {
  padding-right: 35px;
}

.input-suffix::after {
  display: flex;
  align-items: center;
  justify-content: center;

  position: absolute;
  top: 2px;
  right: 10px;
  width: 10%;
  height: 100%;

  content: "";
  font-size: 14px;
  color: var(--text-color);
  opacity: 0.5;
  line-height: 1;
}

.suffix-nM::after { content: "nM" }
.suffix-M::after { content: "M" }
.suffix-nt::after { content: "nt" }
.suffix-C::after { content: "°C" }


.toolbar-panel-section-hgroup-input select {
  flex-grow: 1;

  width: 100%;
  padding: 5px 10px;

  color: var(--text-color);
  background-color: var(--bg-color1);
  border: none;
  border-radius: 4px;
}

.toolbar-panel-collapsible-header {
  background: transparent;
  padding: 10px 15px;

  font-weight: bold;
  font-size: 18px;

  cursor: pointer;

  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.3s ease;
}

.toolbar-panel-collapsible-header:hover {
  background: var(--bg-hover);
}

.toolbar-panel-collapsible-header::after {
  content: "+";
  font-size: 18px;
  transition: transform 0.3s ease;
}

.toolbar-panel-collapsible-header:not([collapsed])::after {
  content: "−";
}

.toolbar-panel-collapsible-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease-out, opacity 0.4s ease;
  opacity: 0;
  padding: 0 0;

  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Show content when active */
.toolbar-panel-collapsible-content:not([collapsed]) {
  max-height: 1000px; /* Large value to ensure smooth transition */
  opacity: 1;
  padding: 10px 0;
}

.toolbar-panel-image-container {
  display: flex;
  justify-content: center;

  margin-top: 10px;
  margin-bottom: 20px;
  max-width: 100%;
  box-sizing: border-box;

  filter: var(--invert-filter);
}

.toolbar-panel-image-container img {
  max-width: 100%;
}


.toolbar-panel-tm {
  min-width: 35vw !important;
}


.toolbar-panel-tm-vgroup label{
  font-weight: bold;
  font-size: 14px !important;
}


.tm-overlap-svg-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;

  margin-bottom: 10px;
}

.toolbar-panel-tm-overlap-svg {
  width: 80%;
  display: block;
  height: auto;
}

.toolbar-panel-tm-overlap-text {
  font-size: 14px;
  fill: var(--text-color);

  pointer-events: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.toolbar-panel-settings {
  min-width: 400px !important;
  max-width: 80vh !important;
  max-height: 80vh !important;
  overflow-y: auto;
  overflow-x: hidden;

  display: flex !important;
  flex-direction: column-reverse !important;
  justify-content: flex-end !important;
}

.boolean-switch-wrapper {
  display: block;
  width: 25%;
  height: 100%;
}

.boolean-switch {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
}

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

.boolean-switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  opacity: 70%;
  border-radius: 50em;
}

html[data-theme="light"] .boolean-switch-slider {
  background-color: var(--border-color);
}

html[data-theme="dark"] .boolean-switch-slider {
  background-color: var(--bg-color1);
}

.boolean-switch-slider:before {
  position: absolute;
  content: "";
  --knob-radius: 17px;
  height: var(--knob-radius);
  width: var(--knob-radius);
  top: 50%;
  left: 5px;
  background-color: var(--bg-color1);

  border-radius: 50%;
  transform: translateY(-50%);
}

html[data-theme="dark"] .boolean-switch-slider:before {
  background-color: white;
}

.boolean-switch-input:checked + .boolean-switch-slider:before {
  left: auto;
  right: 5px;
}

/* Toolbar icon svgs */
.toolbar-plasmid-circular-button {
  background-image: url('/static/assets/icons/plasmid_circular.svg');
}

.toolbar-plasmid-linear-button {
  background-image: url('/static/assets/icons/plasmid_linear.svg');
}

.toolbar-plasmid-grid-button {
  background-image: url('/static/assets/icons/plasmid_grid.svg');
}

.toolbar-calculator-button {
  background-image: url('/static/assets/icons/thermometer.svg');
}

.toolbar-undo-button {
  background-image: url('/static/assets/icons/undo.svg');
}

.toolbar-redo-button {
  background-image: url('/static/assets/icons/undo.svg');
  transform: scale(-1,1);
}

.toolbar-settings-button {
  background-image: url('/static/assets/icons/settings.svg');
}

.toolbar-help-button {
  background-image: url('/static/assets/icons/help-circle.svg');
}
/* #endregion Toolbar */


/* 
 * MARK: Footer
 */
/* #region Footer */
.footer {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  
  height: 45px;
  padding: 5px 10px;
  box-sizing: border-box;
  
  font-size: 14px;
  background-color: var(--bg-color2);
  border-top: 2px var(--border-color) solid;
}

.footer-search {
  flex-grow: 1;

  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: flex-start;
  gap: 10px;

  height: 100%;
}

.footer-search-controls {
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0px;

  height: 100%;
}

.footer-button {
  height: 100%;
  aspect-ratio: 1 / 1;
  width: unset !important;
}
.footer-reset-search-button {
  background-image: url('/static/assets/icons/x.svg');
}
.footer-search-up-button {
  background-image: url('/static/assets/icons/chevron-up.svg');
}
.footer-search-down-button {
  background-image: url('/static/assets/icons/chevron-down.svg');
}

.footer-search-info {
  display: flex;
  flex-direction: row;
  align-items: center;
  font-size: 14px;
}

.footer-search-options-container {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 5px;
}

.footer-search-options-container input[type="checkbox"] {
  height: 18px;
  width: 18px;
}

.footer-search-option {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 5px;
}

.footer-selection-info {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;

  margin-left: auto;

  font-size: 14px;
}

.footer-selection-info div p {
  margin: 0;
}
/* #endregion Footer */


/* 
 * MARK: Modals
 */
/* #region Modal_windows */
.modal {
  display: none;

  position: fixed;
  z-index: 1;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  
  background-color: rgb(0,0,0); /* Fallback color */
  background-color: rgba(0,0,0,0.4);
}

.modal-window {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);

  min-width: 10vw;
  max-width: 90vw;
  padding: 15px;
  
  background-color: var(--bg-color2);
  border: 2px solid var(--border-color);
  box-shadow: 0px 0px 5px var(--shadow-color);
}

.modal-body {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 10px;
}

.modal-wide {
  min-width: 20vw;
}

.modal-very-wide{
  min-width: 50vw;
}

.modal-title {
  color: var(--text-color);
  font-size: 18px;
  font-weight: bold;
}

.modal-vgroup {
  display: flex;
  flex-direction: column;
  gap: 5px;

  margin: 0 0 10px;
}

.modal-vgroup label {
  font-size: 14px;
}

.modal-hgroup {
  margin: 0 0 10px;
  display: flex;
  align-items: stretch;
  flex-direction: row;
  gap: 10px;
}

.modal-hgroup label {
  font-size: 14px;
}

.modal-subcloning-subtitle {
  font-weight: bold;
  font-size: 16px;
}

.modal-insertion {
  min-width: 50vw;
}

.modal-new-file {
  min-width: 50vw;
  min-height: 50vh;
}

.modal-new-file-sequence-input {
  flex-grow: 1;
}
.modal-new-file-sequence-input textarea {
  resize: none;
  flex-grow: 1;
}

.lin-frag-sequence-input textarea {
  resize: vertical;
  max-height: 15vh;
}

.lin-frag-hint[visible] {
  visibility: visible;
}
.lin-frag-hint:not([visible]) {
  visibility: collapse;
}

.lin-frag-hint-span {
  color: var(--btn-red);
  font-weight: bold;
  line-height: 1.5;
}

.modal-input-wrapper {
  display: flex;
  align-items: center;

  background-color: var(--bg-color1);
  border: 1px solid var(--border-color);
  border-radius: 5px;
}

.modal-input {
  position: relative;
  margin: 0 2px;
  padding: 10px 20px 10px 20px;

  color: var(--text-color);
  font-size: 14px;
  background-color: var(--bg-color1);
  border: 1px solid var(--border-color);
  border-radius: 5px;
}

.modal-input-with-suffix {
  flex-grow: 1;

  position: relative;
  margin: 0;
  padding: 10px 20px 10px 20px;

  color: var(--text-color);
  font-size: 14px;
  background-color: transparent;
}

.modal-input-suffix {
  position: relative;
  padding: 10px;

  color: var(--border-color);
  font-size: 14px;
}

.modal-input-sync {
  height: 100%;
}

.modal-input-sync[active] {
  background-color: var(--footer-icon-hover);
}

.modal-input-sync[active] span  {
  filter: none;
  opacity: 1;
}

.modal-input-sync:not([active]) span {
  filter: grayscale(1);
  opacity: 0.5;
}

.modal-input-sync-icon {
  background-image: url('/static/assets/icons/chain.svg');
  background-size: contain;
  background-repeat: no-repeat;
  display: inline-block;
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.common-insertions-dropdown {
  flex-grow: 1;
}

.common-insertions-group {
  font-style: normal;
  font-weight: bold;
  background-color: transparent;
}

.common-insertions-option {
  display: flex;
  align-items: stretch;
  justify-items: flex-start;
}

.common-insertions-item-long {
  color: var(--btn-red);
}


.modal-batch-mutagenesis {
  min-width: 50vw;
  min-height: 50vh;
}

/* #endregion Modal_windows  */


/* 
 * MARK: Welcome disclaimer
 */
/* #region Welcome_disclaimer */
.welcome-disclaimer {
  display: flex;
  align-items: center;
  justify-content: center;
  
  width: 100%;
  height: 100%;
  
  color: var(--text-color)
}

.welcome-disclaimer-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;

  width: 500px;
}

.welcome-disclaimer-wrapper p {
  margin: 20px 0px 0px 0px;
}

.welcome-disclaimer-wrapper-title {
  color: var(--text-color);
  font-size: 28px;
  font-weight: bold;
  text-align: center;
  line-height: 1.5;
}


.welcome-disclaimer-wrapper p {
  color: var(--text-color);
  font-size: 16px;
  text-align: center;
  line-height: 1.5;
}

.welcome-disclaimer-wrapper a {

  position: relative;
  font-weight: bold;
  color: var(--text-color);
  text-decoration: none;
}
/* #endregion Welcome_disclaimer */


/* 
 * MARK: Viewer
 */
 /* #region Viewer description */
.viewer {
  background-color: var(--bg-color1);
}

.svg-container {
  width: 100%;
  height: 100%;
}

.svg-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;

  padding: 20px;
}

.svg-plasmid-title {
  font-weight: bold;
}

.svg-sequence-axis {
  fill: none;
  stroke: var(--axis);
  stroke-width: 2;
}

.svg-sequence-indices {
  font-weight: bold;
  fill: var(--axis);

  -webkit-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.svg-feature-arrow {
  stroke: var(--border-color);
  stroke-width: 1;
}

.svg-feature-arrow-decoration {
  filter: brightness(0.7)
}

.svg-feature-arrow-hover {
  /*filter: contrast(150%)*/
  filter: brightness(1.1);
  /*filter: opacity(0.7);*/
  stroke: red;
  stroke-width: 2;
  cursor: pointer;
}

.svg-feature-label-black {
  fill: black;
  font-size: 14px;

  pointer-events: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.svg-feature-label-white {
  fill: white;
  font-size: 14px;

  pointer-events: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.sequence-cursor {
  fill: none;
  stroke-width: 3;
}

.sequence-cursor-hover {
  stroke: var(--axis);
}

.sequence-cursor-selection {
  stroke: var(--selection-cursor);
}


.deletion-marking {
  stroke-width: 2;
  stroke: var(--btn-red);
  stroke-dasharray: 8, 4;
}


/* 
 * MARK: Linear
 */
#linear-view-container {
  display: flex;
  flex-flow: column;
  justify-content: center;
}

#linear-view-container svg {
  width: 100%;
  height: 200px;
}

/* 
 * MARK: Circular
 */
#circular-view-container {

  display: flex;
  flex-flow: row;
  justify-content: center;
}

/* 
 * MARK: Grid
 */
/* #region Grid_view */
/* .viewer-grid-view {
  overflow-y: scroll;
} */

.grid-view-segments-container {
  width: 100%;
}

.grid-view-segments-container svg {
  width: 100%;
}

.grid-view {
  overflow-y: scroll;
  overflow-x: hidden;

  width: 100%;

  display: flex;
  flex-direction: row;
  justify-content: flex-start;
}

.grid-view-minimap {
  position: sticky;
  top: 0;
  right: 0;

  min-width: 40px;
  width: 40px;
  height: 100%;
  box-sizing: border-box;
  padding: 5px;

  /* background-color: var(--bg-color2); */
  opacity: 0.5;

  overflow: hidden;

  transition: opacity 0.1s ease-out;
}

.grid-view-minimap:hover {
  opacity: 1;
}

.grid-view-minimap div {
  width: 100%;
  height: 100%;
}

.grid-view-minimap div svg {
  position: relative;
  width: 100%;
  height: 100%;
}

.minimap-rect {
  stroke: var(--border-color);
  stroke-width: 1;
}

.minimap-bar {
  fill: var(--text-color);
  opacity: 0.2;
}

.minimap-bar:hover {
  cursor: grab;
}

.svg-wrapper-grid {
  padding: 20px;
}

.svg-wrapper-grid svg {
  transform: translateZ(0);
}

.svg-sequence-axis-grid {
  fill: none;
  stroke: var(--axis);
  stroke-width: 3;
}

/* #region AA_blcoks */

.aa-block {
  fill: transparent;
  stroke: var(--border-color);
  stroke-width: 1px;
}

.aa-block-hover {
  filter: brightness(1.1);
  stroke: red;
  stroke-width: 2;
  cursor: pointer;
}
/* Positively charged */
.aa-block-R { fill: #0077FF; } /* Arginine */
.aa-block-H { fill: #3399FF; } /* Histidine */
.aa-block-K { fill: #66B2FF; } /* Lysine */

/* Negatively charged */
.aa-block-D { fill: #FF4C4C; } /* Aspartic Acid */
.aa-block-E { fill: #FF6666; } /* Glutamic Acid */

/* Uncharged */
.aa-block-S { fill: #33CC66; } /* Serine */
.aa-block-T { fill: #66D98D; } /* Threonine */
.aa-block-N { fill: #99E6A6; } /* Asparagine */
.aa-block-Q { fill: #B3F0C2; } /* Glutamine */

/* Hydrophobic */
.aa-block-A { fill: #FFA500; } /* Alanine */
.aa-block-V { fill: #FFB833; } /* Valine */
.aa-block-I { fill: #FFC94D; } /* Isoleucine */
.aa-block-L { fill: #FFDB66; } /* Leucine */
.aa-block-M { fill: #E6A23C; } /* Methionine */
.aa-block-F { fill: #D98E3A; } /* Phenylalanine */
.aa-block-Y { fill: #E6A845; } /* Tyrosine */
.aa-block-W { fill: #DA8540; } /* Tryptophan */

/* Special */
.aa-block-C { fill: #8A2BE2; } /* Cysteine */
.aa-block-G { fill: #20B2AA; } /* Glycine */
.aa-block-P { fill: #5F9EA0; } /* Proline */

.aa-block-stop { fill: #D60000; } /* Stop */


.aa-text {
  font-weight: bold;
  font-size: 12px;

  pointer-events: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.aa-index {
  fill: var(--text-color);
  -webkit-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.aa-text-white {
  fill: white;
}

.aa-text-black {
  fill: black;
}
/* #endregion AA_blcoks */


/* #region Bases */
.base-text {
  font-size: 14px;
  fill: var(--text-color);

  pointer-events: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
.base-ambiguous-text {
  font-size: 14px;
  fill: var(--text-color);

  pointer-events: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  opacity: 0.3;
}

.base {
  fill: var(--bg-color1);
  opacity: 0.5;
}
.base-ambigous { fill: var(--border-color) }
.base-hover { fill: var(--base-hover) }
.base-selected { fill: var(--base-selected) }
.base-search { fill: var(--base-search) !important}
.base-search-focus { fill: var(--base-search-highlight) !important}

.base-primer-hr,
.base-primer-ins,
.base-primer-tbr,
.base-primer-subhr,
.base-primer-subtbr {
  opacity: 0.3;
  filter: saturate(3);
}
.base-primer-hr { fill: var(--hr) }
.base-primer-ins { fill: var(--ins) }
.base-primer-tbr { fill: var(--tbr) }
.base-primer-subhr { fill: var(--subhr) }
.base-primer-subtbr { fill: var(--subtbr) }

.subcloning-rect {
  opacity: 0.5;
  fill: var(--base-sub);
  stroke: var(--base-sub-border);
  stroke-width: 2px;
  stroke-dasharray: 10px 10px;
  animation: dash-move 40s linear infinite;
}
@keyframes dash-move {
  from {
      stroke-dashoffset: 0;
  }
  to {
      stroke-dashoffset: -520px; /* Moves dashes along the perimeter */
  }
}
/* #endregion Bases */


/* #endregion Grid_view */

/* #endregion Viewer */


/* 
 * MARK: Loading wrapper
 */
.loading-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;

  background-color: transparent;
  cursor: wait;
  z-index: 9999;
}

/* 
 * MARK: Sequence tooltip
 */
/* #region Sequence_tooltip */
.sequence-tooltip {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 5px;

  position: fixed;
  min-width: 0px;
  max-width: 300px;
  padding: 5px 10px;

  opacity: 0;
  color: var(--text-color);
  font-size: 11px;
  background-color: var(--bg-color1);
  border: 1px solid var(--border-color);
  border-radius: 5px;
  box-shadow: 0px 0px 5px var(--shadow-color);
  pointer-events: none;
  z-index: 100;
}
.sequence-tooltip[visible] {
  opacity: 100;
}

.sequence-tooltip-title {
  font-size: 14px;
  font-weight: bold;
}

.sequence-tooltip-row {
  display: flex;
  gap: 5px;

  width: 300px;
}

.sequence-tooltip-row-key {
  min-width: 40px;

  font-weight: bold;
  overflow-wrap: break-word;
}

.sequence-tooltip-row-value {
  word-break: break-all;
}
/* #endregion Sequence_tooltip */


/* 
 * MARK: Drag and drop
 */
/* #region File_drag_and_drop */
.drag-import-overlay::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 999;

  content: "";
  background-color: rgba(0,0,0,0.6);
}

.drag-import-overlay::after {
  display: block;
  
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 20px;
  z-index: 9999;

  content: "Drop plasmids file to import to IVA Prime.";
  color: white;
  font-size: 18px;
  font-weight: bold;
  text-align: center;
  background-color: var(--btn-green);
  border-radius: 5px;
  box-shadow: 0px 0px 20px var(--shadow-color);
}
/* #endregion File_drag_and_drop */


/* 
 * MARK: Alerts
 */
/* #region Alerts */
.alerts-container-wrapper {
  position: fixed;
  bottom: 37px;
  right: 65px;
  width: 50%;
  height: 100%;
  overflow: hidden;
  box-sizing: border-box;
  
  visibility: visible;
  pointer-events: none;
  mask-image: linear-gradient(
    to bottom, 
    rgba(0,0,0,0) 0%,
    rgba(0,0,0,0.75) 20%, 
    rgba(0,0,0,0.94) 40%, 
    rgba(0,0,0,0.98) 60%, 
    rgba(0,0,0,0.996) 80%, 
    rgba(0,0,0,1) 100%
  );
  z-index: 99999;
}

.alerts-container {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;

  position: absolute;
  width: 100%;
  bottom: 0;
  padding: 10px;
  box-sizing: border-box;

  pointer-events: all;
}

.alert {
  display: flex;
  align-items: stretch;
  gap: 5px;

  max-width: 100%;
  max-height: 20vh;
  overflow: hidden;
  padding: 5px;

  opacity: 1;
  background: var(--bg-color1);
  border-radius: 5px;
  box-shadow: 0px 2px 10px var(--shadow-color);
  border-left: 5px solid var(--btn-orange);
  transition: height 0.5s ease-out, opacity 0.5s ease-out, padding 0.5s ease-out;
  box-sizing: border-box;
  visibility: visible;
}
.alert[collapsed] {
  height: 0 !important;
  opacity: 0;
  padding: 0 5px;
}

.alert-icon {
  display: flex;
  justify-content: center;
  align-items: center;
  
  width: 100%;
  max-width: 70px;
  padding: 15px;
  box-sizing: border-box;
}
.alert-icon svg {
  display: block;

  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
}

.alert-body {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 10px;

  padding: 10px 0;
}

.alert-body h4 {
  font-size: 14px;
  margin: 0;
}

.alert-text {
  overflow-y: auto;
}

.alert-close-button {
  align-content: center;
  padding: 20px;
  
  font-size: 30px;
  text-align: center;
  border-radius: 5px;
  cursor: pointer;
}
.alert-close-button:hover {
  background-color: var(--base-hover);
}

.cookie-consent {
  max-width: 60%;
  max-height: 50%;
  padding: 15px;
}

.cookie-consent-body {
  align-items: stretch;
  gap: 15px;

  padding: 0;

  font-size: 14px;
  line-height: 1.5;
}
/* #endregion Alerts */


/* 
 * MARK: Context menu
 */
/* #region Context_menu */
.context-menu {
  display: block;

  position: absolute;
  min-width: 180px;
  z-index: 9999;

  visibility: visible;
  color: var(--text-color);
  background-color: var(--bg-color1);
  box-shadow: 0px 2px 10px var(--shadow-color);
  border: 2px solid var(--border-color);
}
.context-menu:not([visible]) {
  visibility: hidden;
}

.context-menu-section-title {
  padding: 5px;

  font-weight: bold;
}

.context-menu-section-items {
  padding-left: 17px;
}

.context-menu-item {
  padding: 7px 10px;
}
.context-menu-item:has(input) {
  display:flex;
  align-items: center;
}
.context-menu-item[disabled] {
  opacity: 15%;
  -webkit-user-select: none; /* Safari */
  -ms-user-select: none; /* IE 10 and IE 11 */
  user-select: none; /* Standard syntax */
}
.context-menu-item:not([disabled]):hover {
  background-color: var(--bg-hover);
  cursor: pointer;
}

.context-menu-item p {
  margin: 3px 0px;
}

.context-menu-separator {
  height: 1px;

  background: var(--border-color);
}

.context-submenu:not([visible]) {
  visibility: hidden;
}

.context-menu-has-submenu {
  position: relative;
}
.context-menu-has-submenu::after {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;

  position: absolute;
  top: 0;
  right: 0;
  width: 10%;
  height: 100%;

  content: "›";
  font-size: 18px;
}

.context-menu-checkbox {
  pointer-events: none;
  width: 1.25em;
  height: 1.25em;
  margin: 0;
  margin-right: 0.35em;
}

.context-menu-icon {
  display: inline-flex;
  align-items: center;
}

.context-menu-icon::before {
  content: "";
  display: inline-block;
  width: 1.5em;
  height: 1.5em;
  margin-right: 0.35em;

  background: no-repeat center / contain;
}

.context-menu-icon-iva-operations::before {
  background-image: url('/static/assets/favicon.svg');
}

.context-menu-icon-features::before {
  background-image: url('/static/assets/icons/features.svg');
}

.context-menu-icon-copy::before {
  background-image: url('/static/assets/icons/copy.svg');
}

/* #endregion Context_menu */


.input-incorrect {
  border: 2px solid red;
  background-color: #ffe6e6;
}