@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;700&display=swap');

* {
  box-sizing: border-box;
}

body {
  font-family: 'DM Sans', sans-serif;
  margin: 0;
  padding: 0;
  color: #1C1C1C;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: url('HintergrundDesktop.png') no-repeat center center fixed;
  background-size: cover;
}

#header {
  position: fixed;
  top: 0;          /* Direkt oben am Rand */
  left: 0;
  width: 100%;
  padding: 20px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(11, 10, 10, 0.05);
  display: flex;
  align-items: center;
  z-index: 1500;
}

#logo {
  height: 40px;
}

#chatBox {
  flex: 1;
  padding: 90px 20px 100px;
  background: transparent;
  overflow-y: auto;
}

#chatContainer {
  display: flex;
  flex-direction: column;
}

.message-container {
  display: flex;
  flex-direction: column;
  margin: 10px 0;
  max-width: 70%;
}

.message-container.user {
  align-self: flex-end;
  width: 400px;
  margin: 10px 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.message.user {
  background: #AAE8E9;
  color: #202325;
  padding: 14px 18px;
  border-radius: 16px;
  font-size: 16px;
  line-height: 1.4;
  word-wrap: break-word;
  width: 100%;
  box-sizing: border-box;
}

.message-container.bot {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 12px;
  width: 460px;
  margin: 10px 0;
}

.bot-icon {
  width: 40px;
  height: 40px;
  background-image: url('Avatar.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  flex-shrink: 0;
}

.message.bot {
  background: #FAF7F6;
  color: #202325;
  padding: 14px 18px;
  border-radius: 16px;
  font-size: 16px;
  line-height: 1.4;
  word-wrap: break-word;
  width: calc(100% - 52px);
  box-sizing: border-box;
}

.timestamp {
  font-size: 12px;
  color: #999;
  margin-top: 4px;
  padding: 0 10px;
}

.timestamp.user {
  align-self: flex-end;
}

.timestamp.bot {
  align-self: flex-start;
}

#inputContainer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px 20px;
  background: #ffffff;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
  gap: 12px;
  z-index: 1001;
}

#textInput {
  flex: 1;
  max-width: 500px;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid #ccc;
  font-size: 16px;
  line-height: 1.4;
  outline: none;
  resize: none;
  font-family: 'DM Sans', sans-serif;
  overflow: hidden;
}

#textInput:focus {
  border-color: #00B4B0;
}

#sendButton {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #00B4B0;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

#sendButton:hover {
  background: #009a98;
}

#sendButton img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  display: block;
  margin: auto;
  pointer-events: none;
}

.typing-indicator {
  display: flex;
  gap: 6px;
  background: #FAF7F6;
  padding: 14px 18px;
  border-radius: 16px;
  font-size: 16px;
  color: #202325;
  width: auto;
  max-width: 100px;
  align-items: center;
  flex-wrap: nowrap;
}

.typing-indicator span {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #999;
  border-radius: 50%;
  animation: bounce 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) { animation-delay: 0s; }
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

.avatar2 {
  display: none;
}

.zurück {
  display: none;
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: auto;
  cursor: pointer;
}

@media (max-width: 800px) {
  body {
    background: url('HintergrundHandy.png') no-repeat center center fixed;
    background-size: cover;
  }

  .message-container.user,
  .message-container.bot {
    max-width: 85%;
  }

  .message.bot,
  .message.user {
    width: 100%;
  }

  #header {
    top: 0px;
    padding: 20px;
    background: white;
    box-shadow: 0 2px 10px rgba(11, 10, 10, 0.05);
    display: flex;
    align-items: center;
    z-index: 1500;
  }

  #logo {
    display: none !important;
  }

  .avatar2 {
    display: block;
    width: 140px;
    height: auto;
    margin: 3px auto 0 auto;
    position: relative;
    z-index: 1510;
  }

  .zurück {
    display: block;
    width: 65px;
    height: auto;
    position: absolute;
    left: 20px;
    top: 40px;
    z-index: 1510;
  }

  #chatBox {
    padding: 130px 16px 90px;
  }

  #textInput {
    font-size: 14px;
    padding: 10px 12px;
  }

  #sendButton {
    width: 40px;
    height: 40px;
  }
}

.chat-date {
  text-align: center;
  font-size: 14px;
  color: #999;
  margin: 20px auto 10px;
  font-style: normal;
}
