/* ================= 基本 table 樣式 ================= */
.custom-table {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
    table-layout: fixed; /* 關鍵：允許欄位被擠壓 */
}

.custom-table th,
.custom-table td {
    border: 1px solid gray;
    padding: 8px;
    box-sizing: border-box;
}

.custom-table th {
    font-weight: bold;
}

/* ================= 搜尋區塊 ================= */
#search > * {
    max-width: 100%;
    box-sizing: border-box;
}

/* ================= RNA / RNA Type：不換行，可擠壓 ================= */
.custom-table th:nth-child(1),
.custom-table td:nth-child(1),
.custom-table th:nth-child(2),
.custom-table td:nth-child(2) {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ================= IP Enriched / Mutant Depleted：允許換行 ================= */
/* 外層 td */
.custom-table th:nth-child(3),
.custom-table td:nth-child(3),
.custom-table th:nth-child(4),
.custom-table td:nth-child(4) {
    white-space: normal !important; /* 覆蓋 DataTables nowrap */
    word-break: break-word;
    overflow-wrap: anywhere;
    overflow: hidden; /* 防止內容撐破格線 */
}

/* 內層小 table（Dataset1 / Dataset2） */
.custom-table td:nth-child(3) table,
.custom-table td:nth-child(4) table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}

.custom-table td:nth-child(3) table td,
.custom-table td:nth-child(4) table td {
    white-space: normal !important;
    word-break: break-word;
    overflow-wrap: anywhere;
    text-align: left; /* 內容較好讀 */
}

/* ================= Evidence / Details：不換行 ================= */
.custom-table th:nth-child(5),
.custom-table td:nth-child(5),
.custom-table th:nth-child(6),
.custom-table td:nth-child(6) {
    white-space: nowrap;
    text-align: center;
}

/* 按鈕本身不換行 */
.custom-table td:nth-child(5) a,
.custom-table td:nth-child(6) a {
    display: inline-block;
    white-space: nowrap;
}

/* 保留最小寬度，避免被擠到變形 */
.custom-table th:nth-child(5),
.custom-table td:nth-child(5),
.custom-table th:nth-child(6),
.custom-table td:nth-child(6) {
    min-width: 150px;
}

/* ================= 強制覆蓋 DataTables 的 nowrap ================= */
table.dataTable td,
table.dataTable th {
    white-space: inherit;
}

/* ================= SweetAlert2 ================= */
.my-swal-popup {
    width: 500px !important;
    font-size: 1.2rem !important;
}

.my-swal-title {
    font-size: 3rem !important;
    font-weight: bold;
}

.my-swal-text {
    font-size: 2rem !important;
}

/* ================= 其他 ================= */
.highlight-true {
    color: red;
    font-weight: bold;
}

#gene_id::placeholder {
    color: #ccc;
    opacity: 1;
}

/* ================= 防止任何 DataTables 表格超出 card ================= */

/* 外層 card / row 容器允許縮小 */
.card,
.row,
.col-md-11 {
  min-width: 0;
}

/* DataTables wrapper 一律不准超出容器 */
.dataTables_wrapper {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto;            /* 若真的太寬就水平捲動，而不是溢出卡片 */
  -webkit-overflow-scrolling: touch;
}

/* 表格本體一律吃滿容器，且不准撐破 */
table.dataTable,
table.dataTable.custom-table,
.custom-table {
  width: 100% !important;
  max-width: 100% !important;
}

/* DataTables 有時會給 table 加 min-width 或 inline width，這裡強制允許它縮 */
table.dataTable {
  min-width: 0 !important;
}

/* 可選：讓 Evidence/Details 的 min-width 不會把整張表撐爆（只在小螢幕特別重要） */
@media (max-width: 1200px) {
  .custom-table th:nth-child(5),
  .custom-table td:nth-child(5),
  .custom-table th:nth-child(6),
  .custom-table td:nth-child(6) {
    min-width: 120px; /* 原本 150 可能會把窄卡片撐爆，視覺上像「超出去」 */
  }
}

/* ===== sRNA tabs: make active tab obvious ===== */
.srna-tabs {
  gap: 10px;                 /* tabs 之間有距離，更像按鈕 */
  border-bottom: 0 !important;
  padding: 6px 6px 0 6px;
}

.srna-tabs .nav-item {
  margin-bottom: 0;
}

