/**
 * PerseaDB visual skin for the standalone JBrowse installation.
 * Landing-page rules are separated from JBrowse 1 rules by the tundra class.
 */

:root {
  --persea-ink: #18351f;
  --persea-text: #526159;
  --persea-green: #23743a;
  --persea-green-dark: #175a2c;
  --persea-leaf: #75a855;
  --persea-line: #dce7d8;
  --persea-mist: #f3f8f0;
}

/* Shared PerseaDB navigation on the standalone genome-selection page. */
.perseadb-site-nav {
  position: relative;
  z-index: 10000;
  min-height: 78px;
  border: 0;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 12px 30px rgba(20, 61, 42, .08);
}

.perseadb-site-nav::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
  background: linear-gradient(90deg, #173d2b, #55a76d 55%, #b8d66d);
  content: "";
}

.perseadb-site-nav__inner {
  display: flex;
  width: min(1240px, calc(100% - 30px));
  min-height: 78px;
  margin: 0 auto;
  align-items: center;
  justify-content: space-between;
}

.perseadb-site-brand {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  color: #1f2822;
  text-decoration: none;
}

.perseadb-site-brand__mark {
  display: block;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
}

.perseadb-site-brand__copy strong,
.perseadb-site-brand__copy small {
  display: block;
}

.perseadb-site-brand__copy strong {
  margin-bottom: 4px;
  color: #173d2b;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.15;
}

.perseadb-site-brand__copy small {
  color: #75847b;
  font-size: .72rem;
  letter-spacing: .01em;
}

.perseadb-site-links {
  display: flex;
  align-items: center;
}

.perseadb-site-links a {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin: 0 .15rem;
  padding: 1rem .55rem;
  color: #405149;
  font-size: .88rem;
  font-weight: 600;
  text-decoration: none;
  transition: color .2s ease;
  white-space: nowrap;
}

.perseadb-site-links a:hover,
.perseadb-site-links a:focus {
  color: #237147;
  text-decoration: none;
}

.perseadb-site-links a.is-active {
  color: #237147;
}

.perseadb-site-links a::after {
  position: absolute;
  right: .55rem;
  bottom: .7rem;
  left: .55rem;
  height: 2px;
  background: #55a76d;
  content: "";
  transform: scaleX(0);
  transition: transform .2s ease;
}

.perseadb-site-links a:hover::after,
.perseadb-site-links a:focus::after,
.perseadb-site-links a.is-active::after {
  transform: scaleX(1);
}

/* Compact navigation inside the full-screen JBrowse workspace. */
.perseadb-browser-toolbar {
  position: fixed;
  top: 7px;
  right: 12px;
  z-index: 10000;
  display: flex;
  gap: 5px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 8px;
  background: rgba(20, 82, 39, .94);
  box-shadow: 0 6px 18px rgba(13, 45, 25, .24);
}

.perseadb-browser-toolbar__link {
  display: inline-flex;
  min-height: 29px;
  align-items: center;
  padding: 0 10px;
  border-radius: 6px;
  color: #fff;
  font: 700 11px/1 "Segoe UI", Inter, Arial, sans-serif;
  text-decoration: none;
  white-space: nowrap;
}

.perseadb-browser-toolbar__link:hover,
.perseadb-browser-toolbar__link:focus {
  background: rgba(255, 255, 255, .16);
  color: #fff;
  outline: 0;
  text-decoration: none;
}

/* Genome selection landing page. */
body:not(.tundra) {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 86% 8%, rgba(117, 168, 85, 0.16), transparent 28%),
    linear-gradient(180deg, #f7faf5 0, #fff 48%);
  color: var(--persea-ink);
  font-family: "Segoe UI", Inter, Arial, sans-serif;
}

body:not(.tundra) .header {
  position: relative;
  padding: 70px 24px 62px;
  overflow: hidden;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.07), transparent 42%),
    linear-gradient(135deg, #185d2f 0%, #24813f 58%, #317b42 100%);
  box-shadow: 0 16px 40px rgba(20, 71, 35, 0.16);
  color: #fff;
  text-align: left;
}

body:not(.tundra) .header::before {
  display: block;
  width: min(1120px, calc(100% - 16px));
  margin: 0 auto 16px;
  color: #cde8c5;
  content: "PERSEADB  /  GENOME EXPLORER";
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.15em;
}

