/* Shared site polish for Mol Biology Tools.
   Keep this small and cacheable. Page-specific tool CSS stays inline in each tool page. */

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  background: #f5f7fb;
  color: #1f2937;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

a {
  text-underline-offset: 3px;
}

button,
a[href] {
  touch-action: manipulation;
}

input,
textarea,
select {
  font: inherit;
}

input,
textarea,
select {
  border-color: #cbd5e1;
  background: #ffffff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

button,
.open-tool,
.nav-link,
.tool-links a {
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease, color 0.15s ease;
}

button:hover,
.open-tool:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.16);
}

button:focus-visible,
.open-tool:focus-visible,
.nav-link:focus-visible,
.tool-links a:focus-visible,
footer a:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
  border-radius: 8px;
}

.container,
.page-card,
.faq-item,
.guide-card,
.tool-card,
.output-panel,
.stat-box,
.quick-card {
  border-color: #dbe4f0;
}

.container,
.page-card,
.faq-item,
.guide-card {
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

footer {
  color: #64748b;
}

footer a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

button,
input[type="button"],
input[type="submit"],
input[type="reset"],
.open-tool,
.home-btn,
.help-btn,
.secondary-btn,
.copy-btn,
.clear-btn,
.transfer-btn,
.workflow-btn,
.external-btn-neb,
.external-btn-thermo,
.add-pair-btn,
.remove-pair-btn,
.remove-btn,
.tool-links a {
  font-weight: 700 !important;
}


.tool-intro-note {
  background: #f8fafc;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  padding: 12px 14px;
  margin: 14px 0 18px;
}

.tool-intro-note p {
  margin: 0 0 8px;
  color: #374151;
  line-height: 1.55;
}

.tool-intro-note p:last-child {
  margin-bottom: 0;
}

/* Brand and mobile polish */
header {
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}

.logo::before {
  filter: drop-shadow(0 2px 4px rgba(37, 99, 235, 0.18));
}

.tool-card:hover,
.guide-card:hover {
  border-color: var(--tool-accent, #bfdbfe);
}

.tool-card[data-category="primer"] .tag {
  background: #eef4ff;
  color: #1d4ed8;
  border-color: #c7d8ff;
}

.tool-card[data-category="sequence"] .tag {
  background: #ecfdf5;
  color: #047857;
  border-color: #bbf7d0;
}

.tool-card[data-category="cloning"] .tag {
  background: #f5f3ff;
  color: #6d28d9;
  border-color: #ddd6fe;
}

.tool-card[data-category="calculator"] .tag {
  background: #fffbeb;
  color: #92400e;
  border-color: #fde68a;
}

.back-to-top-btn,
.scroll-top-btn {
  position: fixed;
  right: 22px;
  bottom: calc(22px + env(safe-area-inset-bottom));
  z-index: 999;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 999px;
  background: #2563eb;
  color: #ffffff;
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 10px 26px rgba(37, 99, 235, 0.28);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.16s ease, transform 0.16s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.back-to-top-btn:hover,
.scroll-top-btn:hover {
  background: #1d4ed8;
}

.sequence-summary,
.sequence-live-summary {
  margin-top: 8px;
  margin-bottom: 12px;
  padding: 9px 11px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.45;
}

.summary-empty {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  color: #6b7280;
}

.summary-ok {
  background: #dcfce7;
  border: 1px solid #86efac;
  color: #166534;
}

.summary-error {
  background: #ffe4e6;
  border: 1px solid #fb7185;
  color: #9f1239;
}

.summary-warning {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #92400e;
}


/* Cross-tool workflow actions use a distinct accent from primary calculate/design buttons. */
.transfer-btn,
.workflow-btn,
.button-row .workflow-btn,
.secondary-btn.workflow-btn {
  background: #be123c !important;
  border-color: #be123c !important;
  color: #ffffff !important;
}

.transfer-btn:hover,
.workflow-btn:hover,
.button-row .workflow-btn:hover,
.secondary-btn.workflow-btn:hover {
  background: #9f1239 !important;
  border-color: #9f1239 !important;
}

.transfer-btn.done,
.workflow-btn.done,
.workflow-btn.copied,
.secondary-btn.workflow-btn.copied {
  background: #15803d !important;
  border-color: #15803d !important;
}

.transfer-btn.transfer-error,
.workflow-btn.transfer-error,
.workflow-btn.copy-error,
.secondary-btn.workflow-btn.copy-error {
  background: #dc2626 !important;
  border-color: #dc2626 !important;
}

body.has-scrolled-for-top .back-to-top-btn,
body.has-scrolled-for-top .scroll-top-btn {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

@media (max-width: 800px) {
  header {
    padding: 14px 20px !important;
  }

  .nav {
    flex-wrap: nowrap !important;
    gap: 10px !important;
  }

  .nav .logo {
    gap: 8px !important;
    font-size: 19px !important;
  }

  .nav .logo::before {
    width: 26px !important;
    height: 26px !important;
    flex-basis: 26px !important;
  }

  .nav-links {
    display: flex !important;
    flex: 0 1 auto !important;
    width: auto !important;
    flex-wrap: nowrap !important;
    justify-content: flex-end !important;
    gap: 10px !important;
    overflow: visible !important;
  }

  .nav-link {
    flex: 0 0 auto;
    min-height: 0 !important;
    padding: 5px 4px !important;
    border: 0 !important;
    background: transparent !important;
    font-size: 13.5px !important;
    white-space: nowrap;
  }

  .nav-links .nav-link:nth-child(n+3) {
    display: none !important;
  }

  .hero {
    padding-top: 34px !important;
    padding-bottom: 18px !important;
  }

  .hero h1 {
    font-size: 34px !important;
    line-height: 1.22;
  }

  .tool-card {
    padding: 20px !important;
  }

  .tool-card h3,
  .guide-card h2 {
    font-size: 20px !important;
  }

  .tag {
    font-size: 12px !important;
    padding: 4px 8px !important;
  }

  .open-tool {
    min-height: 40px;
    padding: 9px 12px !important;
  }

  .back-to-top-btn,
  .scroll-top-btn {
    width: 42px !important;
    height: 42px !important;
    right: 12px !important;
    bottom: calc(12px + env(safe-area-inset-bottom)) !important;
    font-size: 20px !important;
  }
}

@media (max-width: 380px) {
  header {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  .nav {
    gap: 8px !important;
  }

  .nav-links {
    gap: 8px !important;
  }

  .nav-link {
    padding-left: 3px !important;
    padding-right: 3px !important;
    font-size: 13px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Homepage about/contact link polish */
.about-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 22px auto 0;
}

.about-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 14px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 700;
  text-decoration: none;
}

.about-actions a:hover {
  background: #dbeafe;
}

@media (max-width: 800px) {
  .about-actions {
    justify-content: flex-start;
  }

  .about-actions a {
    flex: 1 1 130px;
  }

  footer {
    padding-bottom: calc(42px + env(safe-area-inset-bottom)) !important;
  }
}
