:root {
  --sidebar-width: 300px;
  --gap: 20px;
}
body { /*font-family: 'Heiti SC', sans-serif;*/ top: margin: 20px 60px; background: floralwhite; color: #333; }
h1 { text-align: center; color: #444; font-size: 28px; font-weight: bold; margin-bottom: 8px; }
label { font-size: 16px; }

/* Container: sorgt dafür, dass Sidebar bündig mit Suchfeld ist */
.container {
  /*max-width: 1200px;*/
  margin: 0 auto;
  margin-top: 7rem;
}

/* Suchleiste oben */
#searchWrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0 18px;
  justify-content: center;
}
#resultCount { font-size: 16px; color: #444; min-width: 140px; text-align: center; }

input#search {
  padding: 12px 18px; font-size: 16px; width: 60%; max-width: 600px;
  border: 1px solid #ccc; border-radius: 18px; outline: none; transition: border-color 0.2s;
}
input#search:focus { border-color: #003300; box-shadow: 0 0 8px rgba(150,120,80,0.6); }

/* Basis-Styling für den Button */
.toggleBtn {
  padding: 10px 14px;
  font-size: 15px;
  border: none;
  border-radius: 12px;
  color: #fff;
  cursor: pointer;
  transition: background-color 0.2s;
  /* Standard-Farbe (Fallback) */
  background-color: bisque;
}

/* 1. Zustand: Titel (Standard) - Braun */
.toggleBtn.mode-titel {
  background-color: bisque;
  color: #000;
}

/* 2. Zustand: Refrain - z.B. Dunkelgrün */
.toggleBtn.mode-refrain {
  background-color: saddlebrown;
  color: #fff;
}

/* 3. Zustand: Liedbeginn - z.B. Dunkelblau */
.toggleBtn.mode-liedbeginn {
  background-color: burlywood; /* navajowhite, sandybrown, peru */
  color: #000;
}

/* Filter-Toggle (mobile) */
#toggleFilters {
  display: none;
  padding: 10px 14px; font-size: 14px; border-radius: 12px; border: 1px solid gray;
  background: #fff; cursor: pointer;
}

