:root {
  --primary-color: var(--theme-color, #4CAF50);
  --secondary-color: #45a049;
  --text-color: var(--text-color, #333);
  --link-color: var(--link-color, #1a73e8);
  --background-color: #f4f4f4;
}

body {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--background-color);
  margin: 0;
  padding: 0;
}

header {
  background-color: var(--header-bg-color, var(--primary-color));
  color: white;
  padding: 1rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  position: relative;
  padding-right: 50px;
}

header h1 {
  margin: 0;
  font-size: 2rem;
}

nav ul {
  list-style-type: none;
  padding: 0;
  margin: 0;
}

nav ul li {
  margin: 10px 0;
}

nav ul li a {
  color: white;
  text-decoration: none;
  font-size: 16px;
  display: block;
  padding: 5px 10px;
}

nav ul li a:hover {
  background-color: rgba(255,255,255,0.1);
}

main {
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

#search {
  margin-bottom: 2rem;
}

#search form {
  display: flex;
  gap: 1rem;
}

#search input[type="text"] {
  flex-grow: 1;
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
}

button, .button {
  background-color: var(--theme-color);
  color: white;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background-color 0.3s, opacity 0.3s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  font-size: 14px;
  margin: 4px 2px;
  text-align: center;
  min-width: 80px;
  height: 36px;
  line-height: 1;
  vertical-align: middle;
  opacity: 1;
}

button span, .button span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

button:hover, .button:hover {
  background-color: var(--secondary-color);
}

.button.delete {
  background-color: #f44336;
}

.button.delete:hover {
  background-color: #d32f2f;
}

.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
}

.file-card {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  padding: 1rem;
  transition: transform 0.3s;
}

.file-card:hover {
  transform: translateY(-5px);
}

.file-card h3 {
  margin-top: 0;
  color: var(--primary-color);
}

.file-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 4px;
}

.file-actions .button {
  flex: 1 1 auto;
}

footer {
  background-color: var(--header-bg-color, var(--primary-color));
  color: white;
  text-align: center;
  padding: 1rem;
  margin-top: 2rem;
}

form {
  max-width: 100%;
  margin: 0 auto;
}

form div {
  margin-bottom: 1rem;
}

form label {
  display: block;
  margin-bottom: 0.5rem;
}

form input[type="text"],
form input[type="password"],
form input[type="number"],
form select {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-sizing: border-box;
}


.modal {
  display: none;
  position: fixed;
  z-index: 1;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.4);
}

.modal-content {
  background-color: #fefefe;
  margin: 15% auto;
  padding: 20px;
  border: 1px solid #888;
  width: 80%;
  max-width: 500px;
}

.close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.close:hover,
.close:focus {
  color: #000;
  text-decoration: none;
  cursor: pointer;
}

#user-management .button {
  width: 100px;
}

#user-management form {
  display: inline-flex;
}

.menu-toggle {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 21px;
  cursor: pointer;
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 1000;
}

.menu-toggle span {
  display: block;
  width: 100%;
  height: 3px;
  background-color: white;
  transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

.nav-menu {
  display: none;
  position: absolute;
  top: 60px;
  right: 20px;
  background-color: var(--header-bg-color);
  border-radius: 4px;
  padding: 10px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.nav-menu.active {
  display: block;
}

@media (max-width: 768px) {
  .nav-menu {
      width: 200px;
  }
}

/* Admin Panel Styles */
.admin-section {
  background-color: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 20px;
  margin-bottom: 20px;
}

.admin-section h3 {
  margin-top: 0;
  color: var(--theme-color);
}

.admin-form {
  display: grid;
  gap: 15px;
}

.admin-form label {
  font-weight: bold;
}

.admin-form input[type="text"],
.admin-form input[type="number"],
.admin-form input[type="password"],
.admin-form select {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 10px;
  border: 1px solid #ddd;
  text-align: left;
}

.admin-table th {
  background-color: var(--theme-color);
  color: white;
}

.admin-table tr:nth-child(even) {
  background-color: #f2f2f2;
}

.button-group {
  display: flex;
  gap: 10px;
}

.modal-content form {
  display: grid;
  gap: 15px;
}

/* Neue Styles für das Benutzer-Erstellungsformular */
.user-management-container {
  width: 100%;
}

.new-user-form {
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  margin-bottom: 20px;
  width: 100%;
  box-sizing: border-box;
}

.new-user-form .admin-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}

.new-user-form .form-group {
  margin-bottom: 0;
}

.new-user-form .button {
  grid-column: 1 / -1;
  width: 100%;
}

@media (max-width: 768px) {
  .new-user-form .admin-form {
    grid-template-columns: 1fr;
  }
}

/* Konfigurationsbereich Styles */
#config .admin-form {
  max-width: 400px;
  margin: 0;
}

#config .form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 15px;
}

#config label {
  text-align: left;
  font-weight: bold;
}

#config input,
#config select {
  width: 100%;
}

#config button[type="submit"] {
  width: 100%;
  margin: 20px 0 0;
}

@media (max-width: 600px) {
  #config .admin-form {
    max-width: 100%;
  }
}

/* Upload-Button Styles */
.upload-button,
form button[type="submit"] {
  background-color: #4CAF50;
  color: white;
  border: none;
  padding: 10px 15px;
  cursor: pointer;
  transition: background-color 0.3s;
  text-decoration: none;
  display: inline-block;
  border-radius: 4px;
  font-size: 16px;
  font-weight: bold;
  margin: 4px 2px;
  text-align: center;
  min-width: 100px;
}

.upload-button:hover,
form button[type="submit"]:hover {
  background-color: #45a049;
}

/* Menu Toggle Styles */
.menu-toggle {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 21px;
  cursor: pointer;
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 1000;
}

.menu-toggle span {
  display: block;
  width: 100%;
  height: 3px;
  background-color: white;
  transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

/* Tabellen-Button Styles */
.file-table .button {
    font-size: 0.8em;
    padding: 0;
    margin: 2px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    min-width: 70px;
    width: 100%;
    height: 28px;
    line-height: 1;
    box-sizing: border-box;
}

.file-table .button span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.file-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 4px;
}

.file-actions .button {
  flex: 1 1 auto;
}

.file-table td[data-label="Aktionen"] {
  padding: 4px;
  vertical-align: middle;
}

.success-message {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 15px;
}

.error-message {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 15px;
}

