/* ===== Globaler Reset & Basis-Stile ===== */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background-color: #333;
  color: #e0e0e0;
  font-family: Arial, sans-serif;
}

/* ===== Layout-Struktur ===== */
.page-container {
  min-height: 100vh;
  display: flex;
  flex-direction: row;
}
.left-banner, .right-banner {
  width: 120px;
  background-color: #2a2a2a;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.left-banner span, .right-banner span {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}
.main-column {
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* ===== Navigation ===== */
@media only screen and (max-width: 600px) {
  nav.navbar ul {
    display: flex;
    flex-wrap: wrap;
  }

  nav.navbar li {
    flex: 1 1 auto;
  }

  nav.navbar a,
  nav.navbar a.active,
  nav.navbar a:hover {
    display: block;
    margin: 0 !important;
    padding: 15px 10px !important;
    line-height: 1.2;
    background-color: #1a1a1a; /* gleiche Farbe wie .main-content */
  }
}

nav.navbar {
  background-color: #333;
}
nav.navbar ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
}
nav.navbar li {
  margin: 0;
}
nav.navbar a {
  color: #e0e0e0;
  padding: 15px 20px;
  display: block;
  text-decoration: none;
  background-color: #333;
  transition: background-color 0.2s;
}
nav.navbar a:hover {
  background-color: #444;
}
nav.navbar a.active {
  background-color: #1a1a1a;
}

/* ===== Hauptinhalt ===== */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: #1a1a1a;
  overflow: hidden;
}
.content-section {
  display: none;
  padding: 20px;
  flex: 1;
  box-sizing: border-box;
  overflow-y: auto;
}
#homeSection {
  align-items: center;
  justify-content: center;
  display: flex;
  flex-direction: column;
}

/* ===== Hinweis-Balken (Cookie-Hinweis) ===== */
#noCookieBar {
  width: 100%;
  background-color: #000000;
  padding: 10px;
  box-sizing: border-box;
  text-align: center;
}
#noCookieBar p {
  margin: 0;
  display: inline-block;
}
#noCookieBar button {
  margin-left: 20px;
  background-color: #444;
  border: 1px solid #555;
  color: #fff;
  cursor: pointer;
  padding: 5px 10px;
}
#noCookieBar button:hover {
  background-color: #666;
}

/* ===== Footer ===== */
.footer {
  background-color: #333;
  text-align: center;
  padding: 10px;
}

/* ===== Formularelemente ===== */
button, select {
  margin: 5px;
  padding: 8px;
  background-color: #444;
  color: #e0e0e0;
  border: 1px solid #555;
  cursor: pointer;
}
button:hover, select:hover {
  background-color: #555;
}
button:disabled {
  background-color: #555;
  cursor: not-allowed;
}
label {
  margin: 5px;
}
.form-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 5px;
  margin-bottom: 10px;
}
.form-row label {
  min-width: 120px;
  text-align: right;
}

/* ===== PDF-Felder-Bereich ===== */
/* PDF Editierbereich: Container für linke und rechte Spalte */
.pdf-edit-container {
  display: flex;
  gap: 20px;
  width: 100%;
  flex-wrap: wrap;
}

/* Linke Spalte: Site-Bar, feste Breite 400px, Inhalte linksbündig (oben ausgerichtet) */
.site-bar {
  background-color: #333;
  padding: 10px;
  color: #e0e0e0;
  width: 390px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
}
.site-bar h1 {
  margin: 0 0 10px;
  font-size: 1.1rem;
  text-align: left;
}

/* Linke Spalte: Toolbar-Container */
.site-bar-toolbar-container {
  width: 100%;
  margin-bottom: 10px;
}
.site-bar-toolbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
}
.site-bar-toolbar button, .site-bar-toolbar select {
  background-color: #444;
  color: #e0e0e0;
  border: 1px solid #555;
  padding: 5px 10px;
  cursor: pointer;
}
.site-bar-toolbar button:hover, .site-bar-toolbar select:hover {
  background-color: #555;
}
.zoom-container {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 5px;
}
/* Neuer Status-Container, volle Breite im linken Bereich */
.status-container {
  width: 100%;
  margin-top: 10px;
  text-align: left;
}

/* Sidebar-Container im linken Bereich */
.sidebar-container {
  width: 100%;
  background-color: #2a2a2a;
  padding: 10px;
  box-sizing: border-box;
  overflow: auto;
}
.sidebar-container .sidebar {
  color: #e0e0e0;
}
.sidebar-container h3 {
  margin-top: 0;
  font-size: 1rem;
}
#fieldsList {
  user-select: text;
  font-size: 0.9rem;
  max-height: calc(100vh - 460px); /* Hier anpassen, je nach Höhe von Toolbar, etc. */
  overflow-y: auto;
  /* Hier evtl. etwas optisches Padding oder Margin ... */
  margin-top: 5px;
  padding: 5px;
  /* Dunkler Hintergrund, falls gewünscht */
  background-color: #2a2a2a; 
}

/* Dunkler Scrollbalken anpassen (WebKit-basiert: Chrome, Safari, Edge-Chromium) */

/* Breite der Scrollbar */
#fieldsList::-webkit-scrollbar {
  width: 8px; /* Anpassen nach Geschmack */
  background-color: #222; /* Hintergrund der gesamten Scroll-Leiste */
}

