* {
    box-sizing: border-box;
  }

  html, body {
    margin: 0;
    height: 100%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f0f0f0;
    color: #333;
  }

  #app {
    display: flex;
    height: 100vh;
  }

  #sidebar {
    width: 320px;
    background: whitesmoke;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  #upload-and-search {
  margin-bottom: 20px;
  }

  #main {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    background: white;
  }

  input[type="file"],
  input[type="text"] {
    padding: 10px;
    background: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
  }

  .section-title {
    font-weight: 600;
    margin-top: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #ededed;
    border-radius: 8px;
    cursor: pointer;
  }

  .project-block {
    margin-bottom: 10px;
  }

  .item {
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.2s;
  }

  .item:hover {
    background-color: #e0e0e0;
  }

  .timeline-item {
    padding-left: 12px;
    margin: 12px 0;
    background: #f8f8f8;
    border-radius: 6px;
    padding: 12px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  }

  .taxonomy-controls {
    display: flex;
    gap: 10px;
    margin: 10px 0;
  }

  .project-taxonomy button {
    margin-right: 10px;
  }

  .taxonomy-tree ul {
    list-style: none;
    padding-left: 20px;
  }

  .taxonomy-tree li {
    margin: 6px 0;
    padding: 6px;
    border-radius: 6px;
    transition: background 0.2s;
    background: #f9f9f9;
    /* Fix: allow drag events and pointer events */
    pointer-events: auto !important;
    z-index: 1;
  }

  .taxonomy-tree li * {
    pointer-events: auto;
  }

  .taxonomy-node-container {
    display: flex;
    align-items: center;
    gap: 8px;
    /* pointer-events entfernt, damit Drag & Drop überall auf li funktioniert */
  }

  .taxonomy-node.dragging {
    opacity: 0.5;
    border: 2px dashed #888;
}

  .project-view {
    display: flex;
    flex-direction: column;
    gap: 24px;
  }

  @media (min-width: 768px) {
    .project-view {
      flex-direction: row;
    }
  }

  .project-timeline, .project-taxonomy {
    flex: 1;
    background: white;
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
  }

  .button {
    background-color: #ddd;
    color: #222;
    font-weight: 500;
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.2s;
    margin-right: 6px;
  }

  .transcript-entry {
    margin-bottom: 12px;
    padding: 12px;
    border-radius: 10px;
    background-color: #f9f9f9;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  }

  .snippet {
    margin-top: 6px;
    padding: 10px;
    background-color: #f5f5f5;
    border-radius: 8px;
    min-height: 40px;
    white-space: pre-wrap;
  }

  #chat-window {
    position: fixed;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    width: 30%;
    max-height: 22%;
    border: 1px solid #ddd;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    background: #f9f9f9;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
  }

  #chat-messages {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    font-size: 14px;
    color: #333;
  }

  #chat-input-container {
    display: flex;
    border-top: 1px solid #ddd;
    padding: 8px;
    background: #fff;
  }

  #chat-input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    resize: none;
    max-height: 4em;
    overflow-y: auto;
  }

  #send-chat {
    margin-left: 8px;
    padding: 10px 16px;
    background-color: #ddd;
    color: #222;
    font-weight: 500;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
  }

  #send-chat:hover {
    background-color: #ccc;
  }

  /* Stile für den Chat-Header */
#chat-header {
  display: flex;
  align-items: center;
  padding: 10px;
  background-color: #f1f1f1;
  border-bottom: 1px solid #ddd;
}

/* Stile für das Logo im Header */
#chat-header img {
  width: 30px;
  height: 30px;
  margin-right: 10px;
  border-radius: 50%;
}

/* Stile für den Text im Header */
#chat-header span {
  font-weight: bold;
  font-size: 16px;
}

/* Stile für den Nachrichtenbereich */
#chat-messages {
  flex: 1;
  padding: 10px;
  overflow-y: auto;
  background-color: #fafafa;
}

/* Stile für den Eingabebereich */
#chat-input-container {
  display: flex;
  padding: 10px;
  border-top: 1px solid #ddd;
  background-color: #f9f9f9;
}

/* Stile für das Eingabefeld */
#chat-input {
  flex: 1;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  margin-right: 10px;
}

