/* --- Segmented Control --- */
.segmented-control {
  display: flex;
  justify-content: center;
  border: 1px solid #28a745 !important;
  border-radius: 0.25rem;
  overflow: hidden;
  width: fit-content;
  margin: 15px auto;
}

.segmented-control .btn {
  border-radius: 0;
  border: none;
  background-color: #fff !important;
  color: #28a745 !important;
}

.segmented-control .btn:not(:last-child) {
  border-right: 1px solid #28a745 !important;
}

.segmented-control .btn.active {
  background-color: #28a745 !important;
  color: #fff !important;
  cursor: default;
  box-shadow: none !important;
}

.segmented-control .btn:hover:not(.active) {
  background-color: #e9ecef !important;
}

/* --- Sidebar and Navigation Styling --- */

/* Active tab item text color */
.main-sidebar .nav-sidebar .nav-item > .nav-link.active {
  color: white !important;
}

/* Hover over a tab item */
.main-sidebar .nav-sidebar .nav-item > .nav-link:hover {
  background-color: #218838 !important;
  color: white !important;
}

/* Active tab background and text color (Pills) */
.nav-pills .nav-link.active, 
.nav-pills .show > .nav-link {
  background-color: #28a745 !important; 
  color: white !important;
}

/* Hover state (non-active tabs) */
.nav-pills .nav-link:hover {
  color: #0F3F1E !important;
  background-color: rgba(40, 167, 69, 0.1) !important;
}

/* --- HMM Diagram Styling --- */
.matrix-overlay { pointer-events: none; }

#hmmwrap { position: relative; width: 100%; }
#hmmwrap .base-svg { width: 100%; height: 60vh; display: block; }

/* Hotspots */
.hs { position: absolute; transform: translate(-50%, -50%); pointer-events: auto; }

.hs .tag {
  font-weight: 600;
  padding: .15rem .35rem;
  border-radius: .5rem;
  background: rgba(0,0,0,.55);
  color: #fff;
  line-height: 1;
  font-size: clamp(10px, 1.2vw, 14px);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.hs .callout {
  position: absolute;
  left: 50%; top: -8px;
  transform: translate(-50%, -12px) scale(.98);
  opacity: 0; visibility: hidden;
  transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s;
  background: #fff; color: #222;
  border: 1px solid rgba(0,0,0,.12);
  box-shadow: 0 6px 22px rgba(0,0,0,.12);
  border-radius: .6rem;
  padding: .5rem .6rem;
  min-width: 180px; max-width: min(360px, 60vw);
  z-index: 2;
  white-space: normal;
}

#hmmwrap_all {
  position: relative;
  isolation: isolate;
  width: 70%;
  max-width: 900px;
  margin: auto;
  aspect-ratio: 327 / 351;
  /* Palette vars */
  --pi:    #2e86de;
  --trans: #e74c3c;
  --emit:  #27ae60;
  --tagText: #fff;
}

#hmmwrap_all .base-svg {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  display: block;
}

#hmmwrap_all .hs {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 1;
}

#hmmwrap_all .hs:hover,
#hmmwrap_all .hs:focus-within {
  z-index: 9999;
}

#hmmwrap_all .hs .callout {
  position: absolute;
  left: 50%; top: -10px;
  transform: translate(-50%, -100%);
  min-width: 220px; max-width: 360px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff; color: #333;
  box-shadow: 0 12px 30px rgba(0,0,0,.25);
  opacity: 0; visibility: hidden;
  pointer-events: none;
  transition: opacity .12s ease, transform .12s ease;
  z-index: 2147483647;
}

#hmmwrap_all .hs:hover .callout,
#hmmwrap_all .hs:focus-within .callout {
  opacity: 1; visibility: visible;
  transform: translate(-50%, -110%);
}

#hmmwrap_all .hs .tag {
  color: var(--tagText);
  font-weight: 600;
  padding: .18rem .50rem;
  border-radius: .55rem;
  background: rgba(0,0,0,.35);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

#hmmwrap_all .hs.pi .tag { background: var(--pi); }
#hmmwrap_all .hs.trans .tag,
#hmmwrap_all .hs.trans.tag { background: var(--trans); }
#hmmwrap_all .hs.emit .tag { background: var(--emit); }

#hmmwrap_all .hs:hover .tag,
#hmmwrap_all .hs:focus-within .tag {
  filter: brightness(1.05);
}

#hmmwrap_all {
  color-scheme: light;
  background: #fff;
}

#hmmwrap_all .base-svg {
  filter: none !important;
  mix-blend-mode: normal !important;
  -webkit-filter: none !important;
}

