/* Modify admin appearance
*/

/* Suppress the close button if we are not in a modal (button in modal does not have this id) */
#closeButton {
  display: none;
}

/* Hide the last column of event bookings (in the Event page) in the table if not printing */
/* MarkupAdminDataTable created in site/templates/RuntimeMarkup/Bookings.php */
@media screen {
  table.event-bookings td:last-child,
  table.event-bookings th:last-child {
    display: none !important;
  }
}

@media print {
  /* Remove headers and footers */
  @page {
    margin: 0;
  }

  body {
    margin: 1.6cm;
  }

  /* For mailings, only print the letter itself */
  /* Note that this means that emails and other page elements will not print */
  .ProcessMailings * {
    visibility: hidden;
  }

  .letter * {
    visibility: visible;
  }

  .letter {
    position: absolute;
    left: 0;
    top: 0;
    padding: 50px;
  }

  /*
  The 'event bookings' css below modifies the appearance of the MarkupAdminDataTable created in site/templates/RuntimeMarkup/Bookings.php
   */

  /* For event bookings, only print the table */
  body:has(.event-bookings) * {
    visibility: hidden; /* Hide everything by default */
    height: 0 !important; /* Ensure the body does not take up space */
  }

  table.event-bookings, table.event-bookings * {
    visibility: visible; /* Ensure the table is shown */
    height: revert !important; /* Ensure the table takes up space */
  }

  table.event-bookings {
    position: absolute;
    left: 0;
    top: 0;
    margin: 1cm;
    width: calc(100% - 2cm); /* Adjust width to account for margins */
    height: calc(100% - 2cm); /* Adjust height to account for margins */
    table-layout: auto; /* Allow the table to shrink and expand */
    border-collapse: collapse;
  }

  /* Add grid lines */
  table.event-bookings, table.event-bookings th, table.event-bookings td {
    border: 1px solid black;
  }

  /* Force width of event-only column */
  table.event-bookings .event-print-only {
    width: 20em;
  }

  /* Also hide the 4th, 8th and 9th columns in the printed view */
  table.event-bookings td:nth-child(4),
  table.event-bookings th:nth-child(4),
  table.event-bookings td:nth-child(8),
  table.event-bookings th:nth-child(8),
  table.event-bookings td:nth-child(9),
  table.event-bookings th:nth-child(9) {
    display: none !important;
  }

  /* Ensure the table footer is not repeated on each page */
  /* Hide the tfoot by default */
  table.event-bookings tfoot {
    display: none;
  }

  /* Force page breaks inside the table to separate pages */
  table.event-bookings {
    page-break-inside: auto; /* Allow page breaks inside the table */
    page-break-after: always; /* Ensure breaks after the table, except the last one */
  }

  /* Add a page break before tfoot to ensure it's on the last page */
  table.event-bookings tfoot {
    display: table-footer-group !important; /* Ensure the footer is visible at the bottom of the last page */
    page-break-before: always;
  }

}

/*
Classes for CKE
*/

.cke_combopanel__hannadropdown {
  width: 400px !important;
  min-height: 250px !important;
}

/*
Spinner
 */
.spinner {
  width: 40px;
  height: 40px;
  display: block;
  position: fixed;
  z-index: 1031; /* High z-index so it is on top of the page */
  top: 50%;
  right: 50%; /* or: left: 50%; */
  margin: 100px auto;
}

/*
Don't show repeater add button if noAddRepeater class is set
 */
.noAddRepeater .InputfieldRepeaterAddItem {
  display: none;
}