/* Layout: Sidebar links, Inhalte rechts */
.layout { display: grid; grid-template-columns: var(--sidebar-width) 1fr; gap: var(--gap); align-items: start; width: 98%; }
.filterPanel {
  background: #fff; border-radius: 8px; box-shadow: 0 4px 8px rgba(0,0,0,0.08);
  padding: 14px; position: sticky; top: 92px; /* bündig mit Suchfeld: top entspricht Höhe header+search */
  max-height: calc(100vh - 16rem); overflow: auto;
  margin-left: 20px; /* etwas weiter links */
  /*margin-bottom: 4rem;*/
  padding-bottom: 0.5rem;
}
.filterPanel.hidden { display: none; }
.filterPanel h3 {
  margin: 6px 0; color: rgb(100,0,0); font-size: 16px;
  display: flex; align-items: center; justify-content: space-between;
}
.collapseBtn {
  cursor: pointer; font-weight: bold; width: 28px; height: 28px; border-radius: 6px;
  border: 1px solid gray; background: #fff; display: inline-flex; align-items: center; justify-content: center;
}
.filterGroup { margin-bottom: 12px; display: none; }
.filterGroup.hidden { display: none; }
.filterGroup .option { display: flex; align-items: center; justify-content: space-between; margin: 6px 0; }
.filterGroup .option label { flex: 1; font-size: 14px; }
.filterGroup .count { color: #666; margin-left: 8px; min-width: 36px; text-align: right; font-size: 13px; }

/* Tabelle & Pager */
table.groupTable { border-collapse: collapse; width: 100%; margin: 0 auto 20px; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 4px 8px rgba(0,0,0,0.06); }
table.groupTable th, table.groupTable td { padding: 10px 12px; text-align: left; font-size: 14px; }
table.groupTable th { background: bisque; color: rgb(100, 0, 0); font-size: 15px; cursor: pointer; }
table.groupTable tr:nth-child(even) { background: #fcf9f9; }
table.groupTable tr:hover { background: #eaf6f2; }

.pager { text-align: center; margin: 5px 0 10px; user-select: none; color: black; }
.pager .btn { display: inline-block; margin: 0 6px; margin-bottom: 10px; padding: 6px 10px; border-radius: 4px; border: 1px solid gray; background: #fff; cursor: pointer; min-width: 40px; min-height: 30px; }
.pager .btn.active { background: bisque; border-color: rgb(100,0,0); color: rgb(100,0,0); font-weight: bold; }
.pager .btn.disabled { opacity: 0.4; cursor: default; pointer-events: none; }

/* Modal */
.modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; display: flex; justify-content: center; align-items: center; }
.modal-content.img { max-width: 60%; max-height: 60%; border-radius: 12px; box-shadow: 0 10px 60px rgba(0,0,0,0.8); }
.modal-content.publisher { max-width: 60%; max-height: 60%; background: #fff; padding: 18px; border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,0.8); overflow-y: auto; }
.close { position: absolute; top: 24px; right: 36px; color: transparent; font-size: 36px; cursor: pointer; }
.close:hover { color: floralwhite; }


/* Styling für den Reset-Button (das x oder der Pfeil) */
.resetBtn {
    background: transparent;
    border: 1px solid gray;
    border-radius: 0.5rem;
    color: #111; /* Standardmäßig hellgrau, nicht zu aufdringlich */
    font-weight: bold;
    font-size: 1.1rem; /* Etwas größer für bessere Lesbarkeit */
    cursor: pointer;
    padding: 2px 8px; /* Wichtig: Klickfläche vergrößern */
    /*line-height: 1;*/ /* Verhindert, dass die Zeile unnötig hoch wird */
    margin-right: 0.5rem; /* Kleiner Abstand zum Minus-Button */
    transition: all 0.2s ease; /* Weicher Übergang für Farbe und Größe */
    display: none; /* Wird per JS eingeblendet */
    height: 28px;
}

/* Hover-Effekt: Rot und leicht vergrößert */
.resetBtn:hover {
    /*color: #c0392b;*/
    transform: scale(1.05); /* Leichter Zoom-Effekt */
}

/* Container für Reset-Button und Collapse-Button */
.filterPanel h3 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-right: 5px; /* Etwas Platz rechts */
    min-height: 32px; /* Verhindert Springen, wenn Buttons erscheinen */
}

.header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

/* Optional: Nur hinzufügen, wenn du den Pfeil ↺ nutzt */
.resetBtn:hover {
    /*transform: rotate(-90deg);*/
    color: #c0392b;
}

/* --- NEU HINZUGEFÜGT: LADE-ANIMATION (Loader) --- */
.loader {
    border: 4px solid #f3f3f3; /* Helles Grau */
    border-top: 4px solid saddlebrown; /* Farbe des Spinners */
    border-radius: 50%;
    width: 2.5rem;
    height: 2.5rem;
    animation: spin 1.2s /*linear*/ infinite;
    margin: 5px auto; /* Zentriert */
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Erzeugt einen großen Abstand (150px) zwischen dem Ende der Tabelle/Pager und dem Footer */
#pagerBottom {
    margin-bottom: 5rem;
}



/* Responsive: Tablet */
@media screen and (max-width: 1024px) {
  body { margin: 12px 24px; }
  :root { --sidebar-width: 260px; }
  .filterPanel { top: 84px; margin-left: -12px; }
  input#search { width: 70%; }
  table.groupTable th, table.groupTable td { padding: 10px; font-size: 13px; }
}

/* Responsive: Smartphone */
@media screen and (max-width: 950px) {
  h1 { font-size: 22px; }
  .container { padding: 0 8px; }
  .layout { grid-template-columns: 1fr; }
  .filterPanel { position: static; margin-left: 0; max-height: none; border-radius: 16px; overflow: initial;}
  #toggleFilters { display: inline-block; color: black; }
  #searchWrapper { flex-direction: column; gap: 8px; }
  input#search { width: 100%; max-width: none; }
  .pager .btn {color: black; min-width: 20px; width: 5vw; padding: 0; margin: 0 2px;}
  .toggleBtn { width: 90%; /*margin: 0 auto;*/ display: block; text-align: center; }
  table.groupTable, table.groupTable thead, table.groupTable tbody, table.groupTable th, table.groupTable td, table.groupTable tr { display: block; }
  table.groupTable thead { display: none; }
  table.groupTable tr { margin: 0.5rem; border: 1px solid #ddd; border-radius: 6px; padding: 8px; background: #fff; }
  table.groupTable td { display: flex; justify-content: space-between; padding: 6px 0; border: none; font-size: 13px; }
  body {margin: 6px 8px;}
  input#search {width: 90%; min-width: 50px; border-radius: 16px;}
}

@media screen and (min-width: 2000px) {
  h1 { font-size: 2.5rem; }
  #filterPanel h3 {font-size: 1.2rem;}
  .filterGroup .option label {font-size: 16px;}
  :root {--sidebar-width: 400px; --gap 30px;}
  .pager .btn {border-radius: 8px; min-width: 60px; min-height:35px;}
  table.groupTable th {font-size: 18px;}
  table.groupTable td {font-size: 16px;}
  #resultCount {font-size: 18px;}
  input#search {font-size: 18px;}
  .toggleBtn {font-size: 18px;}
}
