/* FILE: frontend_v4/assets/css/style.css (BEGIN) */

/* ---------------------------------------------------
   Grundlayout & Farben
   --------------------------------------------------- */

:root {
  --green-dark: #153b2c;
  --green-mid: #2d6b3f;
  --green-light: #3f8f53;
  --green-soft: #e5f3ea;
  --bg-main: #f6f7f5;
  --text-main: #111;
  --text-muted: #555;
  --border-soft: #d3ddd5;
  --header-height: 60px;
  --nav-height: 40px;
  --shadow-soft: 0 4px 10px rgba(0, 0, 0, 0.15);
}

/* Global */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

main section {
  scroll-margin-top: calc(var(--header-height) + var(--nav-height) + 16px);
}

body {
  font-family: "Ubuntu", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  background: var(--bg-main);
  color: var(--text-main);
}

/* ---------------------------------------------------
   Header
   --------------------------------------------------- */

#header {
  position: sticky;
  top: 0;
  z-index: 950;
  background: var(--green-dark);
  color: #fff;
}

/* Inhalt kommt aus modules/ui/header.html */

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}

.header-left {
  display: flex;
  align-items: center;
}

.header-title {
  font-size: 20px;
  font-weight: 500;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.login-note {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 360px;
}

.login-note p {
  margin: 0;
}

.header-btn {
  padding: 6px 14px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  background: var(--green-light);
  color: #fff;
  transition: background 0.15s ease, transform 0.1s ease;
}

.header-btn:hover {
  background: var(--green-mid);
  transform: translateY(-1px);
}

/* sorgt dafür, dass nichts abgeschnitten wird */
.header-container,
#header {
  overflow: visible;
}

/* ---------------------------------------------------
   Navigation
   --------------------------------------------------- */

#nav {
  position: sticky;
  top: var(--header-height);
  z-index: 900;
  background: var(--green-mid);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  height: var(--nav-height);
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  padding: 0 20px;
}

main {
  margin-top: calc(var(--header-height) + var(--nav-height));
}

.nav-left {
  display: flex;
  align-items: stretch;
  gap: 25px;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-link {
  display: flex;
  align-items: center;
  height: 100%;
  color: #fff;
  text-decoration: none;
  font-size: 15px;
  font-weight: 400;
}

.nav-dropdown {
  position: relative;
  display: flex;
  align-items: stretch;
}

.nav-dropdown-menu {
  position: absolute;
  left: 0;
  top: 100%;
  min-width: 200px;
  background: #fff;
  color: var(--text-main);
  box-shadow: var(--shadow-soft);
  border-radius: 0 0 10px 10px;
  padding: 6px 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 0.12s ease, transform 0.12s ease;
  z-index: 950;
}

.nav-dropdown:hover .nav-dropdown-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.nav-dropdown-item {
  display: block;
  padding: 7px 14px;
  color: var(--text-main);
  text-decoration: none;
  font-size: 14px;
}

.nav-dropdown-item:hover {
  background: var(--green-soft);
}

/* Backend version switcher */
.backend-version-switcher {
  position: fixed;
  top: calc(var(--header-height) + 10px);
  left: 10px;
  z-index: 1200;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 999px;
  padding: 4px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  font-size: 12px;
  font-weight: 500;
}

.backend-version-label {
  color: #111;
}

.backend-version-select {
  border: 0;
  background: transparent;
  font: inherit;
  color: #111;
  cursor: pointer;
  padding: 2px 4px;
  outline: none;
  appearance: none;
}

@media (max-width: 640px) {
  .backend-version-switcher {
    font-size: 10px;
    padding: 4px 8px;
    top: calc(var(--header-height) + 6px);
  }
}

/* ---------------------------------------------------
   Hauptinhalt & Footer
   --------------------------------------------------- */

#app {
  max-width: 1200px;
  margin: 20px auto 60px auto;
  padding: 0 20px 40px 20px;
  min-height: calc(100vh - var(--header-height) - var(--nav-height) - 120px);
}

#footer {
  background: var(--green-dark);
  color: #fff;
  padding: 20px;
  text-align: center;
  font-size: 14px;
}

.footer-links {
  margin-bottom: 6px;
}

.footer-links a {
  color: #fff;
  text-decoration: none;
  margin: 0 8px;
  font-size: 14px;
}

.footer-links a:hover {
  text-decoration: underline;
}

