/* ---------- GRUNDSTIL ---------- */
body {
  font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', sans-serif;
  background-color: #f8f8f8;
  margin: 0;
  padding: 0;
  color: #1a1a1a;
}

.container {
  max-width: 960px;
  margin: 40px auto;
  padding: 20px 100px;
  background-color: #ffffff;
  border-radius: 8px;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.05);
  position: relative;
  z-index: 1;
}

/* ---------- BILD ---------- */
.image-center {
  text-align: center;
  margin-bottom: 20px;
}

.image-center img {
  max-width: 100%;
  height: auto;
  border-radius: 5px;
}

/* ---------- META-DATEN ---------- */
.meta-group {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 15px;
}

.meta-group input {
  height: 24px;
  font-size: 14px;
  padding: 2px 5px;
  margin-left: 6px;
  border-radius: 4px;
  border: 1px solid #ccc;
}

#dpi {
  width: 60px;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 15px;
}

.meta-row input {
  height: 24px;
  font-size: 14px;
  padding: 2px 5px;
  margin-left: 6px;
  border-radius: 4px;
  border: 1px solid #ccc;
}

.meta-double {
  gap: 40px;
}

.meta-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.meta-block.left-align > div {
  justify-content: flex-start;
}

.meta-block.left-align > div strong {
  text-align: left;
  margin-right: 6px;
}


/* neue Blockstruktur für rechtsbündige Beschriftung */
.meta-block > div {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.meta-block > div strong {
  min-width: 90px;
  text-align: right;
  margin-right: 8px;
}

.meta-block input {
  flex: 1;
  max-width: 240px;
}

.meta-row.top-line > div {
  min-width: 180px;
  flex: 1;
}

.meta-row.middle-line {
  display: flex;
  justify-content: space-between;
  gap: 40px;
}

.meta-pair {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 300px;
  flex: 1;
}

.meta-pair input {
  width: 100%;
}

.meta-row.bottom-line > div {
  flex: 1;
  min-width: 200px;
}

.meta-row.bottom-line .left {
  text-align: left;
  flex: 1;
}

.meta-row.bottom-line .right {
  text-align: right;
  flex: 1;
}


/* ---------- EDIT-BEREICH ---------- */
.edit-section {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.edit-section label {
  font-weight: bold;
  margin-right: 4px;
}

.edit-section input {
  height: 24px;
  font-size: 14px;
  padding: 2px 5px;
  border-radius: 4px;
  border: 1px solid #ccc;
  width: 220px;
  margin-right: 12px;
}

/* ---------- TOPBAR ---------- */
.top-bar {
  background-color: #1a1a1a;
  color: white;
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 16px;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.nav-button {
  background-color: #c00000;
  color: white;
  padding: 6px 14px;
  border-radius: 4px;
  margin-right: 10px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.nav-button:hover {
  background-color: #a00000;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 15px;
}

.username {
  font-weight: bold;
}

.score {
  font-weight: bold;
}
/*-----------Titel-----------*/

.page-title {
  text-align: center;
  margin-top: 20px;
  margin-bottom: 20px;
}

.page-title h1 {
  font-size: 28px;
  font-weight: bold;
  color: #333;
  margin: 0;
}

/* ---------- SEITEN-BUTTONS ---------- */
.side-button {
  position: fixed;
  top: 80px;
  bottom: 30px;
  width: 80px;
  background-color: #c00000;
  color: white;
  border: none;
  font-size: 16px;
  cursor: pointer;
  z-index: 999;
  transition: background-color 0.3s ease;
  writing-mode: horizontal-tb;
}

.side-button.left {
  left: 0;
  border-radius: 0 8px 8px 0;
}

.side-button.right {
  right: 0;
  border-radius: 8px 0 0 8px;
}

.side-button:hover {
  background-color: #a00000;
}

/* Serien-Dropdown im Tagmask-Layout */
.series-dropdown-container {
  display: flex;
  justify-content: flex-start;    /* oder flex-start für linksbündig */
  align-items: flex-start;
  margin: 1rem 0;              /* Abstand oben und unten */
}

.series-dropdown-container label {
  margin-right: 0.5rem;
}

.series-dropdown-container .nav-button.dropdown {
  max-width: 200px;
}


/* ---------- RUBRIKEN ---------- */
#top_tags_section,
#top_categories_section,
#category_tags_section,
#assigned_tags_section {
  background-color: #f1f1f1;
  padding: 15px;
  border-radius: 6px;
  margin-bottom: 20px;
  border-left: 4px solid #c00000;
}

#top_tags_section h2,
#top_categories_section h2,
#category_tags_section h2,
#assigned_tags_section h2 {
  margin-top: 0;
  color: #c00000;
  font-size: 18px;
}

/* ---------- TAG-CHIPS ---------- */
#top_tags_section a,
#top_categories_section a,
#category_tags_section a {
  display: inline-block;
  background-color: #1a1a1a;
  color: white;
  padding: 6px 12px;
  margin: 6px 8px 6px 0;
  border-radius: 20px;
  font-size: 14px;
  text-decoration: none;
  transition: background-color 0.3s ease;
}

#top_tags_section a:hover,
#top_categories_section a:hover,
#category_tags_section a:hover {
  background-color: #c00000;
}

