/* manual.css */

/* Modify main pane to accommodate toolbar */
.main-content {
  padding: 0px 16px 10px !important;
}

/* Toolbar layout */
.filter-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px 40px;
  padding: 8px 8px;
  flex-wrap: wrap;
}

.filter-toolbar,
.nacres-header-container {
  flex: 0 0 auto;
}

/* Compact button */
.reset-btn {
  background: none;
  border: 1px solid #aaa;
  padding: 5px 9px;
  cursor: pointer;
  font-size: 13px;
  border-radius: 4px;
}
.reset-btn:hover {
  background-color: #f5f5f5;
}

.result-count {
  font-size: 13px;
  color: #555;
}

/* Table structure with fixed layout */
.fixed-header,
.scrollable-body {
  border-collapse: collapse;
  width: 100%;
  table-layout: fixed;
}

/* Column widths — shared between header and body */
.fixed-header th:nth-child(1),
.scrollable-body td:nth-child(1) {
  width: 8%;
}
.fixed-header th:nth-child(2),
.scrollable-body td:nth-child(2) {
  width: 40%;
}
.fixed-header th:nth-child(3),
.scrollable-body td:nth-child(3) {
  width: 20%;
}
.fixed-header th:nth-child(4),
.scrollable-body td:nth-child(4) {
  width: 20%;
}
.fixed-header th:nth-child(5),
.scrollable-body td:nth-child(5) {
  width: 12%;
}

/* Cell appearance */
.fixed-header th,
.scrollable-body td {
  border: 1px solid #ccc;
  padding: 8px;
  text-align: left;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-sizing: border-box;
}

/* Table containers */
.nacres-table-container {
  flex: 1;
  overflow-y: auto;
  border: 1px solid #ccc;
  background: white;
}

.nacres-header-container {
  overflow-y: scroll;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-right: 0px; /* Can tweak to shift header table alignment relative to data table */
}
.nacres-header-container::-webkit-scrollbar {
  width: 0px;
  background: transparent;
}

/* Header background and table fixes */
.fixed-header {
  background: #eaeed5;
  margin: 0;
  padding: 0;
}
.fixed-header input,
.fixed-header select {
  width: 100%;
  box-sizing: border-box;
  font-size: 13px;
  padding: 4px;
}

/* WebKit scrollbar */
.nacres-table-container::-webkit-scrollbar {
  width: 8px;
}
.nacres-table-container::-webkit-scrollbar-thumb {
  background-color: #ccc;
  border-radius: 4px;
}

/* "Changes only" toggle: same shape as the reset button, filled when active */
.toggle-btn {
  background: #fff;
  border: 1px solid #aaa;
  padding: 5px 10px;
  cursor: pointer;
  font-size: 13px;
  border-radius: 4px;
}
.toggle-btn:hover {
  background-color: #f5f5f5;
}
.toggle-btn.active {
  background: #2c3e50;
  border-color: #2c3e50;
  color: #fff;
}
.toggle-btn[hidden] {
  display: none;
}

/* Retired and removed codes */
.row-retired td {
  color: #888;
}
.row-removed td {
  color: #999;
  text-decoration: line-through;
}
.row-previous {
  font-size: 12px;
  color: #7a5a00;
  margin-top: 2px;
  font-style: italic;
}

/* Examples: a collapsed "Examples (n)" link under the description */
.row-examples {
  font-size: 12px;
  color: #4a5a6a;
  margin-top: 3px;
}
.row-examples summary {
  width: fit-content;
  cursor: pointer;
  color: #2c6e9b;
  list-style: none;
  user-select: none;
}
.row-examples summary::-webkit-details-marker {
  display: none;
}
.row-examples summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 4px;
  transition: transform 0.15s;
}
.row-examples[open] summary::before {
  transform: rotate(90deg);
}
.row-examples summary:hover {
  text-decoration: underline;
}
.row-examples summary:focus-visible {
  outline: 2px solid #4f7cff;
  outline-offset: 2px;
  border-radius: 2px;
}
.row-examples-list {
  margin: 3px 0 2px;
  padding-left: 18px;
}
.row-examples-list li {
  margin: 1px 0;
}

/* Plain-language description under each official title */
.row-desc {
  font-size: 12px;
  color: #666;
  margin-top: 2px;
}

/* Wrap long text in table cells */
.scrollable-body td {
  white-space: normal !important;
  word-wrap: break-word;
}

/* MOBILE VIEW: < 601px */
@media (max-width: 600px) {

  body {
    padding: 2px;
  }

  .filter-toolbar {
    justify-content: space-evenly;
    padding: 8px;
    gap: 20px;
  }

  .reset-btn {
    font-size: 0; /* hides the original label */
    padding: 6px 10px;
    height: 36px;
    background-color: #f2f2f2;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .reset-btn::before {
    content: "🔄";
    font-size: 16px;
    line-height: 1;
  }

  /* Hide columns 3, 4, and 5 in both tables */
  .fixed-header th:nth-child(3),
  .fixed-header th:nth-child(4),
  .fixed-header th:nth-child(5),
  .nacres-table td:nth-child(3),
  .nacres-table td:nth-child(4),
  .nacres-table td:nth-child(5) {
    display: none;
  }

  /* COLUMN 1: fixed width, no wrap */
  .fixed-header th:nth-child(1),
  .nacres-table td:nth-child(1) {
    width: 58px;
    min-width: 58px;
    max-width: 58px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* COLUMN 2: fills remaining width */
  .fixed-header th:nth-child(2),
  .nacres-table td:nth-child(2) {
    width: auto;
    white-space: normal;
  }
}
