* {
    margin: 0;
    padding: 0;

    box-sizing: border-box;
    font-family: sans-serif;
}

/* Mindestbreite für den Viewport */
html, body {
  min-width: 400px;
  overflow-x: auto;
}

body > * {
  min-width: 400px;
}


/*Spezifikationen für den Druck der Website*/
@media print {
    .table, .table__body {
     overflow: visible;
     height: auto !important;
     width: auto !important;
    }
   }
   
@page {
    size: landscape;
    margin: 0; 
}

.custom-background {
    min-height: 100vh;
    background: url('images/UR_Ansicht_See.jpg') center / cover no-repeat, #f0f0f0;
    display: flex;
    justify-content: center;
    align-items: center;
}

main.table {
    width: 82vw;
    height: 90vh;
    background-color: #fff5;

    backdrop-filter: blur(7px);
    box-shadow: 0 .4rem .8rem #0005;
    border-radius: .8rem;

    overflow: hidden;
}

.table-header-container {
    width: 100%;
    height: 10%;
    background-color: #fff4;
    padding: .8rem 1rem;

    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

/* Linker Bereich: Home-Button + Tabellenname */
.table-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

@media screen and (max-width: 750px) {
    .table-header-left h1 {
        display: none;
    }
}

/* Home-Button */
.home-btn .home-icon {
    width: 2rem;
    height: 2rem;
    fill: #333;
}

/* Standortüberprüfungsbutton: zentriert */
.btn-location-check {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 10px 15px;
    font-size: 18px;
    font-weight: bold;
    background-color: #fff;
    color: #333;
    border: 2px solid #333;
    border-radius: 10px;
    cursor: pointer;
}

/* Rechter Bereich: CSV-Button */
.button-group {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
    height: 100%;
}

.csv-btn {
    position: absolute;
    top: 50%;
    right: 3%;
    transform: translateY(-50%);
    padding: 10px 15px;
    font-size: 18px;
    font-weight: bold;
    background-color: #fff;
    color: #333;
    border: 2px solid #333;
    border-radius: 10px;
    cursor: pointer;
}

.csv-btn:hover,
.btn-location-check:hover {
    background-color: #e0e0e0;
}

.modal {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background-color: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
}

.modal-content {
  position: relative;
  background: white;
  padding: 2rem;
  border-radius: 1rem;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 .4rem .8rem #0005;
}

.modal-content h2 {
    text-align: center;
    margin-bottom: 1rem;
}

.modal-close {
  position: absolute;
  top: 0.5rem;
  right: 1rem;
  font-size: 2rem;
  font-weight: bold;
  color: #d9534f;
  cursor: pointer;
  z-index: 1001;
  transition: color 0.2s ease;
  user-select: none;
}

.modal-close:hover {
  color: #c9302c;
}

.search-bar {
    height: 30px;
    border: 2px solid #333;
    width: 100%;
    padding: 0 8px;
    margin-bottom: 0.9rem;
    border-radius: 6px;
}

.form-check {
    margin-bottom: 1.3rem;
}

.comment {
    height: 70px;
    border: 2px solid #333;
    width: 100%;
    padding: 6px 8px;
    margin-bottom: 0.9rem;
    border-radius: 6px;
}

/* Blaue Umrandung der Textboxen unterbinden */
.search-bar:focus {
    outline: none;
    box-shadow: none;
    border-color: #333;
}

.comment:focus {
    outline: none;
    box-shadow: none;
    border-color: #333;
}

.custom-checkbox {
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.custom-checkbox input[type="checkbox"] {
  display: none; /* Versteckt das native Kontrollkästchen */
}

.checkmark {
  width: 20px;
  height: 20px;
  border: 2px solid black;
  border-radius: 4px;
  background-color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.5rem;
  transition: background-color 0.2s ease;
}

.check-icon {
  width: 14px;
  height: 14px;
  stroke: black;
  stroke-width: 3;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: none;
}

input[type="checkbox"]:checked + .checkmark .check-icon {
  display: block;
}


.modal-button {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

.modal-button button {
  padding: 0.7rem 1rem;
  border: none;
  border-radius: 6px;
  background-color: #008B6A;
  color: white;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.3s ease;
  font-size: 0.9rem;
}

.modal-button button:hover {
  background-color: #006a50;
}

.table_body {
    position: relative;
    width: 95%;
    max-height: calc(89% - 1.6rem);
    background-color: #fffb;

    margin: 0.8rem auto;
    border-radius: 0.6rem;

    overflow: auto; /* Scrollen aktiviert */

    /* Scrollbar komplett ausblenden. Leider lässt sich keine vernünftige Lösung für Firefox finden, bei der die Scrollbar erst beim Hovern eingeblendet wird */
    scrollbar-width: none; 
}

table {
    width: 100%;
}

table, th, td {
    border-collapse: collapse;
    padding: 1rem;
    text-align: left;
}

thead th {
    position: sticky;
    top: 0;
    left: 0;
    background-color: #d5d1defe;
    cursor: pointer;
    z-index: 9998; /*Höherer z-index bewirkt, dass der Header beim Überlagern Vorrang hat (aber nur innerhalb eines Layering Kontexts 😥)*/
}

/*Styling zur Spaltenbreite*/

/*Signatur*/
td:nth-child(2),
th:nth-child(2) {
    white-space: nowrap;
}

/*Barcode*/
td:nth-child(3),
th:nth-child(3) {
    white-space: nowrap;
}

/*Titel*/
td:nth-child(4),
th:nth-child(4) {
    white-space: normal;
    overflow-wrap: normal;
    word-break: normal; 
    min-width: 25ch;
}

/*Servicestelle*/
td:nth-child(7),
th:nth-child(7) {
    white-space: normal;
    overflow-wrap: normal;
    word-break: normal; 
    max-width: 20ch;
}

/*FOLIO-ID*/
td:nth-child(8),
th:nth-child(8) {
    white-space: normal;
    overflow-wrap: normal;
    word-break: normal; 
    max-width: 20ch;
}

/*Kommentar*/
td:nth-child(9),
th:nth-child(9) {
    white-space: normal;
    overflow-wrap: normal;
    word-break: normal; 
    min-width: 20ch;
}

tbody tr:nth-child(even) {
    background-color: #0000000b;
}

tbody tr {
    --delay: .1s;
    transition: .5s ease-in-out var(--delay), background-color 0s;
}

tbody tr:hover {
    background-color: #fff6;
}

tbody tr td{
    transition: .2s ease-in-out;
}

tbody td:last-of-type,
thead th:last-of-type {
    position: sticky;
    right: 0; /* Fixiert die Zelle am rechten Rand */
    border-bottom: 2px solid transparent; /* Linie zwischen den Zeilen */
}

tbody td:nth-last-of-type(1)::before,
thead th:nth-last-of-type(1)::before {
    content: ""; /* Erzeugt ein leeres Pseudo-Element für die Linie*/
    position: absolute;
    top: 0;
    left: 0; /* Box-Shadow beginnt an der linken Linie */
    bottom: 0;
    width: 10px; /* Breite der Linie */
    background-color: transparent; /* Keine sichtbare Farbe */
    box-shadow: -4px 0 5px -2px rgba(0, 0, 0, 0.8); /* Schatten für die linke Linie */
    z-index: 9999;
}

.sticky-column {
    position: sticky;
    right: 0;
    overflow: visible;
    pointer-events: none;
    background-color: #b4afbd;
}

.bg-found {
    background-color: #d4edda !important; 
    color: #155724;             
}

.bg-found:hover {
    background-color: #c3e6cb !important;
}

.bg-lost {
    background-color: #f8d7da !important;  
    color: #721c24;             
}

.bg-lost:hover {
    background-color: #f5c6cb !important;
}

.highlight {
    background-color: #e7dc7781 !important; /* Hellgelbe Farbe für Fernleihbestellungen */
}

.highlight:hover {
    background-color: #b6a7228e !important;
}

.action-button {
    display: flex;
    justify-content: center;
    align-items: center; 
    width: 120px;
    height: 40px;
    font-size: 17px;
    font-family: sans-serif;
    color: #333;
    background-color: #e9d734;
    border: 2px solid #333;
    border-radius: 0.6rem;
    text-align: center;
    line-height: 50px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    pointer-events: auto !important; /* Aktiviert die Interaktion für den Button */
    cursor: pointer !important; /* Stellt sicher, dass der Zeiger sich ändert */
}

.action-button:hover {
    background-color: #e9e935;
}

.delete-button {
    background-color: #dc3545 !important;
    color: white;
}

.delete-button:hover {
    background-color: #c82333 !important;
}

thead th span.icon-arrow {
    display: inline-block;
    width: 1.3rem;
    height: 1.3rem;
    border-radius: 50%;
    border: 1.4px solid transparent;
    
    text-align: center;
    font-size: 1rem;
    
    margin-left: .5rem;
    transition: .2s ease-in-out;
}

td:first-child {
    position: relative;
}

.comment-icon {
    position: absolute;
    transform: translate(-50%, -50%);
    top: 15px;
    left: 15px;
    width: 27px;
    height: 27px;
    line-height: 22px; /* Steuert die vertikale Position des Stift-Symbols */
    text-align: center;
    font-size: 0.9rem;
    background: #fff;
    border-radius: 50%;
    padding: 2px 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    z-index: 10;
    pointer-events: auto;
    cursor: pointer;
    user-select: none;
}

.highlighted-row {
    background-color: #464645 !important;
    color: #ffffff !important;
    pointer-events: none !important;
}