/* ---------------------------------------------------
   Typografie
   --------------------------------------------------- */

h1,
h2,
h3,
h4 {
  font-family: "Ubuntu", system-ui, sans-serif;
  margin-top: 1.4em;
  margin-bottom: 0.4em;
  font-weight: 500;
}

h1 {
  font-size: 28px;
}

h2 {
  font-size: 22px;
}

h3 {
  font-size: 18px;
}

p {
  margin-top: 0.5em;
  margin-bottom: 0.7em;
  color: var(--text-main);
}

ul {
  padding-left: 1.4em;
}

li {
  margin-bottom: 0.3em;
}

/* ---------------------------------------------------
   KI-Overlay & Chat-Overlay
   --------------------------------------------------- */

.hidden {
  display: none !important;
  pointer-events: none;
}

/* Wrapper, die in index.html existieren */

#overlay-ki-wrapper,
#overlay-chat-wrapper {
  position: fixed;
  top: calc(var(--header-height) + var(--nav-height) + 10px);
  z-index: 1000;
}

/* linkes Overlay (KI) */

#overlay-ki-wrapper {
  left: 20px;
}

/* rechtes Overlay (Chat) */

#overlay-chat-wrapper {
  right: 20px;
}

/* allgemeine Panel-Optik – Inhalt kommt aus overlay_*.html */

.ki-overlay,
.chat-overlay {
  width: 320px;
  max-height: 70vh;
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border-soft);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.ki-overlay-header,
.chat-overlay-header {
  padding: 8px 12px;
  background: var(--green-mid);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ki-overlay-body,
.chat-overlay-body {
  padding: 10px 12px 12px 12px;
  overflow-y: auto;
}

/* Close Buttons in Overlays */

.close-ki-btn,
.close-chat-btn {
  cursor: pointer;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 18px;
  line-height: 1;
}

/* ---------------------------------------------------
   Kontaktliste im Chat-Overlay
   --------------------------------------------------- */

.contact-wrapper {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
}

.contact-status {
  font-size: 13px;
  color: var(--text-muted);
}

.contact-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  padding-right: 4px;
}

.contact-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

.contact-toolbox {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-bottom: 6px;
}