.srna-tabs .nav-link {
  border: 1px solid rgba(0,0,0,.12) !important;
  border-bottom: 0 !important; 
  padding: 10px 16px !important;
  font-weight: 600;
  letter-spacing: .2px;
  background: rgba(0,0,0,.03); 
  color: rgba(0,0,0,.72) !important;
  transition: transform .12s ease, background-color .12s ease, box-shadow .12s ease;
}

.srna-tabs .nav-link:hover {
  background: rgba(0,123,255,.08);  
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0,0,0,.06);
}

/* Active: 更明顯的底色 + 上方小陰影 + 下方白色貼住內容 */
.srna-tabs .nav-link.active,
.srna-tabs .nav-item.show .nav-link {
  background: #0d6efd !important;  
  color: #fff !important;
  border-color: rgba(13,110,253,.55) !important;
  box-shadow: 0 10px 20px rgba(13,110,253,.18);
  position: relative;
}

.srna-tabs .nav-link.active::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 0px;
  height: 3px;                          /* active 下緣強調線 */
  background: #fff;
  border-radius: 2px;
}

/* 卡片 header 內也看起來更像分頁列 */
.card-header.bg-white {
  border-bottom: 1px solid rgba(0,0,0,.08);
}

/* 小螢幕：字稍微縮小避免擠 */
@media (max-width: 576px) {
  .srna-tabs .nav-link {
    padding: 8px 10px !important;
    font-size: 0.95rem;
  }
}

/* ===== Sense / Anti-sense toggle ===== */
.srna-strand-toggle .btn {
  font-weight: 700;
  font-size: 1.5rem;        /* 字體放大（原本約 1rem） */
  padding: 12px 36px;        /* ↑高度、←→ 寬度都加大 */
  min-width: 160px;          /* 確保每顆按鈕夠寬、視覺一致 */
}

.srna-strand-toggle .btn-check:checked + .btn {
  box-shadow: 0 10px 22px rgba(13,110,253,.22); /* 稍微加強選中感 */
}

.tooltip-label {
  cursor: help;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}

.tooltip-label:hover {
  text-decoration-style: solid;
}

.tooltip-inner {
  font-size: 1.3rem;      /* 原本大約是 0.875rem */
  line-height: 1.4;
  max-width: 320px;       /* 避免長 citation 被擠成一行 */
}

/* radio + label 讓它像一整列 */
.mode-row{
  display:flex;
  align-items:flex-start;
  gap:10px;
}

.mode-radio{
  margin-top: 3px; /* 讓圓點對齊標題第一行 */
  flex: 0 0 auto;
}

.mode-label{
  cursor:pointer;
  user-select:none;
  margin:0;
  line-height:1.25;
}

.mode-title{
  font-weight:700;
  font-size:2rem;
}

.mode-sub{
  font-weight:600;
  margin-top:2px;
  font-size:2rem;
}

.mode-desc{
  margin-top:6px;
  font-size:1.7rem;
}

.example-list{
  margin-top:6px;
  font-size:1.75rem;
}

/* inactive 視覺 */
/* .example-panel.is-inactive{
  opacity:0.35;
  filter:grayscale(1);
} */

/* inactive 內容不能互動（包含 example list 的 <a>） */
.example-panel.is-inactive a,
.example-panel.is-inactive button,
.example-panel.is-inactive [role="button"]{
  pointer-events:none !important;
  cursor:default !important;
  text-decoration:none !important;
}

/* 也禁止鍵盤 tab 進去 */
.example-panel.is-inactive a{
  outline:none;
}

#geneDataTable thead th {
    text-align: center;       /* 水平置中 */
    vertical-align: middle;   /* 垂直置中 */
}

/* ================= Autocomplete ================= */
.autocomplete {
  position: relative;
}

.autocomplete-list {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  width: 100%;
  max-height: 300px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #ced4da;
  border-top: none;
  border-radius: 0 0 8px 8px;
  z-index: 9999;
  display: none;
  text-align: left;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

.autocomplete-item {
  padding: 10px 14px;
  font-size: 1.15rem;
  cursor: pointer;
  border-bottom: 1px solid #eeeeee;
}

.autocomplete-item:hover,
.autocomplete-item.active {
  background-color: #e9f5ff;
}

.autocomplete-value {
  font-weight: 600;
  color: #222;
}

.autocomplete-type {
  color: #666;
  font-size: 0.95rem;
  margin-left: 8px;
}