.assigned-tag {
  display: inline-block;
  background-color: #c00000;
  color: white;
  padding: 6px 12px;
  margin: 6px 8px 6px 0;
  border-radius: 20px;
  font-size: 14px;
  transition: background-color 0.3s ease;
  cursor: default;
}

.assigned-tag:hover {
  background-color: #1a1a1a;
}

.assigned-tag.newly-added {
  cursor: pointer;
}

.assigned-tag.newly-added:hover {
  background-color: #a00000;
}




/* ---------- EINGABE-GRUPPEN ---------- */
.tag-input-group {
  display: flex;
  margin-bottom: 15px;
  gap: 10px;
}

#new_tag_input,
#new_category_input {
  flex: 1;
  padding: 8px;
  font-size: 14px;
  border-radius: 5px;
  border: 1px solid #ccc;
}

/* ---------- Galerie ---------- */
.gallery-entry {
  margin-bottom: 40px;
}

.gallery-entry img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.nav-button {
  background-color: #c00000; /* Rot */
  color: white;
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  text-decoration: none;
  transition: background-color 0.3s ease;
}

.nav-button:hover {
  background-color: #a00000;
}

.dropdown {
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.filter-section {
  background-color: #f1f1f1;       
  border-left: 4px solid #c00000;  
  border-radius: 6px;              
  padding: 15px;
  margin-bottom: 20px;
  position: relative;
}
.filter-section h2 {
  color: #c00000;                  
  margin-top: 0; 
  font-size: 18px;
}

/* Galerie-Container */
.gallery-container {
  width: 95%;
  margin: 20px auto;
  padding: 20px;
  background-color: #ffffff;
  border-radius: 8px;
  box-shadow: 0 0 12px rgba(0,0,0,0.05);
}

/* Graue Boxen mit rotem linken Streifen – Filterbereich */
.filter-section {
  background-color: #f1f1f1;
  border-left: 4px solid #c00000;
  border-radius: 6px;
  padding: 15px;
  margin-bottom: 20px;
}

/* Gallery Grid – automatische Spaltenanzahl, Mindestbreite 256px */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(256px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

/* Gallery Item */
.gallery-item {
  background-color: #f9f9f9;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 10px;
  display: flex;
  flex-direction: column;
}

/* Galerie-Kachel mit Bearbeitungsstand >= 7 */
.gallery-item.fully-processed {
  background-color: #e6f5e6; /* Sanftes Grün */
  border-color: #9ccc9c;
}

/* Hover-Effekt für alle Kacheln */
.gallery-item:hover {
  background-color: #e0e0e0; 
}

/* Hover für grün markierte Kacheln */
.gallery-item.fully-processed:hover {
  background-color: #cceacc; /* satteres Grün beim Hover */
}


/* Galeriebild */
.gallery-image img {
  width: 256px;   /* Feste Breite */
  height: auto;
  border-radius: 4px;
}

/* Info-Bereich in Gallery Item */
.gallery-info {
  display: flex;
  flex-wrap: wrap;
  margin-top: 10px;
}

/* Neue Layout-Regeln für den Info-Bereich in den Galerie-Kacheln */
.info-row {
  display: flex;
  align-items: center;
  padding: 4px;
  box-sizing: border-box;
  width: 100%;
}

.info-label {
  flex: 0 0 30%;   /* Bezeichner nimmt ca. 30% des Platzes ein */
  text-align: left;
  font-weight: bold;
}

.info-value {
  flex: 1;         /* Wert nimmt den restlichen Platz ein */
  margin-left: 5px;
  white-space: normal;      /* Erlaubt Zeilenumbrüche */
  word-break: break-word;   /* Bricht zu lange Wörter */
  overflow-wrap: break-word; /* Falls nötig, wird auch ein Umbruch erzwungen */
}


/* Angepasste Buttons (wie Navi) */
.nav-button {
  background-color: #c00000;
  color: white;
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  text-decoration: none;
  transition: background-color 0.3s ease;
  cursor: pointer;
}

.nav-button:hover {
  background-color: #a00000;
}

/* Dropdowns */
select.nav-button.dropdown {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-color: #c00000;
  color: white;
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

/* Chips für ausgewählte Filter */
.assigned-tag {
  display: inline-block;
  background-color: #c00000;
  color: white;
  padding: 6px 12px;
  margin: 6px 8px 6px 0;
  border-radius: 20px;
  font-size: 14px;
  transition: background-color 0.3s ease;
  cursor: pointer;
}

.assigned-tag:hover {
  background-color: #1a1a1a;
}

/* ### Modal-Fenster Bereich in der Galerie ### */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.6); /* ausgegrauter Hintergrund */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background-color: #fff;
  padding: 30px;
  border-radius: 10px;
  max-width: 90%;
  max-height: 90%;
  overflow-y: auto;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.3);
  position: relative;
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 24px;
  cursor: pointer;
  color: #c00000;
  font-weight: bold;
}

