.left_aligned {
    text-align: left
}

.wrapper {
    display: flex;
    height: 50vh;
    width: 100%;
}

.table-wrapper {
    overflow-x: scroll;
    width: 100%;
    border: 1px solid green;
}

table {
 border-collapse: collapse;
 --table-border-width: 1px;
}
th.rotate {
  white-space: nowrap;
  position: relative;
  height: 250px;
}
th.rotate > div {
  /* place div at bottom left of the th parent */
  position: absolute;
  bottom: 0;
  left: 0;
  /* Make sure short labels still meet the corner of the parent otherwise you'll get a gap */
  text-align: left;
  /* Move the top left corner of the span's bottom-border to line up with the top left corner of the td's border-right border so that the border corners are matched
   * Rotate 315 (-45) degrees about matched border corners */
  transform:
    translate(calc(100% - var(--table-border-width) / 2), var(--table-border-width))
    rotate(270deg);
  transform-origin: 0% calc(100% - var(--table-border-width));
  width: 100%;
}
th.rotate > div > span {
  /* make sure the bottom of the span is matched up with the bottom of the parent div */
  position: absolute;
  bottom: 0;
  left: 0;
}

td {
  /* make sure this is at least as wide as sqrt(2) * height of the tallest letter in your font or the headers will overlap each other*/
  min-width: 30px;
  padding-top: 2px;
  padding-left: 5px;
}

.table-row-header {
  background: #fff;
  text-align: left;
}



/* Sticky header rows */
.table-fixed-header thead th {
    position: sticky;
    z-index: 3;
}

.pathology-white {
    background: #fff;
}

.pathology-gray {
    background: #f2f2f2;
}

/*
.pathology-gray input[type="checkbox"] {
    opacity: 0.6;
}
*/


/* First header row */
.table-fixed-header thead tr:first-child th {
    top: 0;
    z-index: 4;
}

/* Second header row */
.table-fixed-header thead tr:nth-child(2) th {
    top: 3rem;                /* must match height of first row */
    z-index: 3;
}

/* Sticky first column (header + body) */
.table-fixed-header th:first-child,
.table-fixed-header td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
}

.table-section-header {
    background-color: #e9ecef;
    font-size: 0.95rem;
    letter-spacing: 0.05em;
    border-top: 2px solid #ccc;
}

.table-section-header-title {
    text-align: right;
    position: sticky;
    left: 0;
    z-index: 2;
    border-right: 2px solid #ccc;
}


/* Top-left corner (highest priority) */
.table-fixed-header thead tr:first-child th:first-child {
    z-index: 6;
    background: #fff;
}

/* Optional styling */
.table-fixed-header th,
.table-fixed-header td {
    white-space: nowrap;
}

.htmx-indicator {
    display: none;
}

.htmx-request.htmx-indicator {
    display: inline;
}

.htmx-error {
    display: none;
    color: red;
    margin-left: 4px;
}

.column-toggle {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

#group-type-filter {
    margin-bottom: 1rem;
}

.group-indent {
    display: inline-block;
}

.group-indent.level-1 { margin-left: 1rem; }
.group-indent.level-2 { margin-left: 2rem; }
.group-indent.level-3 { margin-left: 3rem; }

.group-child td:first-child {
    color: #555;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    margin-right: 10px;
    text-decoration: none;
    border-radius: 5px;
    color: white;
}
.btn-primary { background-color: #007bff; }
.btn-success { background-color: #28a745; }

/* The actual spinning animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff; /* The "spinning" part */
    animation: spin 1s ease-in-out infinite;
    margin-left: 10px;
    vertical-align: middle;
}

/* Optional: change button appearance when loading */
.btn-loading {
    pointer-events: none; /* Prevent double clicks */
    opacity: 0.8;
}

/* Container needs to be relative so tooltip can be absolute */
.tooltip-container {
  position: relative;
  display: inline-block;
  cursor: pointer;
}

/* Creating the tooltip box using ::after */
.tooltip-container::after {
  content: attr(data-tooltip); /* Pulls text from the data-tooltip attribute */
  position: absolute;
  top: 175%; /* Position below the text */
  left: 50%;
  transform: translateX(-50%);
  background-color: #333;
  color: #fff;
  padding: 5px 10px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s;
}

/* Show the tooltip on hover */
.tooltip-container:hover::after {
  opacity: 1;
  visibility: visible;
}