﻿body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-family: Verdana, Geneva, Tahoma, sans-serif;
  font-size: 0.8rem;
}

#tableContainer {
  height: 600px;
  overflow-y: auto;
  border: 1px solid #ddd;
  margin-top: 20px;
}

table {
  display: table;
  width: auto;
  border-collapse: collapse;
  table-layout: fixed;
}
th,
td {
  border: 1px solid #ddd;
  padding: 8px;
  text-align: left;
}

/* First and last columns centered */
td:first-child,
td:last-child {
  text-align: center;
}

/* 5th column (index 4) right aligned - Date Viewed */
td:nth-child(5) {
  text-align: right;
}

/* Table body font size */
tbody td {
  font-size: 12px;
}

/* Column widths - accounting for padding and borders */
td:nth-child(1),
th:nth-child(1) {
  width: 43px;
  min-width: 43px;
  max-width: 43px;
}

td:nth-child(2),
th:nth-child(2),
td:nth-child(3),
th:nth-child(3),
td:nth-child(4),
th:nth-child(4),
td:nth-child(5),
th:nth-child(5),
td:nth-child(6),
th:nth-child(6) {
  width: 163px;
  min-width: 163px;
  max-width: 163px;
}

th {
  background-color: #f2f2f2;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 10;
}
tr:nth-child(even) {
  background-color: #f9f9f9;
}
tr:hover {
  background-color: #e2e2e2;
}
h1 {
  text-align: center;
}
h3 {
  text-align: center;
  display: block;
}

a {
  text-decoration: none;
  color: black;
  background-color: bisque;
  padding: 2px 4px;
  cursor: pointer;
  border: 1px solid rgb(136, 54, 10);
  border-radius: 8px;
}

a:visited {
  color: black;
}

a:hover {
  background-color: black;
  color: bisque;
  border: 2px solid red;
  border-radius: 8px;
}

img {
  height: 20px;
  cursor: pointer;
}

img:hover {
  border: 4px solid red;
  border-radius: 8px;
}

/* Print styles - only show table container */
@media print {
  body * {
    visibility: hidden;
  }

  #tableContainer,
  #tableContainer * {
    visibility: visible;
  }

  #tableContainer {
    position: absolute;
    left: 0;
    top: 0;
    height: auto !important;
    overflow: visible !important;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
  }

  /* Hide interactive elements in print */
  #tableContainer img,
  #aLinkAddNew,
  th:last-child,
  td:last-child {
    display: none !important;
  }

  /* Clean up table for print */
  table {
    width: 100% !important;
    page-break-inside: avoid;
    margin-top: 20px;
  }

  /* Clean up heading for print */
  #tableContainer h2 {
    text-align: center !important;
    display: block !important;
    margin-bottom: 20px;
    page-break-after: avoid;
  }

  th {
    border: 3px solid black;
    padding: 8px !important;
  }

  td {
    page-break-inside: avoid;
    border: 1px solid #000 !important;
    padding: 8px !important;
  }

  /* Adjust column widths for print without Save/Delete column */
  td:nth-child(1),
  th:nth-child(1) {
    width: 10% !important;
  }

  td:nth-child(2),
  th:nth-child(2),
  td:nth-child(3),
  th:nth-child(3),
  td:nth-child(4),
  th:nth-child(4),
  td:nth-child(5),
  th:nth-child(5) {
    width: 22.5% !important;
  }
}

h2 {
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
}

#aLinkAddNew {
  font-size: 0.75rem;
}

#aLinkPrint {
  padding: 4px 6px;
  cursor: pointer;
  font-size: 0.5rem;
}

#aLinkPrint:hover {
  border: 2px solid red;
  border-radius: 8px;
}
