:root {
  --primary: #1e40afc1;
  --accent-blue: #2563eb;
  --accent-yellow: #f8e436;
  --accent-red: #d62728;
  --accent-green: #2ca02c;
  --accent-orange: #ff7f0e;
  --accent-light-yellow: #ffcc00;
  /* --bg-light: #f9fafb; */
  --bg-card: #f9f9f9;
  --text-dark: #1f2937;
  --text-subtle: #555;
  --button: rgb(160, 217, 255);
  --button-hover: rgb(39, 169, 255);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  background-color: var(--bg-light);
  color: var(--text-dark);
  margin: 2em auto 10em;
  max-width: 900px;
  padding: 0 1em;
  word-wrap: break-word;
}

h1,
h2,
h3 {
  line-height: 1.3;
}

h1 {
  font-size: 2rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 1em;
}

h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 1.5em 0 0.75em;
}

h3 {
  font-size: 1.2rem;
  font-weight: 500;
  margin: 1.25em 0 0.5em;
}

a {
  color: var(--accent-blue);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  text-decoration: underline;
}

dl {
  padding-left: 1rem;
}

dt {
  display: list-item;
  margin-bottom: 0.25em;
}

hr {
  border: none;
  border-top: 1px solid #d1d5db;
  margin: 2em 0;
}

/* Collapsibles */
.collapsible-domain,
.collapsible {
  cursor: pointer;
  border-radius: 6px;
  font-weight: 600;
  transition: background-color 0.2s ease;
}

.collapsible-domain {
  background: var(--button);
  padding: 0.6em 1em;
  margin-top: 1.5em;
}

.collapsible-domain:hover {
  background: var(--button-hover);
}

.collapsible {
  background: #f6f6f3;
  border: 1px solid #d1d5db;
  font-size: 1rem;
  padding: 8px 12px;
  margin-top: 8px;
}

.collapsible:hover {
  background: #e5e7eb;
}

.collapsible-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 1em;
}

.collapsible-container>div {
  flex: 1 0 30%;
  min-width: 150px;
  max-width: 200px;
}

/* Search */
.search-container {
  display: flex;
  justify-content: center;
  margin: 2em 0 1.5em;
}

.search-container input[type="text"] {
  width: 100%;
  max-width: 300px;
  padding: 8px 12px;
  font-size: 1rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
}

/* Table */
.responsive-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1em;
  background: white;
  box-shadow: 0 0 0 1px #e5e7eb;
}

.responsive-table th,
.responsive-table td {
  border: 1px solid #e5e7eb;
  padding: 0.6em 0.8em;
  text-align: left;
  white-space: nowrap;
  font-size: 0.95em;
}

.responsive-table th {
  background: #f1f5f9;
  font-weight: 600;
}

/* Sequence */
.sequence-block {
  white-space: pre-wrap;
  word-break: break-word;
  background: #f3f4f6;
  padding: 1em;
  border-radius: 0.5em;
  font-family: monospace;
  font-size: 14px;
  overflow-x: auto;
  border: 1px solid #d1d5db;
}

/* Quote */
blockquote {
  margin: 1.5em 0;
  padding: 1em;
  background: var(--bg-light);
  border-left: 4px solid #d1d5db;
  font-style: italic;
  color: #374151;
}

/* Protein Grid */
.protein-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1em;
  margin-top: 1em;
}

.protein-card {
  display: block;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 1em;
  background: var(--bg-card);
  transition: box-shadow 0.2s ease;
  margin-bottom: 1em;
}