body:not(.tundra) .header::after {
  position: absolute;
  right: -90px;
  bottom: -150px;
  width: 390px;
  height: 390px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  box-shadow:
    0 0 0 48px rgba(255, 255, 255, 0.04),
    0 0 0 96px rgba(255, 255, 255, 0.025);
  content: "";
}

body:not(.tundra) .header h1,
body:not(.tundra) .header p {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 16px));
  margin-right: auto;
  margin-left: auto;
}

body:not(.tundra) .header h1 {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: clamp(34px, 5vw, 56px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.08;
}

body:not(.tundra) .header p {
  max-width: 720px;
  margin-top: 0;
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.84);
  font-size: 18px;
  line-height: 1.65;
}

body:not(.tundra) .container {
  width: min(1120px, calc(100% - 40px));
  margin: 54px auto 64px;
}

body:not(.tundra) .section-title {
  margin: 0 0 22px;
  color: #4f7c35;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

body:not(.tundra) .cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

body:not(.tundra) .card {
  position: relative;
  width: auto;
  min-height: 220px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--persea-line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 42px rgba(26, 61, 34, 0.08);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

body:not(.tundra) .card:first-child {
  border-color: #bcd6b2;
  background: linear-gradient(135deg, #f8fcf6, #fff 68%);
}

body:not(.tundra) .card:first-child::after {
  position: absolute;
  top: 20px;
  right: 20px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #e7f2e2;
  color: #326b33;
  content: "PRIMARY DATASET";
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

body:not(.tundra) .card:hover {
  border-color: #b7cdb0;
  box-shadow: 0 22px 50px rgba(26, 61, 34, 0.14);
  transform: translateY(-5px);
}

body:not(.tundra) .card a {
  display: flex;
  min-height: 220px;
  box-sizing: border-box;
  flex-direction: column;
  padding: 30px;
  color: var(--persea-ink);
  text-decoration: none;
}

body:not(.tundra) .card a::after {
  margin-top: auto;
  padding-top: 24px;
  color: #337335;
  content: "Open genome browser  \2192";
  font-size: 14px;
  font-weight: 800;
}

body:not(.tundra) .icon {
  display: grid;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--persea-mist);
  font-size: 30px;
  place-items: center;
}

body:not(.tundra) .name {
  margin-top: 20px;
  color: var(--persea-ink);
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.015em;
}

body:not(.tundra) .desc {
  max-width: 390px;
  margin-top: 8px;
  color: var(--persea-text);
  font-size: 15px;
  line-height: 1.6;
}

body:not(.tundra) .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 16px;
}

body:not(.tundra) .meta span {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  padding: 0 9px;
  border: 1px solid #d9e8d4;
  border-radius: 999px;
  background: #f3f8f0;
  color: #477345;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .04em;
}

body:not(.tundra) .footer {
  margin: 0;
  padding: 26px 20px 34px;
  border-top: 1px solid #e3ebe0;
  color: #718078;
  font-size: 13px;
  text-align: center;
}

/* JBrowse 1 workspace. Keep geometry unchanged and restyle controls only. */
body.tundra {
  color: #263b2c;
  font-family: "Segoe UI", Inter, Arial, sans-serif;
}

.tundra .jbrowse .menuBar {
  border-bottom: 1px solid #154f28;
  background: linear-gradient(90deg, #185d2f 0%, #267c3e 100%);
  box-shadow: 0 3px 12px rgba(15, 59, 28, 0.18);
  color: #fff;
}

.tundra .jbrowse .menuBar .dijitButtonNode {
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #fff;
}

.tundra .jbrowse .menuBar .dijitButtonHover .dijitButtonNode,
.tundra .jbrowse .menuBar .dijitDropDownButtonHover .dijitButtonNode,
.tundra .jbrowse .menuBar .dijitDropDownButtonOpened .dijitButtonNode {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.12);
}

.tundra .jbrowse .overview {
  border-bottom: 1px solid #d5e3d1;
  background: #eef5eb;
}

.tundra .jbrowse .overview .locationThumb {
  border-color: #3c813f !important;
  background: rgba(74, 139, 69, 0.22);
}

.tundra .jbrowse #navbox {
  border-bottom: 1px solid #dce7d8;
  background: #fff;
  box-shadow: 0 4px 14px rgba(24, 53, 31, 0.06);
}

.tundra .jbrowse #search-box .dijitTextBox,
.tundra .jbrowse #search-refseq .dijitSelect {
  border-color: #bfd1ba;
  border-radius: 6px;
  background: #fff;
}

