#chatScreen,
#chatsScreen {
  position: fixed;
  inset: 0;
  z-index: 1000000;
  display: none;
}

#chatScreen.active,
#chatsScreen.active {
  opacity: 1;
}




#openChatsBtn {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 8px);
  width: 55px;
  height: 55px;
  border-radius: 999px;
  pointer-events: auto;
}

.chat-item {
  padding: 18px 20px;
  border-radius: 999px;
  cursor: pointer;
  user-select: none;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  transition: all 0.2s ease;
}

.chat-item:active {
  transform: scale(0.98);
}

.chat-item.active {
  font-weight: 600;
}

.chat-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-title-input {
  flex: 1;
  height: 36px;
  border-radius: 999px;
  padding: 0 14px;
  font-size: 15px;
  border: none;
  background-color: transparent;
  outline: none;
}

.chat-edit-btn,
.chat-delete-btn,
.chat-share-btn {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chat-edit-btn .material-symbols-outlined,
.chat-delete-btn .material-symbols-outlined,
.chat-share-btn .material-symbols-outlined {
  font-size: 22px;
}



#openChatsBtn {
  right: 14px;
}

.chatgpt-body {
  position: fixed;
  inset: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
}

#newChatBtn2{
    position: fixed;
    pointer-events: auto;
    top: calc(env(safe-area-inset-top, 0px) + 8px);
    width: 55px;
    height: 55px;
    border-radius: 999px;
    right: 20px;
}

.chatgpt-messages {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: calc(env(safe-area-inset-top, 0px) + 80px) 14px 160px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.chatgpt-composer {
  position: fixed;
  bottom: 10px;
  left: 0;
  right: 0;
  padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  background-color: transparent;
  z-index: 100001;
  pointer-events: auto;
}

.chatgpt-actions-row {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 55px;
  margin-bottom: 5px;
  padding-left: 14px;
  padding-right: 14px;
  box-sizing: border-box;
}

.chatgpt-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 999px;
}

.chatgpt-action-text {
  font-size: 14px;
  font-weight: 500;
}

.chatgpt-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding-left: 14px;
  padding-right: 14px;
  box-sizing: border-box;
}


.chatgpt-input {
  flex: 1;
  min-height: 45px;
  height: auto;
  border-radius: 50px;
  font-size: 16px;
  line-height: 1.4;
  resize: none;
  overflow-y: auto;
}


.chatgpt-input:focus {
  outline: none;
}


.chatgpt-send {
  width: 55px;
  height: 55px;
  min-width: 50px;
  min-height: 50px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chatgpt-send:active {
  transform: scale(0.92);
}

.chatgpt-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.chat-message {
  padding: 14px 18px;
  border-radius: 24px;
  word-wrap: break-word;
  word-break: break-word;
  line-height: 1.6;
  
  font-size: 15px;
  max-width: 85%;
}

.chat-user {
  align-self: flex-end;
  background-color: rgba(196, 9, 9, 0.62);
  border-bottom-right-radius: 6px;
}

.chat-ai {
  align-self: flex-start;
  max-width: 100%;
  background-color: transparent;
  border: none;
  border-bottom-left-radius: 6px;
}

.chat-loading {
  opacity: 0.7;
}

.chat-loading::after {
  content: '...';
  animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
  0%, 20% { content: '.'; }
  40% { content: '..'; }
  60%, 100% { content: '...'; }
}


.chat-empty {
  margin-top: 100px;
  left: 50%;
  position: absolute;
  transform: translate(-50%);
  opacity: 0;
  text-align: center;
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 5;
  animation: bounceIn 1s ease forwards;
}

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: translate(-50%, -50px);
  }
  50% {
    transform: translate(-50%, 10px);
  }
  100% {
    opacity: 0.6;
    transform: translate(-50%, 0);
  }
}

/* Icon dreht sich rein */
.chat-empty .material-symbols-outlined {
  animation: rotateIn 0.8s ease forwards;
  animation-delay: 0.3s;
  opacity: 0;
}

@keyframes rotateIn {
  0% {
    opacity: 0;
    transform: rotate(-180deg) scale(0);
  }
  100% {
    opacity: 1;
    transform: rotate(0) scale(1);
  }
}

.chat-empty .material-symbols-outlined {
  font-size: 80px;
  margin-bottom: 16px;
}

.empty-title {
  font-size: 22px;
  font-weight: 600;
  margin: 4px 0;
}

.empty-subtitle {
  font-size: 16px;
  margin: 2px 0;
}



.chatlist-body {
  position: fixed;
  inset: 0;
  padding-left: 14px;
  padding-right: 14px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.chatlist-items {
  display: flex;
  margin-top: 100px;
  flex-direction: column;
  gap: 15px;
}

.chat-item {
  padding: 18px 20px;
  border-radius: 999px;
  cursor: pointer;
  user-select: none;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all 0.2s ease;
}

.chat-item:active {
  transform: scale(0.98);
}

.chat-item.active {
  font-weight: 600;
}

body.chat-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
  height: 100%;
}

@supports (-webkit-touch-callout: none) {
  .chatgpt-composer {
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  }
}


#deleteAllChatsBtn{
position: fixed;
top: calc(env(safe-area-inset-top, 0px) + 8px);
right: 80px;
width: 55px;
height: 55px;
border-radius: 999px;
pointer-events: auto;
}



#hadafaicontainer {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  display: flex;
  gap: 10px;
  z-index: 100;
}

#chatBtn,
#continueChatBtn {
  width: calc(50% - 5px);
  height: 55px;
  border-radius: 30px;
  background: rgba(239, 68, 68, 0.15);
  border: 2px solid rgba(239, 68, 68, 0.35);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: bold;
  padding: 0 15px;
}

#chatBtn {
  animation: float 2s ease-in-out infinite;
  justify-content: flex-start;
  gap: 10px;
}

#chatBtn img {
  width: 55px;
  height: 55px;
  object-fit: contain;
}


#emptyImage {
  width: 150px;
  height: 150px;
}