.protein-card:hover {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.protein-name {
  font-weight: bold;
  font-size: 1.1em;
  margin-bottom: 0.3em;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.protein-acc {
  font-family: monospace;
  font-size: 0.9em;
  color: var(--text-subtle);
}

/* Confidence */
.confidence-badge {
  display: inline-block;
  padding: 0.2em 0.6em;
  font-size: 0.8em;
  font-weight: 600;
  border-radius: 999px;
  color: white;
  margin-left: 0.5em;
  white-space: nowrap;
}

.confidence-high {
  background: var(--accent-green);
}

.confidence-mid {
  background: var(--accent-light-yellow);
  color: #000;
}

.confidence-low {
  background: var(--accent-orange);
}

.confidence-poor {
  background: var(--accent-red);
}

.confidence-badge:hover {
  filter: brightness(1.1);
  cursor: default;
}

cite {
  display: block;
  background: #fffce6;
  border-left: solid #facc15;
  padding: 1em;
  margin: 2em 0;
  font-style: normal;
  color: #4b5563;
  font-size: 0.95em;
  border-radius: 6px;
}

/* Nav */
nav.nav-center {
  display: flex;
  justify-content: center;
  padding: 1em 0;
}

.nav-buttons {
  display: flex;
  gap: 2em;
}

.dropbtn {
  background: var(--button);
  border: none;
  font-size: 1em;
  padding: 0.6em 1.2em;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

.dropbtn:hover {
  background: var(--button-hover);
}

.dropdown {
  position: relative;
}

.dropdown-content {
  display: none;
  position: absolute;
  top: 110%;
  left: 0;
  background: white;
  width: max-content;
  padding: 0.8em 1em;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  border-radius: 6px;
  z-index: 10;
}





/* Gallery */
.gallery {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin-top: 40px;
}

.image-item {
  flex: 1 1 300px;
  max-width: 300px;
  text-align: center;
}

.image-item img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  transform: none !important;
  transition: none !important;
  display: block;
}

.caption,
.image-caption {
  margin-top: 8px;
  font-size: 0.95em;
  color: #333;
}

.gallery:has(.image-item:nth-child(1):nth-last-child(1)) .image-item {
  flex: 0 1 100%;
  max-width: 600px;
  margin: 0 auto;
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  z-index: 1000;
  padding-top: 60px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.9);
  text-align: center;
}

.lightbox img {
  max-width: 90%;
  max-height: 80vh;
  margin: auto;
  display: block;
}

.lightbox:target {
  display: block;
}

.lightbox-close {
  position: absolute;
  top: 30px;
  right: 40px;
  font-size: 36px;
  color: white;
  text-decoration: none;
  font-weight: bold;
  cursor: pointer;
}

/* Download Button */
.download-button {
  display: inline-block;
  padding: 0.5em 1em;
  margin: 0.5em 0;
  background-color: #0077cc;
  color: white;
  border: none;
  border-radius: 6px;
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.2s ease-in-out;
}

.download-button:hover {
  background-color: #005fa3;
}

/* Responsive tweaks */
@media screen and (max-width: 600px) {

  .responsive-table th,
  .responsive-table td {
    font-size: 12px;
    padding: 4px 6px;
  }

  .search-container input[type="text"] {
    width: 100%;
  }

  .protein-name {
    font-size: 1em;
  }

  .confidence-badge {
    font-size: 0.75em;
    padding: 0.15em 0.5em;
  }

  .collapsible-container>div {
    flex: 1 0 100%;
  }

  .dropbtn {
    font-size: 0.95em;
    padding: 0.5em 1em;
  }

  .dropdown-content {
    left: 0;
    right: auto;
  }
}

ul {
  margin-left: 1.5em;
  margin-bottom: 1em;
  list-style-type: disc;
}

ul ul {
  margin-left: 1.5em;
  margin-top: 0.5em;
  list-style-type: circle;
}

.nav-center {
  display: flex;
  justify-content: center;
  padding: 20px 0;
}

.nav-buttons {
  display: flex;
  gap: 20px;
}

.dropdown {
  position: relative;
  display: inline-block;
}

.dropbtn {
  background-color: #007bff;
  color: white;
  padding: 10px 18px;
  border: none;
  border-radius: 10px;
  font-weight: bold;
  cursor: pointer;
  font-size: 16px;
}

.dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: #ffffff;
  border-radius: 10px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.15);
  min-width: 240px;
  padding: 10px 0;
  z-index: 999;
}

.dropdown:hover .dropdown-content,
.dropdown:focus-within .dropdown-content {
  display: block;
}

.dropdown-submenu {
  padding: 8px 16px;
  border-bottom: 1px solid #eee;
}

.dropdown-submenu:last-child {
  border-bottom: none;
}

.submenu-label {
  font-weight: bold;
  display: block;
  margin-bottom: 6px;
  color: #333;
}

.dropdown-content a {
  display: block;
  padding: 8px 16px;
  text-decoration: none;
  color: #007bff;
}

.dropdown-content a:hover {
  background-color: #f1f1f1;
  color: #0056b3;
}
