/* Global Styles */
body {
  font-family: 'Arial', sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f5f7fa; /* Heller, neutraler Hintergrund */
  color: #333; /* Standard-Textfarbe */
}

h2 {
  text-align: center;
  margin-top: 20px;
  font-size: 1.8rem;
  color: #2f3b45; /* Dezentes Dunkelgrau-Blau */
}

/* Header Section */
.header {
  /* Dezente Blau/Grau-Farbverläufe */
  background: linear-gradient(to right, #596e82, #455665);
  color: #fff;
  padding: 20px 0;
  text-align: center;
  /* etwas dunklerer Farbton als Border-Bottom */
  border-bottom: 4px solid #354452;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.header .logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 20px;
}

.header .logo img {
  height: 50px;
  width: auto;
}

.header .title {
  font-size: 1.8rem;
  font-weight: bold;
  flex: 1;
  text-align: center;
}

.header .link {
  margin-right: 20px;
}

.header .link a {
  color: #fff;
  text-decoration: none;
  font-size: 1rem;
  font-weight: bold;
  /* Mildere Grün-Farbe */
  background: #3f6d4b;
  padding: 8px 12px;
  border-radius: 5px;
}

.header .link a:hover {
  background: #365f42; /* Etwas dunkler beim Hover */
}

/* Button Section Spacing */
.button-section {
  margin-top: 50px; /* Mehr Abstand zwischen Header und Buttons */
  text-align: center;
}

/* Button Styles */
button {
  margin: 5px;
  padding: 8px 16px;
  font-size: 1rem;
  border-radius: 4px;
  border: none; /* Entferne sichtbare Rahmen */
  transition: background-color 0.2s ease, opacity 0.2s ease;
}

/* Abgestimmte Farbtöne */
.btn-primary,
.btn-secondary,
.btn-success {
  background-color: #3f6d4b; 
  color: #fff;
}

.btn-info {
  background-color: #467487; 
  color: #fff;
}

button:hover {
  opacity: 0.9;
  cursor: pointer;
}

.btn-remove {
  background-color: #596e82;
  border: none;
  color: #fff;
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  border-radius: 4px;
  cursor: pointer;
}

.btn-remove:hover {
  background-color: #596e82;
}


/* Card Component */
.card {
  margin: 20px auto;
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  /* Leichter Schatten */
  box-shadow: 0 3px 5px rgba(0, 0, 0, 0.08);
  background-color: #fff;
}

.card-header {
  background-color: #596e82; /* Gleiche Farbwelt wie der Header */
  color: #fff;
  font-size: 1.2rem;
  padding: 10px 15px;
}

.card-body {
  padding: 15px;
}

/* Collapsible Sections */
.collapsible-header {
  cursor: pointer;
  background-color: #f8f9fa;
  padding: 10px;
  border-bottom: 1px solid #ddd;
  font-weight: bold;
}

.collapsible-header:hover {
  background-color: #e9ecef;
}

.collapsible-content {
  display: none;
  padding: 15px;
  border-top: 1px solid #ddd;
}

/* TreeView */
.tree-ul {
  list-style: none;
  padding-left: 1rem;
  border-left: 1px dashed #ccc;
}

.tree-li {
  margin: 5px 0;
  cursor: pointer;
}

.tree-li > span {
  font-weight: bold;
  color: #596e82; /* Dezenteres Blau-Grau für Links */
}

.tree-li > span:hover {
  text-decoration: underline;
}

/* Debug Box */
.debug-box {
  background: #f8f9fa;
  padding: 10px;
  border: 1px solid #ddd;
  font-size: 0.9rem;
  max-height: 200px;
  overflow-y: auto;
}

/* Form Elements */
form input, 
form select {
  margin-bottom: 10px;
  padding: 8px;
  font-size: 1rem;
  width: 100%;
  border: 1px solid #ccc;
  border-radius: 4px;
}

form button {
  margin-top: 10px;
  width: 100%;
}

/* Table */
#calcTable {
  width: 100%;
  border-collapse: collapse;
  margin-top: 15px;
}

#calcTable th, 
#calcTable td {
  border: 1px solid #ddd;
  padding: 8px;
  text-align: left;
}

#calcTable th {
  background-color: #596e82;
  color: #fff;
}

#calcTable tr:nth-child(even) {
  background-color: #f2f2f2;
}

/* Search Input */
#treeSearchInput, 
#calcSearchInput {
  margin: 10px 0;
  width: 100%;
  padding: 8px;
  border-radius: 4px;
  border: 1px solid #ccc;
}

#treeSearchInput::placeholder, 
#calcSearchInput::placeholder {
  color: #aaa;
  font-style: italic;
}

/* Chart Container */
canvas {
  max-width: 100%;
  margin-top: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .card {
    margin: 10px;
  }

  button {
    width: 100%;
  }

  .header {
    flex-direction: column;
    text-align: center;
  }

  .header .logo, 
  .header .link {
    margin: 10px 0;
  }
}