/* Stile für den Senden-Button */
#send-chat {
  padding: 8px 16px;
  background-color: #007bff;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

#send-chat:hover {
  background-color: #0056b3;
}

.taxonomy-tree ul {
    list-style-type: none;
    padding-left: 20px;
}

.taxonomy-tree li {
    margin: 5px 0;
    padding: 5px;
    border-radius: 4px;
}

.taxonomy-tree li:hover {
    background-color: #f0f0f0;
}

.taxonomy-tree span[title] {
    font-size: 0.8em;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.taxonomy-tree span[title]:hover {
    opacity: 1;
}

button.button, .button {
    background: #eee !important;
    color: #333 !important;
    border: none !important;
    border-radius: 4px !important;
    padding: 4px 8px !important;
    cursor: pointer !important;
    font-size: 1em !important;
    opacity: 0.85 !important;
    transition: background 0.2s, opacity 0.2s !important;
}
button.button:hover, .button:hover {
    background: #ccc !important;
    opacity: 1 !important;
}

.icon-right {
    margin-left: auto;
    display: inline-flex;
    justify-content: flex-end;
}
.dropdown-node {
    display: flex;
    align-items: center;
    /* Optional: falls du möchtest, dass alle Inhalte im Node flex sind */
}

/* Semantic Dropdown Styles */
.semantic-dropdown {
    position: fixed;
    top: 120px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    min-width: 320px;
    padding: 24px 24px 18px 24px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 16px #0002;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.semantic-dropdown-header {
    margin-bottom: 18px;
    font-size: 1.2em;
    font-weight: bold;
}

.semantic-dropdown-list {
    font-size: 1.1em;
    padding: 8px 12px;
    margin-bottom: 18px;
    width: 100%;
}

.semantic-backend-select-wrapper {
    width: 100%;
    display: none;
    flex-direction: column;
    align-items: center;
    margin-bottom: 16px;
}

.semantic-backend-select-label {
    margin-bottom: 8px;
}

.semantic-backend-select-error {
    color: #c00;
    margin-top: 8px;
}

.semantic-dropdown-btn-row {
    display: flex;
    gap: 16px;
    justify-content: center;
    width: 100%;
}

.semantic-dropdown-ai {
    background: #f3f3f3;
    border-radius: 4px;
    margin: 8px 0;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 32px;
}

.semantic-dropdown-ai-header {
    font-weight: bold;
    font-size: 13px;
    margin-bottom: 4px;
}

.semantic-dropdown-suggestions {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.semantic-dropdown-no-suggestion {
    color: #888;
    font-size: 12px;
}

.semantic-dropdown-error {
    color: #c00;
}

.semantic-dropdown-add-root {
    display: flex;
    justify-content: center;
    margin-top: 8px;
}

.semantic-dropdown-add-root-btn {
    cursor: pointer;
}

.semantic-dropdown-root-block {
    background: #f9f9f9;
    border-radius: 6px;
    margin: 5px 0;
    padding: 2px 0;
}

.semantic-dropdown-node-container {
    display: block;
}

.semantic-dropdown-node-row {
    display: flex;
    align-items: center;
    padding: 4px 0;
    cursor: pointer;
    justify-content: space-between;
    background: transparent;
    border-radius: 4px;
    margin-bottom: 3px;
    margin-top: 0;
}

.semantic-dropdown-toggle {
    margin-right: 8px;
    user-select: none;
    transition: transform 0.2s;
    display: inline-block;
}

.semantic-dropdown-node-name {
    flex: 1;
}

.semantic-dropdown-children {
    display: none;
    flex-direction: column;
}

.semantic-dropdown-ai-node {
    background: #eaeaea;
    border-radius: 3px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 13px;
    margin-bottom: 4px;
}

.semantic-dropdown-ai-node:hover {
    background: #d6d6d6;
}

/* Taxonomy Tree Styles */
.taxonomy-tree {
    list-style-type: none;
    padding-left: 20px;
}

.taxonomy-node {
    margin: 5px 0;
    padding: 5px;
    border-radius: 4px;
    background-color: #f9f9f9;
}

.taxonomy-node-container {
    display: flex;
    align-items: center;
    gap: 8px;
    /* pointer-events entfernt, damit Drag & Drop überall auf li funktioniert */
}

/* Taxonomy Button Styles */
.taxonomy-button {
    cursor: pointer;
    margin-left: 10px;
    display: inline-block;
}

.taxonomy-add-root-button {
    cursor: pointer;
    margin-bottom: 10px;
    display: inline-block;
}

/* Snippet Styles */
.taxonomy-snippet-container {
    margin-top: 15px;
}

.taxonomy-snippet-entry {
    margin-bottom: 15px;
    padding: 10px;
    background-color: #f5f5f5;
    border-radius: 4px;
}

.taxonomy-snippet-meta {
    margin-bottom: 5px;
}

.taxonomy-snippet-content {
    background-color: #d2f8d2;
    padding: 8px;
    border-radius: 4px;
}

.taxonomy-back-button {
    cursor: pointer;
    margin-bottom: 15px;
    display: block;
}

/* taxonomy-node-highlight: kurz grün, dann zurück zu normal */
.taxonomy-node-container.taxonomy-node-highlight {
    background-color: #b6f5c3 !important;
    transition: background-color 0.8s;
}

.snippet-annotation-postit {
    font-family: inherit;
    font-size: 1em;
}

.snippet-task {
    background-color: #ffe066 !important;
    border-left: 3px solid #ff9900;
    padding-left: 8px;
}

.snippet-annotation-indicator {
    display: inline-block;
    width: 22px;
    height: 22px;
    background: #ffe066;
    border-radius: 4px;
    margin-left: 8px;
    vertical-align: middle;
    cursor: pointer;
    box-shadow: 1px 1px 4px #ccc;
    border: 1px solid #e6c200;
}

.taxonomy-snippet-entry {
    margin-bottom: 16px;
    padding: 12px;
    border-radius: 6px;
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.taxonomy-snippet-entry:hover {
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.back-button {
  cursor: pointer;
  display: inline-block;
  font-weight: bold;
  color: #007BFF;
  margin-bottom: 15px;
}
.back-button:hover {
  text-decoration: underline;
}
.back-arrow::before {
  content: '←';
  margin-right: 5px;
}

.snippet-edit-btn {
  cursor: pointer;
  margin-left: 8px;
  position: relative;
  display: inline-block;
  vertical-align: middle;
  font-size: 22px;
}

.snippet-edit-menu {
  display: none;
  position: absolute;
  left: 28px;
  top: 0;
  background: #fff;
  border: 1px solid #ccc;
  padding: 4px 8px;
  z-index: 10;
  border-radius: 6px;
  box-shadow: 1px 1px 6px #ccc;
  white-space: nowrap;
}
.snippet-edit-menu.visible {
  display: inline-block;
  opacity: 1;
}

.snippet-menu-icon {
  cursor: pointer;
  margin-right: 8px;
}

.snippet-task {
  background-color: #ffe066;
}

.snippet-annotate-btn {
  display: inline-block;
  width: 22px;
  height: 22px;
  background-color: #ffe066;
  border-radius: 4px;
  vertical-align: middle;
  cursor: pointer;
  box-shadow: 1px 1px 4px #ccc;
  border: 1px solid #e6c200;
  margin-left: 8px;
  line-height: 22px;
  text-align: center;
}

.snippet-annotation-postit {
  position: absolute;
  right: 40px;
  top: 30px;
  background-color: #fffbe6;
  padding: 16px 12px 12px;
  z-index: 20;
  box-shadow: 2px 2px 8px #ccc;
  width: 200px;
  height: 200px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
}

.postit-button-bar {
  position: absolute;
  top: 8px;
  right: 10px;
  display: flex;
  gap: 8px;
  z-index: 21;
}

.snippet-annotation-indicator {
  display: inline-block;
  width: 22px;
  height: 22px;
  background-color: #ffe066;
  border-radius: 4px;
  margin-left: 8px;
  vertical-align: middle;
  cursor: pointer;
  box-shadow: 1px 1px 4px #ccc;
  border: 1px solid #e6c200;
}

.has-annotation {
  border: 2px dashed #e6c200;
}
