#bodyBg {
  background-image: url("../Images/KCBLibBG.png");
  background-size: cover;
}

#imgLogo {
  cursor: pointer;
  height: 60px;
}

#divImgLibDataText {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

#btnSetAdminMode {
  min-width: 120px;
}

#divDataMsg {
  display: block;
  clear: both;
}

#divDiag {
  display: none;
  clear: both;
}

#divMsg {
  display: none;
  cursor: pointer;
}

#topmenu {
  border-bottom: 2px solid silver;
  display: block;
  font-size: smaller;
}

#selExportOptions {
  display: none;
  margin-left: 8px;
  vertical-align: middle;
}

/* Performance optimization for find function */
.find-highlight {
  background-color: lightyellow !important;
}

/* Performance optimization for user mode table */
.user-mode-table td:first-child,
.user-mode-table th:first-child {
  display: none !important;
}

#divSortOptions {
  display: none;
}

#imgSortBy {
  height: 38px;
  vertical-align: middle;
}

#lblSortAsc,
#lblSortDesc {
  vertical-align: middle;
}

#divFilterOptions {
  display: none;
}

#imgFilterBy {
  height: 38px;
  vertical-align: middle;
}

#selFilterField,
#selFilterValue {
  height: 38px;
  width: 200px;
  font-size: 1.2rem;
  margin-right: 1rem;
}

#selFindField,
#txtFindValue {
  height: 38px;
  width: 160px;
  font-size: 1.2rem;
  margin-right: 1rem;
}

#selFilterValue {
  display: none;
}

#divFindOptions {
  display: none;
}

#imgFindOptionsImg {
  height: 38px;
  vertical-align: middle;
}

#btnFindPrevious,
#btnFind,
#btnFindNext {
  display: none;
}

.cancel-link {
  font-size: 10px;
  color: white;
  text-decoration: underline;
  cursor: pointer;
}

.cancel-link:hover {
  color: #ffcccc;
}

html {
  font-family: Verdana, Geneva, Tahoma, sans-serif;
  font-size: 60%;
  font-weight: 660;
  color: white;
  background-color: rgb(50, 50, 50);
  display: flex;
  justify-content: center;
  margin: 0;
}

html {
  font-family: Verdana, Geneva, Tahoma, sans-serif;
  font-size: 60%;
  font-weight: 660;
  color: white;
  background-color: rgb(50, 50, 50);
  display: flex;
  justify-content: center;
  margin: 0;
}

#aAddNew,
#aExport,
#aCancelSort,
#aCancelFilter,
#aCancelFind {
  color: #176c1a;
  background-color: #fff;
  border: 2px solid #176c1a;
  border-radius: 6px;
  font-weight: bold;
  font-size: 1.1em;
  text-decoration: none;
  display: inline-block;
  padding: 3px 12px;
  margin: 6px 8px 0 8px !important;
  vertical-align: middle;
  text-align: center;
  cursor: pointer;
  transition:
    background 0.2s,
    color 0.2s;
  height: 28px;
  line-height: 22px;
  box-sizing: border-box;
}
#aAddNew:hover,
#aExport:hover,
#aCancelSort:hover,
#aCancelFilter:hover,
#aCancelFind:hover {
  background-color: #176c1a;
  color: #fff;
  border-color: #176c1a;
  text-decoration: none;
}

#aAddNew:hover,
#aExport:hover {
  background-color: #176c1a;
  color: #fff;
  border-color: #176c1a;
  text-decoration: none;
}

#btnHome,
#btnReload {
  transition:
    background 0.2s,
    color 0.2s;
  padding: 3px;
}

#btnHome:hover,
#btnReload:hover {
  background-color: #176c1a !important;
  color: #fff !important;
  border-color: #176c1a;
}

#btnHome,
#btnReload {
  color: green;
  background-color: white;
  height: 20px;
  line-height: 20px;
  display: inline-block;
  padding: 0 16px;
  vertical-align: middle;
  text-align: center;
  margin: 0 8px;
  border-radius: 6px;
  font-weight: bold;
  font-size: 1.1em;
  text-decoration: none;
  border: 2px solid #176c1a;
  transition:
    background 0.2s,
    color 0.2s;
}
input,
select,
option,
textarea {
  background-color: #fff !important;
  color: #222 !important;
}

/* Set a specific font size for screens less than 400px wide */
@media (max-width: 400px) {
  html {
    font-size: 8.8px; /* 20% smaller than 11px */
  }
}

body {
  width: 100%;
  margin: auto;
  background-color: rgb(50, 50, 50);
  --sticky-contents-height: 0px;
  --sticky-msg-height: 0px;
  --sticky-controls-height: 0px;
}

