/*
 * Platform-shell styles shared by every mounted engine, layered on top of
 * the Bootstrap CDN stylesheet linked in the layout. Bootstrap 5.3's CSS
 * custom properties are overridden below instead of recompiling Bootstrap's
 * Sass, since this app has no Node/Sass build step (Propshaft only).
 *
 * "Clinical Navy & Teal" -- enterprise pharma/biotech look: deep navy
 * primary, teal accent (--bs-info, which already drives every "running/
 * in progress" status badge across all three engines -- see the pipeline
 * steppers), light cool-gray body, real typography (Inter), subtle card
 * shadows and larger radii instead of flat borders.
 *
 * Engine-specific styling (e.g. Folding's .workspace/.residue-* rules)
 * lives in that engine's own stylesheet, not here.
 */

:root {
  --bs-primary: #0f2a43;
  --bs-primary-rgb: 15, 42, 67;
  --bs-info: #0e7c86;
  --bs-info-rgb: 14, 124, 134;
  --bs-link-color: #0e7c86;
  --bs-link-hover-color: #0b5f67;
  --bs-body-bg: #f7f9fb;
  --bs-body-color: #1c2733;
  --bs-border-color: #dfe4ea;
  --bs-border-radius: 0.5rem;
  --bs-border-radius-sm: 0.375rem;
  --bs-border-radius-lg: 0.625rem;
  --bs-font-sans-serif: "Inter", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --app-shadow-sm: 0 1px 2px rgba(15, 42, 67, 0.04), 0 1px 3px rgba(15, 42, 67, 0.06);
  --app-shadow: 0 2px 4px rgba(15, 42, 67, 0.04), 0 4px 8px rgba(15, 42, 67, 0.06);
}

body {
  min-height: 100vh;
  font-size: 0.9375rem;
}

h1, .h3, h2, .h4, .h6 {
  letter-spacing: -0.01em;
  font-weight: 600;
}

/* Sidebar navigation shell -- fixed dark-navy sidebar on desktop, a
   Bootstrap Offcanvas drawer reusing the same look on mobile. */
.app-shell {
  min-height: 100vh;
}

.app-sidebar {
  width: 260px;
  background-color: var(--bs-primary);
  color: rgba(255, 255, 255, 0.85);
}

.app-sidebar .sidebar-brand {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.1rem;
  color: #fff;
  text-decoration: none;
  display: block;
}

.sidebar-brand-wrap {
  padding: 1.25rem 1.25rem 1rem;
}

.sidebar-nav {
  padding: 0 0.75rem;
}

.sidebar-nav-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: rgba(255, 255, 255, 0.7);
  padding: 0.55rem 0.75rem;
  border-radius: var(--bs-border-radius-sm);
  font-size: 0.9rem;
  margin-bottom: 0.15rem;
  border-left: 3px solid transparent;
}

.sidebar-nav-link:hover {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.06);
}

.sidebar-nav-link.active {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.1);
  border-left-color: var(--bs-info);
  font-weight: 500;
}

.sidebar-nav-link i {
  font-size: 1.05rem;
  width: 1.25rem;
  text-align: center;
}

.sidebar-footer {
  padding: 1rem 1.25rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.app-topbar {
  background-color: var(--bs-primary);
  color: #fff;
  padding: 0.65rem 1rem;
}

.app-main {
  min-width: 0;
  position: relative;
}

/* Fixed (not scrolling with content), very faint 3D-shaded DNA
   double-helix watermark centered behind the main content on every
   authenticated page. The SVG itself is drawn at full color/depth
   contrast (near strand segments thicker & more opaque than far ones,
   painter's-algorithm depth-sorted so the strands correctly occlude
   each other and the rungs) -- opacity here is the only "how faint
   overall" knob, kept separate so the 3D shading stays intact at any
   opacity level. */
.app-main::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url("/assets/dna-watermark-11a4036e.svg");
  background-repeat: no-repeat;
  background-position: center center;
  background-size: 420px auto;
  opacity: 0.05;
  z-index: 0;
  pointer-events: none;
}

/* position: fixed is relative to the viewport, not the flex layout, so
   without this the watermark centers on the whole browser window and
   ends up visibly left-of-center within the actual content area (which
   only starts after the 260px sidebar) on desktop. */
@media (min-width: 768px) {
  .app-main::before {
    left: 260px;
  }
}

.app-main > div {
  position: relative;
  z-index: 1;
}

.offcanvas.app-sidebar {
  width: 260px;
}

.offcanvas.app-sidebar .offcanvas-header {
  padding: 1.1rem 1.25rem;
}

.offcanvas.app-sidebar .btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
}

/* Bootstrap's .text-bg-info hardcodes black text, tuned for its default
   light cyan -- unreadable against the darker teal --bs-info is
   repurposed as here. background-color is left alone (it already reads
   var(--bs-info-rgb), so it re-themes correctly on its own). */
.text-bg-info {
  color: #fff !important;
}

.card {
  border-color: var(--bs-border-color);
  box-shadow: var(--app-shadow-sm);
  border-radius: var(--bs-border-radius);
}

.card .card {
  border-left: none;
  border-right: none;
  border-bottom: none;
  box-shadow: none;
}

.btn {
  border-radius: var(--bs-border-radius-sm);
  font-weight: 500;
}

.btn-primary {
  --bs-btn-bg: var(--bs-primary);
  --bs-btn-border-color: var(--bs-primary);
  --bs-btn-hover-bg: #163a5a;
  --bs-btn-hover-border-color: #163a5a;
}

.table {
  --bs-table-hover-bg: #eef2f6;
  font-size: 0.9rem;
}

.status-badge {
  text-transform: uppercase;
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: 0.03em;
  border-radius: 0.3rem;
}

.sequence-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  word-break: break-all;
}

/* Signed-out screens (login) render outside .app-shell -- no sidebar, so
   the DNA watermark and centering are self-contained here rather than
   reusing .app-main::before. */
.login-page {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background-color: var(--bs-body-bg);
  overflow: hidden;
}

/* Same "very faint watermark" technique as .app-main::before, kept on a
   separate layer since CSS opacity on .login-page itself would also fade
   the card sitting on top of it. */
.login-page::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("/assets/dna-watermark-11a4036e.svg");
  background-repeat: no-repeat;
  background-position: center center;
  background-size: 560px auto;
  opacity: 0.06;
}

.login-card {
  width: 100%;
  max-width: 24rem;
  background-color: #fff;
  border-radius: var(--bs-border-radius-lg);
  box-shadow: var(--app-shadow), 0 12px 32px rgba(15, 42, 67, 0.08);
  padding: 2.25rem 2rem;
  position: relative;
  z-index: 1;
}

.login-brand {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--bs-primary);
  letter-spacing: -0.02em;
}
