body {
    font-family: Arial, sans-serif;
    margin: 25px;
    background-color: #808080;
    color: #333333;
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}
body.high-contrast {
    background-color: #ffffff;
    color: #000000;
    border-color: #000000;
}
h1, h2 {
    color: #005566;
    font-weight: bold;
}
.section {
    margin-bottom: 30px;
    padding: 15px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
label {
    font-size: 20px;
    font-weight: bold;
    margin-right: 15px;
}
input, select, textarea {
    margin: 10px 0;
    padding: 12px;
    font-size: 18px;
    border: 1px solid #cccccc;
    border-radius: 4px;
    width: calc(100% - 26px);
    max-width: 320px;
    background-color: #ffffff;
}
input[type="checkbox"] {
    width: auto;
    vertical-align: middle;
}
button {
    padding: 12px 24px;
    font-size: 18px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin: 5px;
    transition: background-color 0.2s;
}
button:hover {
    filter: brightness(1.1);
}
button:active {
    filter: brightness(0.9);
}
.in-button { background-color: #28a745; } /* IN */
.out-button { background-color: #007bff; } /* OUT */
.dnf-button { background-color: #dc3545; } /* DNF */
.note-button { background-color: #ffc107; } /* NOTE */
.change-distance-button { background-color: #17a2b8; } /* Change Distance */
.increment-button { background-color: #6c757d; } /* Increment */
.add-general-comment-button { background-color: #17a2b8; } /* Add General Comment */
.view-hide-bib-log-button { background-color: #17a2b8; } /* View/Hide Bib Log */
.export-csv-button { background-color: #28a745; } /* Export CSV */
.copy-winlink-button { background-color: #17a2b8; } /* Copy for Winlink */
.save-data-button { background-color: #28a745; } /* Save Data */
.load-data-button { background-color: #28a745; } /* Load Data */
.import-csv-button { background-color: #28a745; } /* Import CSV */
.import-bib-list-button { background-color: #28a745; } /* Import Bib List */
.view-hide-message-log-button { background-color: #17a2b8; } /* View/Hide Message Log */
#clearLogButton { background-color: #dc3545; } /* Clear Bib Log */
#updateButton { background-color: #17a2b8; } /* Update Entry */
#cancelEditButton { background-color: #6c757d; } /* Cancel Edit */
.edit-button { background-color: #6c757d; font-size: 16px; padding: 5px 10px; }
#distancePopup button { background-color: #17a2b8; margin: 5px; }
#resetNewestButton { background-color: #17a2b8; }
#syncButton { background-color: #17a2b8; }
table {
    border-collapse: collapse;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    display: block;
    margin-top: 10px;
    background-color: #ffffff;
}
#bibTable, #messageLogTable {
    max-height: 400px;
    overflow-y: auto;
    overflow-x: auto;
}
th, td {
    border: 1px solid #cccccc;
    padding: 12px;
    text-align: left;
    font-size: 18px;
}
th {
    background-color: #f2f2f2;
    position: sticky;
    top: 0;
    font-weight: bold;
    cursor: pointer;
}
th:hover {
    background-color: #e0e0e0;
}
tr:nth-child(even) {
    background-color: #f9f9f9;
}
#bibInfoTable {
    margin-top: 10px;
    max-width: 600px;
}
#logSearch {
    width: calc(100% - 26px);
    max-width: 400px;
    margin-bottom: 10px;
}
#distancePopup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #ffffff;
    padding: 20px;
    border: 1px solid #cccccc;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    display: none;
    z-index: 1000;
    max-width: 90%;
}
#distancePopup select {
    width: 100%;
    margin-bottom: 10px;
}
@media (max-width: 600px) {
    input, select, textarea {
        width: calc(100% - 26px);
    }
    button {
        width: 100%;
        margin: 8px 0;
    }
    table {
        font-size: 16px;
    }
}

/* Added scrollable table style
#bibLogWrapper {
  overflow-x: auto; /* Horizontal scroll for wide table */
}
#bibLogTable {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed; /* Fixed layout for alignment */
}
#bibLogTable thead {
  display: table;
  width: 100%;
  table-layout: fixed;
}
#bibLogTable tbody {
  display: block;
  max-height: 730px; /* Vertical scroll for ~15 entries */
  overflow-y: scroll;
}
#bibLogTable tr {
  display: table;
  width: 100%;
  table-layout: fixed;
}
th, td {
  border: 1px solid #ccc;
  padding: 8px;
  text-align: left;
  min-width: 100px; /* Minimum column width to prevent squishing; adjust as needed */
}
th {
  background-color: #f2f2f2;
  position: sticky;
  top: 0;
  z-index: 1; /* Keep headers on top when scrolling */
  cursor: pointer; /* For sortable */
}
@media (max-width: 600px) {
  th, td {
    min-width: 80px; /* Smaller on mobile */
  }
}