/* Die "Thumb" (der bewegliche Balken) */
#fieldsList::-webkit-scrollbar-thumb {
  background-color: #444;
  border-radius: 4px;
}
#fieldsList::-webkit-scrollbar-thumb:hover {
  background-color: #555; /* Hover-Effekt */
}

/* (Optional) Für Firefox >= 64 kann man scrollbar-color verwenden: */
#fieldsList {
  scrollbar-color: #444 #222; /* thumb, track */
  scrollbar-width: thin;      /* 'thin', 'auto' oder 'none' */
}

.field.selected {
  border: 2px dashed yellow !important;
}

.field-item.selected {
  border: 1px solid yellow;
  background-color: #222;
}

/* Rechte Spalte: Enthält Überschrift und Drag & Drop-Bereich, soll die komplette restliche Breite einnehmen */
.right-edit-container {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;  /* vertikale Zentrierung */
  align-items: center;        /* horizontale Zentrierung */
  text-align: center;
}
.edit-heading h1 {
  margin: 0 0 20px;
  font-size: 2em;
}

/* Dateiname der geladenen PDF-Datei */
#uploadedFileName {
	margin-top: 10px;
	font-size: 0.9em;
	color: #ccc;
}

/* Seitencontainer im rechten Bereich */
.pages-container {
  width: 100%;
  overflow: auto;
  background-color: #1a1a1a;
  position: relative;
  padding: 10px;
  margin-top: 20px;
}
.pages-container {
  /* Dein max-height, overflow-y usw.: */
  max-height: calc(100vh - 340px);
  overflow-y: auto;

  /* Für Firefox: */
  scrollbar-color: #444 #222; /* Daumen #444, Track #222 */
  scrollbar-width: thin;      /* etwas schmaler */
}

/* Für Chrome / WebKit: */
.pages-container::-webkit-scrollbar {
  width: 8px;               /* Breite der Scrollbar */
  background-color: #222;   /* Hintergrund der Scrollbar */
}

.pages-container::-webkit-scrollbar-thumb {
  background-color: #444;   /* Daumen-Farbe (der bewegliche Teil) */
  border-radius: 4px;
}
.pages-container::-webkit-scrollbar-thumb:hover {
  background-color: #555;   /* Hover-Farbe */
}

/* ===== Drag & Drop Bereich ===== */
#dropZone, .drop-area {
  border: 2px dashed #555;
  padding: 20px;
  margin: 20px auto;
  max-width: 600px;
  background-color: #2a2a2a;
  color: #ccc;
  cursor: pointer;
  text-align: center;
}
#dropZone p, .drop-area p {
  margin: 10px 0;
}

/* ===== PDF-Seiten ===== */
.pdf-page {
  position: relative;
  display: block;
  margin: 20px auto;
  background-color: #1a1a1a;
  border: 1px solid #444;
}
.pdf-canvas {
  display: block;
  background-color: #2a2a2a;
}
.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: auto;
}
.overlay:hover {
  outline: 1px dashed rgba(255,255,255,0.2);
}

/* ===== Felder (Drag & Drop, Resizing) ===== */
.field {
  position: absolute;
  border: 1px solid red;
  background-color: #fff;
  color: #000;
  box-sizing: border-box;
  overflow: visible;
  padding: 2px;
  user-select: none;
}
.field input {
  pointer-events: none;
  width: 100%;
  height: 100%;
  margin: 0;
  border: none;
  background-color: #fff;
  color: #000;
  text-align: center;
}
.field img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}
.del-btn {
  position: absolute;
  top: 0;
  right: 0;
  background-color: #c00;
  color: #fff;
  border: none;
  border-radius: 3px;
  font-size: 12px;
  cursor: pointer;
  padding: 0 5px;
  user-select: none;
}
.del-btn:hover {
  background-color: #f00;
}
.draggable {
  cursor: move;
}
.resizable {
  cursor: default;
}
.resize-handle {
  position: absolute;
  width: 10px;
  height: 10px;
  bottom: 0;
  right: 0;
  background-color: #bbb;
  cursor: se-resize;
  user-select: none;
}

/* ===== Felderliste (Sidebar) ===== */
.field-item {
  position: relative;
  border: 1px solid #555;
  margin-bottom: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  user-select: text;
}
.field-item .list-delete-btn {
  position: absolute;
  top: 5px;
  right: 5px;
  background-color: #c00;
  color: #fff;
  border: none;
  border-radius: 3px;
  font-size: 0.8rem;
  cursor: pointer;
  padding: 2px 5px;
}
.list-delete-btn:hover {
  background-color: #f00;
}
.field-line {
  display: flex;
  gap: 5px;
  align-items: center;
}
.field-line label {
  flex-shrink: 0;
  max-width: 120px;
  margin-right: 10px;
}
.field-line input[type="text"],
.field-line input[type="number"] {
  flex-grow: 1;
  background-color: #444;
  color: #e0e0e0;
  border: 1px solid #555;
  padding: 2px 4px;
}
.input-with-help {
  display: inline-flex;
  align-items: center;
}
.input-with-help .help-icon {
  margin-left: 4px;
  color: #e0e0e0;
  cursor: default;
  font-weight: bold;
}