.self-id-block {
  background: rgba(63, 143, 83, 0.12);
  border: 1px solid rgba(63, 143, 83, 0.35);
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.self-id-label {
  font-size: 12px;
  color: var(--text-muted);
}

.self-id-value {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-weight: 600;
}

.self-id-value span {
  font-size: 14px;
  word-break: break-all;
}

.self-id-copy-btn {
  border: none;
  background: rgba(21, 59, 44, 0.1);
  color: var(--green-dark);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}

.self-id-copy-btn:hover {
  background: rgba(21, 59, 44, 0.2);
}

.contact-search-form {
  display: flex;
  gap: 6px;
}

.contact-search-form input {
  flex: 1;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  padding: 6px 12px;
  font-size: 13px;
}

.contact-search-form button {
  border: none;
  border-radius: 999px;
  padding: 6px 14px;
  background: var(--green-mid);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.contact-search-feedback {
  font-size: 12px;
  color: var(--text-muted);
  min-height: 18px;
}

.contact-search-feedback.is-error {
  color: #b03a2e;
}

.contact-search-action {
  border: none;
  border-radius: 999px;
  padding: 6px 14px;
  background: #f7f7f7;
  color: var(--text-main);
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  text-align: center;
  border: 1px solid var(--border-soft);
}

.contact-search-action.hidden {
  display: none;
}

.contact-item-system {
  background: rgba(21, 59, 44, 0.08);
  border-color: rgba(21, 59, 44, 0.2);
  flex-direction: column;
  align-items: flex-start;
}

.contact-item-system .contact-info {
  gap: 2px;
}

.contact-system-action {
  margin-top: 6px;
  font-size: 12px;
  color: var(--green-dark);
  text-decoration: underline;
}

.contact-system-note {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

.group-manager {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.group-creator {
  display: flex;
  gap: 6px;
}

.group-creator input {
  flex: 1;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  font-size: 13px;
}

.group-creator button {
  border: none;
  border-radius: 999px;
  padding: 6px 14px;
  background: var(--green-mid);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.group-list-panel {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 160px;
  overflow-y: auto;
}

.group-card {
  border: 1px dashed var(--border-soft);
  border-radius: 12px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.group-empty {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

.group-card-header {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
}

.group-card-header .group-card-delete {
  background: transparent;
  border: none;
  color: #d9534f;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  padding: 0;
}

.group-card-header .group-card-delete:hover {
  color: #a42a2a;
}

.group-drop-zone {
  border: 1px dashed var(--border-soft);
  border-radius: 10px;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--text-muted);
  background: #f4f7f6;
  transition: border 0.2s ease, background 0.2s ease;
}

.group-drop-zone.drag-over {
  border-color: var(--green-mid);
  background: #e6faf0;
}

.chat-body-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-conversation {
  width: 100%;
  background: #f9f9f9;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 380px;
}

.chat-conversation.hidden {
  display: none !important;
}

.chat-conversation-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.chat-conversation-header button {
  background: transparent;
  border: none;
  font-size: 20px;
  cursor: pointer;
}

.chat-history {
  flex: 1;
  min-height: 120px;
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 6px;
}

.chat-message {
  padding: 8px 12px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.4;
  position: relative;
  max-width: 90%;
  word-break: break-word;
}

.chat-message.self {
  background: #d6f7df;
  align-self: flex-end;
}

.chat-message.partner {
  background: #fff;
  border: 1px solid var(--border-soft);
  align-self: flex-start;
}

.chat-message .meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.chat-form {
  display: flex;
  gap: 6px;
}

.chat-form input {
  flex: 1;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  padding: 8px 12px;
  font-size: 13px;
}

.chat-form button {
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  background: var(--green-mid);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.chat-conversation-status {
  font-size: 12px;
  color: var(--text-muted);
  min-height: 16px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 9px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.07);
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.08s ease;
}

.contact-item:hover {
  background: var(--green-soft);
  border-color: var(--green-light);
  transform: translateY(-1px);
}

.contact-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: #ddd;
}

.contact-info {
  display: flex;
  flex-direction: column;
}

.contact-name {
  font-size: 14px;
  font-weight: 500;
}

.contact-meta {
  font-size: 12px;
  color: var(--text-muted);
}

/* ---------------------------------------------------
   Kontakt-Kontextmenü
   --------------------------------------------------- */

.contact-context-menu {
  position: absolute;
  min-width: 180px;
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  padding: 6px 0;
  font-size: 14px;
  z-index: 1100;
}

.contact-context-menu.hidden {
  display: none;
}

.contact-context-menu button {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text-main);
  padding: 8px 14px;
  text-align: left;
  font-size: 14px;
  border-radius: 0;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s ease;
}

.contact-context-menu button + button {
  border-top: 1px solid var(--border-soft);
}

.contact-context-menu button:hover {
  background: var(--green-soft);
}

/* Eigenmarkierung */

.contact-meta.self {
  font-style: italic;
}

/* ---------------------------------------------------
   Responsives Verhalten
   --------------------------------------------------- */

@media (max-width: 900px) {
  .header-container {
    padding: 0 12px;
  }

  .header-title {
    font-size: 18px;
  }

  #app {
    padding: 0 12px 30px 12px;
  }

  #overlay-ki-wrapper,
  #overlay-chat-wrapper {
    top: calc(var(--header-height) + var(--nav-height) + 5px);
  }

  .ki-overlay,
  .chat-overlay {
    width: 280px;
  }
}

@media (max-width: 700px) {
  .header-container {
    flex-direction: column;
    align-items: flex-start;
    height: auto;
    padding: 6px 12px 8px 12px;
    gap: 6px;
  }

  .header-right {
    align-self: flex-end;
  }

  .nav-container {
    padding: 0 10px;
  }

  .nav-left {
    gap: 18px;
  }
}

/* ---------------------------------------------------
   Login Status
   --------------------------------------------------- */

.login-success {
  display: none;
  margin-top: 12px;
  padding: 6px 16px;
  border-radius: 999px;
  font-weight: 600;
  background: var(--green-soft);
  color: var(--green-dark);
  border: 1px solid var(--green-light);
  align-items: center;
  justify-content: center;
}

.login-success.is-visible {
  display: inline-flex;
}

.login-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}

.login-btn {
  padding: 10px 18px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  background: var(--green-dark);
  color: #fff;
  transition: background 0.15s ease, transform 0.1s ease;
}

.login-btn:hover {
  background: var(--green-mid);
  transform: translateY(-1px);
}

/* FILE: frontend_v4/assets/css/style.css (END) */