/* Stapelverarbeitung – Galerie-Auswahl */
.gallery-item {
  position: relative;
  cursor: pointer;
  transition: background-color 0.2s;
}
.gallery-item:hover {
  background-color: #f0f0f0; /* dein dunkleres Grau beim Hover */
}
.gallery-item.selected {
  background-color: rgba(220, 20, 60, 0.1); /* dezenter Rotton mit 10% Deckkraft */
}
.select-all-label {
  display: inline-flex;
  align-items: center;
  margin-bottom: 1rem;
}
.select-all-label input {
  margin-right: 0.5rem;
}

.gallery-item.selected { background-color: rgba(20,20,120,0.2); }
.gallery-item.selected:hover   { background-color: rgba(20,20,120,0.3); }


/* ---------- EDIT-OVERLAY ---------- */
.edit-overlay {
  max-width: 800px;
  margin: auto;
}

.zoom-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
  margin-bottom: 20px;
}


#zoom-frame {
  position: relative;
  width: fit-content;
}

#zoom-lens {
  position: absolute;
  border: 2px solid #c00000;
  width: 100px;
  height: 100px;
  pointer-events: none;
  display: none;
}

#zoom-result {
  overflow: hidden;
  width: 400px;
  height: 400px;
  border: 1px solid #ccc;
  position: relative;
}

#zoom-result img {
  position: absolute;
  top: 0;
  left: 0;
}

/* Lupe-Zoom Styles */
.zoom-container {
  width: 768px;
  margin: auto;
  position: relative;
  overflow: hidden;
}

#zoom-frame {
  width: 768px;
  height: auto;
  position: relative;
  overflow: hidden;
}

#tiny-img {
  width: 768px;
  height: auto;
  display: block;
  position: relative;
  z-index: 1;
}

#original-img {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  cursor: grab;
}



/* ---------- Highscore Bereich ---------- */
.highscore-container {
  background-color: #ffffff; 
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.05);
  margin-top: 20px;
}

.highscore-list {
  margin: 0;
  padding: 0;
}

.highscore-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f9f9f9;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 10px 15px;
  margin-bottom: 10px;
  transition: background-color 0.3s ease;
}

.highscore-item:hover {
  background-color: #f1f1f1;
}

.highscore-item .ranking {
  font-weight: bold;
  width: 40px;
}

.highscore-item .username {
  flex: 1;
  text-align: left;
  font-size: 16px;
  margin-left: 10px;
}

.highscore-item .score {
  font-weight: bold;
  font-size: 16px;
  color: #c00000;
}


/* ---------- MOBIL ---------- */
@media (max-width: 768px) {
  .container {
    padding: 20px;
  }

  .nav-button {
    padding: 10px;
    font-size: 14px;
  }

  .score, .username {
    font-size: 14px;
  }

  .meta-group {
    flex-direction: column;
  }

  .edit-section {
    flex-direction: column;
  }

  .edit-section input {
    width: 100%;
  }

  .side-button {
    display: none;
  }
}

body {
  touch-action: pan-y;
}