.tundra .jbrowse #search-box .dijitTextBoxFocused,
.tundra .jbrowse #search-refseq .dijitSelectFocused {
  border-color: #57914c;
  box-shadow: 0 0 0 2px rgba(87, 145, 76, 0.15);
}

.tundra .jbrowse .jbrowseHierarchicalTrackSelector {
  border-right: 1px solid #cfdecb;
  background: #f7faf5;
  box-shadow: 3px 0 12px rgba(24, 53, 31, 0.05);
}

.tundra .jbrowse .jbrowseHierarchicalTrackSelector > .header {
  border-bottom: 1px solid #d8e4d5;
  background: #edf5e9;
}

.tundra .jbrowse .jbrowseHierarchicalTrackSelector .header .title {
  color: #1d4d27;
  font-size: 17px;
  font-weight: 700;
}

.tundra .jbrowse .jbrowseHierarchicalTrackSelector .textfilter input {
  box-sizing: border-box;
  border: 1px solid #c2d4bd;
  border-radius: 7px;
  background: #fff;
  color: #2c4232;
}

.tundra .jbrowse .jbrowseHierarchicalTrackSelector .textfilter input:focus {
  border-color: #57914c;
  box-shadow: 0 0 0 2px rgba(87, 145, 76, 0.14);
  outline: 0;
}

.tundra .jbrowse .tracklist-label {
  border-radius: 6px;
  color: #3f5145;
}

.tundra .jbrowse .tracklist-label:hover {
  background: #e8f2e4;
  color: #214d29;
}

.tundra .jbrowse .tracklist-label input[type="checkbox"] {
  accent-color: #397a3c;
}

.tundra .jbrowse .dijitTitlePaneTitle {
  border-color: #d3e1cf;
  background: #eef5eb !important;
  color: #244d2b;
}

.tundra .jbrowse .dijitTitlePaneTitleHover,
.tundra .jbrowse .dijitTitlePaneTitleOpen {
  background: #e4efe0 !important;
}

.tundra .jbrowse .dijitTitlePaneContentOuter {
  border-color: #d3e1cf;
}

.tundra .jbrowse .track-label {
  border-color: #b9cfb4;
  border-radius: 0 0 6px 6px;
  background: #eef5eb;
  color: #244d2b;
  box-shadow: 0 2px 7px rgba(24, 53, 31, 0.08);
}

.tundra .dijitMenu,
.tundra .dijitMenuBar {
  border-color: #bfd1ba;
  background: #fff;
  box-shadow: 0 10px 28px rgba(24, 53, 31, 0.14);
}

.tundra .dijitMenuItem {
  color: #34483a;
}

.tundra .dijitMenuPassive .dijitMenuItemHover,
.tundra .dijitComboBoxMenu .dijitMenuItemHover,
.tundra .dijitMenuItemSelected {
  background: #e5f0e1;
  color: #1e5129;
}

.tundra .dijitDialog {
  border-color: #a9c2a3;
  border-radius: 10px;
  box-shadow: 0 18px 50px rgba(24, 53, 31, 0.2);
}

.tundra .dijitDialogTitleBar {
  border-bottom: 1px solid #cfe0cb;
  background: #edf5e9 !important;
  color: #214d29;
}

.tundra .dijitTooltipContainer {
  border-color: #afc7a9;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(24, 53, 31, 0.12);
  color: #34483a;
}

@media (max-width: 760px) {
  .perseadb-site-nav__inner {
    width: calc(100% - 26px);
    min-height: 78px;
  }

  .perseadb-site-brand__mark {
    width: 44px;
    height: 44px;
  }

  .perseadb-site-brand__copy small {
    display: none;
  }

  .perseadb-site-links {
    max-width: 62%;
    overflow-x: auto;
  }

  .perseadb-site-links a {
    margin: 0;
    padding: .72rem .4rem;
    font-size: .8rem;
  }

  .perseadb-browser-toolbar {
    top: 5px;
    right: 6px;
  }

  .perseadb-browser-toolbar__link {
    padding: 0 7px;
    font-size: 10px;
  }

  body:not(.tundra) .header {
    padding: 52px 20px 46px;
  }

  body:not(.tundra) .container {
    width: min(100% - 28px, 1120px);
    margin-top: 36px;
  }

  body:not(.tundra) .cards {
    grid-template-columns: 1fr;
  }

  body:not(.tundra) .card,
  body:not(.tundra) .card a {
    min-height: 200px;
  }
}


/* PerseaDB three-genome cards v6.7.1 */
@media (min-width: 980px) {
  body:not(.tundra) .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