#divContents {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: fit-content;
  max-width: calc(100% - 24px);
  height: auto;
  z-index: 70;
  background: transparent;
}

#divh2 {
  height: 98px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: black;
  color: white;
  margin: 0;
  padding: 0 12px;
  box-sizing: border-box;
  gap: 6px;
  border: 2px solid rgb(180, 180, 180);
  border-radius: 12px;
}

button {
  border: 2px solid black;
  border-radius: 8px;
  cursor: pointer;
  padding: 3px;
}

select,
input[type="text"] {
  font-family: Verdana, Geneva, Tahoma, sans-serif;
  color: black;
  background-color: white;
  border: 2px solid black;
  border-radius: 8px;
}

/* CSS styles for the top menu bar */

.top-menu {
  background: transparent;
  overflow: hidden;
  display: flex;
  justify-content: center;
  font-family: Verdana, sans-serif;
  border: none;
}

.top-menu a {
  float: none;
  color: white;
  text-align: center;
  padding: 14px 16px;
  text-decoration: none;
  font-size: 1.2rem;
  background: transparent;
}

.top-menu a:hover {
  background-color: whitesmoke;
  color: black;
}

.top-menu a.active {
  background-color: silver;
}

#divLibTable {
  display: block;
  margin: auto;
  margin-top: calc(var(--sticky-contents-height) + var(--sticky-msg-height) + var(--sticky-controls-height));
  overflow: auto;
  max-height: calc(
    100vh - (var(--sticky-contents-height) + var(--sticky-msg-height) + var(--sticky-controls-height)) - 12px
  );
}

#tblLib th {
  position: sticky;
  top: 0;
  z-index: 30;
  background-color: rgb(50, 50, 50);
  color: white;
}

table {
  font-family: Verdana, Geneva, Tahoma, sans-serif;
  border-collapse: collapse;
  width: 100%; /* Use 100% so it shrinks and grows with the window */
  min-width: 300px; /* Minimum width the table will shrink to */
  max-width: 800px; /* Maximum width the table will grow to */
  margin: auto;
}

tr {
  background-color: white;
  color: #222;
}

th,
td {
  white-space: normal; /* Allows the text to wrap to the next line */
  overflow-wrap: break-word; /* Breaks the word at the end of the line */
  text-align: left;
  padding: 8px;
}

tr:nth-child(even) {
  background-color: #f2f2f2;
}

tr:nth-child(odd) {
  background-color: #d9d9d9;
  color: black;
  align-items: center;
  margin: 0 auto;
  border-collapse: collapse;
}

table input {
  font-weight: 660;
  width: fit-content;
  max-width: 150px;
  min-width: 40px;
}

table button {
  margin-left: 0.8rem;
  margin-right: 0.8rem;
}

#imgLogo {
  position: fixed;
  top: 0;
  left: 0;
  float: none;
  margin: 0;
  padding: 0;
  transform: none;
  z-index: 60;
}

.filter-options,
.sort-options,
.find-options {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: auto;
  padding: 12px 0 24px 0;
  vertical-align: middle;
  width: fit-content;
}

#divSortOptions,
#divFilterOptions,
#divFindOptions {
  background-color: transparent;
}

#divStickyControls {
  position: fixed;
  top: calc(var(--sticky-contents-height) + var(--sticky-msg-height));
  left: 0;
  right: 0;
  z-index: 90;
  background: transparent;
}

#divMsg {
  display: flex;
  position: fixed;
  top: 50%;
  left: 50%;
  right: auto;
  transform: translate(-50%, -50%);
  z-index: 80;
  justify-content: center;
  align-items: center;
  text-align: center;
  background-color: black;
  border: 2px solid silver;
  border-radius: 12px;
  min-width: 280px;
  max-width: min(80vw, 900px);
  padding: 12px;
}

#divFilterOptions span,
#divSortOptions span {
  padding: 4px;
  border: 2px dotted white;
  border-radius: 6px;
  margin: 0 0.5rem;
}

#divDataMsg {
  padding: 12px;
}

/* --- PRINT STYLES --- */
@media print {
  body * {
    display: none !important;
  }
  #tblLib,
  #tblLib * {
    display: revert !important;
    visibility: visible !important;
    color: black !important;
  }
  #divLibTable {
    display: block !important;
    position: static !important;
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
    visibility: visible !important;
  }
  #tblLib {
    position: static !important;
    width: 100% !important;
    max-width: 100% !important;
    background: white !important;
    color: black !important;
    box-shadow: none !important;
    border: 1px solid #222 !important;
  }
}