/* --- Matrix Styling --- */
.mx-frame {
  position:relative; display:inline-block; padding:12px 18px; margin:8px 0;
}
.mx-frame::before, .mx-frame::after {
  content:''; position:absolute; top:4px; bottom:4px; width:12px;
  border-top:3px solid #222; border-bottom:3px solid #222;
}
.mx-frame::before { left:0;  border-left:3px solid #222;  border-right:none;  border-radius:4px 0 0 4px; }
.mx-frame::after  { right:0; border-right:3px solid #222; border-left:none;  border-radius:0 4px 4px 0; }

.mx-table .htCore td, .mx-table .htCore th { 
  border-color: rgba(0,0,0,.12);
}
.mx-table .htCore th { 
  background: transparent; 
  font-weight:600; 
  font-family: 'Times New Roman', Georgia, serif; 
  font-style: italic;
}
.mx-table .htCore td { 
  text-align:center; 
  vertical-align:middle; 
  font-family:'Times New Roman', Georgia, serif; 
  font-style:italic; 
  font-size:1.05rem;
}
.mx-table .ht_clone_top .htCore th { border-bottom:2px solid #222; }
.mx-table .ht_clone_left .htCore th { border-right:2px solid #222; }

/* Center card titles */
.card-header { position: relative; }
.card-header .card-title {
  float: none !important;
  width: 100%;
  text-align: center;
  margin: 0;
  font-size: 36px;
}
.card-header .card-tools {
  position: absolute;
  right: .75rem;
  top: .5rem;
}

/* Center tab labels */
.nav-tabs { justify-content: center; }

/* Sliders */
.irs-bar, .irs-bar-edge {
  background: #28a745 !important;
  border-color: #28a745 !important;
}
.irs-single, .irs-from, .irs-to {
  background: #28a745 !important;
}
.irs-handle > i:first-child {
  background: #28a745 !important;
}

/* --- Matrix Inputs --- */
.mx-row { display:flex; align-items:center; justify-content:center; gap:.75rem; width:100%; }

.mx-mat {
  position: relative; display:inline-grid; grid-template-columns: repeat(2, 90px);
  gap: 10px; padding: 10px 14px; margin: 6px 0;
}
.mx-mat::before, .mx-mat::after {
  content:''; position:absolute; top:0; bottom:0; width:10px;
  border-top:3px solid #222; border-bottom:3px solid #222;
}
.mx-mat::before { left:-12px;  border-left:3px solid #222;  border-radius:6px 0 0 6px; }
.mx-mat::after  { right:-12px; border-right:3px solid #222; border-radius:0 6px 6px 0; }

.mx-mat .form-group { margin:0; }

.mx-mat input.form-control {
  width: 90px; height: 2.2rem; text-align:center;
  font-family: 'Times New Roman', Georgia, serif; font-style: italic; font-size: 1.1rem;
  padding: .25rem .5rem;
}
.mx-mat input[type=number]::-webkit-outer-spin-button,
.mx-mat input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.mx-mat input[type=number] { -moz-appearance: textfield; }

.mx-lead { text-align:center; font-weight:600; }

/* --- Table and Box Styling --- */

/* Pastel Value Box Overrides */
.small-box.bg-danger {
    background-color: #ffe6e6 !important; 
    color: #b30000 !important;
}
.small-box.bg-success {
    background-color: #e6fffa !important; 
    color: #006644 !important;
}
.small-box.bg-warning {
    background-color: #fff9db !important; 
    color: #856404 !important;
}

/* Fix icon color in value boxes */
.small-box.bg-danger .icon i, 
.small-box.bg-success .icon i, 
.small-box.bg-warning .icon i {
    color: rgba(0,0,0, 0.15) !important;
}

/* Table Styling */
.clean-table {
    border-collapse: collapse !important;
    font-family: 'Inter', 'Segoe UI', sans-serif;
}

.clean-table thead th {
    background-color: #ffffff;
    color: #8898aa;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid #dee2e6 !important;
    padding-bottom: 15px !important;
}

.clean-table tbody td {
    vertical-align: middle !important;
    padding: 12px 10px !important;
    border-bottom: 1px solid #f8f9fa;
    font-size: 14px;
    color: #333;
}

.mono-num {
    font-family: 'Roboto Mono', monospace;
    color: #525f7f;
    font-weight: 500;
}

/* Status Badges */
.badge-divergent {
    background-color: #ffe6e6;
    color: #cc0000;
    padding: 5px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    display: inline-block;
    min-width: 80px;
    text-align: center;
}

.badge-aligned {
    background-color: #e6fffa;
    color: #007a5e;
    padding: 5px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    display: inline-block;
    min-width: 80px;
    text-align: center;
}

/* Force the footer text (the bottom text) to be black */
.small-box .small-box-footer {
    color: #40403f !important;
    font-weight: 600; /* Optional: makes it slightly easier to read */
}