:root {
  --app-height: 100dvh; /* iPhone Fix */
}

/* BODY */
body {
  margin: 0;
  font-family: system-ui, sans-serif;
  background: #e6f2ff;
  height: var(--app-height);
  overflow: hidden;
}

/* LOGIN */
#loginScreen {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  padding: 25px;
  border-radius: 14px;
  width: 300px;
  text-align: center;
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
}

#loginScreen input,
#loginScreen button {
  width: 100%;
  padding: 12px;
  margin-top: 12px;
  border-radius: 8px;
}

/* SIDEBAR OVERLAY (MOBILE) */
#sidebarOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 9999;
  display: none;
  align-items: flex-start;
  opacity: 0;
  transition: opacity 0.25s ease;
}

#sidebarOverlay:not(.hidden) {
  display: flex;
  opacity: 1;
}

/* SIDEBAR SLIDE ANIMATION */
#sidebar {
  transform: translateX(-260px);
  transition: transform 0.25s ease;
}

#sidebarOverlay:not(.hidden) #sidebar {
  transform: translateX(0);
}


.hidden {
  display: none !important;
  pointer-events: none !important;
}

/* MOBILE SIDEBAR */
#sidebar {
  width: 260px;
  height: 100%;
  background: white;
  padding: 15px;
  overflow-y: auto;
  box-shadow: 4px 0 10px rgba(0,0,0,0.2);
}

/* DESKTOP SIDEBAR */
#sidebarDesktop {
  width: 260px;
  background: white;
  border-right: 2px solid #d0e4ff;
  padding: 10px;
  overflow-y: auto;
  display: none;
}

@media (min-width: 1100px) {
  #sidebarDesktop {
    display: block;
  }
  #openSidebarBtn {
    display: none;
  }
}

/* USER LIST */
.user-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  cursor: pointer;
  font-size: 18px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: gray;
}

.status-dot.online {
  background: #00c400;
}

.redDot {
  color: red;
  font-size: 16px;
  margin-left: 6px;
  display: none;
}

/* CHAT SCREEN */
#chatScreen {
  height: var(--app-height);
  display: flex;
  overflow: hidden;
}

/* CHAT AREA */
#chatArea {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: var(--app-height);
  overflow: hidden;
}

/* HEADER */
#chatHeader {
  display: flex;
  align-items: center;
  padding: 12px;
  background: white;
  border-bottom: 2px solid #d0e4ff;
  gap: 12px;
}

#openSidebarBtn {
  width: 48px;
  height: 48px;
  font-size: 28px;
  border: none;
  background: none;
  cursor: pointer;
}

.recordBtnHeader {
  font-size: 22px;
  background: none;
  border: none;
  cursor: pointer;
  margin-left: auto;
  margin-right: 10px;
}

.deleteBtn {
  font-size: 22px;
  background: none;
  border: none;
  cursor: pointer;
}

#chatAvatar {
  font-size: 32px;
}

#chatTitle {
  font-size: 20px;
  font-weight: bold;
}

#chatSubTitle {
  font-size: 14px;
  color: #666;
  margin-top: 2px;
}

/* MESSAGES */
#messages {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 90px; /* Platz für Input */
}

/* BUBBLES */
.bubble {
  display: inline-block;
  width: fit-content;
  max-width: 75%;
  padding: 10px 14px;
  border-radius: 16px;
  margin: 4px 0;
  font-size: 16px;
  word-wrap: break-word;
  line-height: 1.4;
}

.bubble.them {
  background: #ffffff;
  border: 1px solid #e5e5e5;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.bubble.me {
  background: #d1f1ff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.bubble img {
  max-width: 180px;
  border-radius: 8px;
}

/* INPUT AREA */
#inputArea {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;

  display: flex;
  gap: 6px;
  padding: 10px;
  background: #fff;
  border-top: 1px solid #ddd;

  z-index: 5000;
}

#messageInput {
  flex: 1;
}

#fileBtn {
  width: 40px;
}

#sendBtn {
    background: #4da3ff;          /* schöne Messenger-Farbe */
    color: white;
    border: none;
    border-radius: 50%;           /* macht ihn rund */
    width: 46px;
    height: 46px;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 20px;              /* Icon-Größe */
    cursor: pointer;

    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    transition: background 0.2s ease, transform 0.15s ease;
}

#sendBtn:hover {
    background: #1f8bff;
    transform: scale(1.05);
}

#sendBtn:active {
    transform: scale(0.95);
}

/* iPhone Zoom Fix */
input, button, select, textarea {
  font-size: 16px !important;
}
/* PUSH POPUP */
#pushPopup {
    position: fixed;
    top: 20px;
    right: 20px;

    background: #ffffff;
    border-radius: 14px;
    padding: 12px 16px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.15);

    display: flex;
    align-items: center;
    gap: 12px;

    font-size: 16px;
    color: #2a4d7a;

    opacity: 0;
    pointer-events: none;
    transform: translateY(-20px);
    transition: opacity 0.25s ease, transform 0.25s ease;

    z-index: 99999;
}

#pushPopup.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

#pushPopupAvatar {
    font-size: 26px;
    background: #eef5ff;
    padding: 6px;
    border-radius: 50%;
}
.deleteMsgBtn {
  background: none;
  border: none;
  color: #c00;
  font-size: 14px;
  cursor: pointer;
}

.deleteMsgBtn:hover {
  color: red;
}

.bubble-delete {
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.deleteMsgBtn {
  background: none;
  border: none;
  color: #c00;
  font-size: 14px;
  cursor: pointer;
}

.deleteMsgBtn:hover {
  color: red;
}

.downloadBtn {
  background: none;
  border: none;
  color: #0077ff;
  font-size: 16px;
  cursor: pointer;
}

.downloadBtn:hover {
  color: #0055cc;
}

.bubble-delete {
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.deleteMsgBtn {
  background: none;
  border: none;
  color: #c00;
  font-size: 14px;
  cursor: pointer;
}

.deleteMsgBtn:hover {
  color: red;
}

.downloadBtn {
  background: none;
  border: none;
  color: #0077ff;
  font-size: 16px;
  cursor: pointer;
}

.downloadBtn:hover {
  color: #0055cc;
}

.bubble-delete {
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.deleteMsgBtn {
  background: none;
  border: none;
  color: #c00;
  font-size: 14px;
  cursor: pointer;
}

.deleteMsgBtn:hover {
  color: red;
}

.downloadBtn {
  background: none;
  border: none;
  color: #0077ff;
  font-size: 16px;
  cursor: pointer;
}

.downloadBtn:hover {
  color: #0055cc;
}

.bubble-delete {
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.deleteMsgBtn {
  background: none;
  border: none;
  color: #c00;
  font-size: 14px;
  cursor: pointer;
}

.deleteMsgBtn:hover {
  color: red;
}

.downloadBtn {
  background: none;
  border: none;
  color: #0077ff;
  font-size: 16px;
  cursor: pointer;
}

.downloadBtn:hover {
  color: #0055cc;
}

.bubble-delete {
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

