/* style.css - minimal WhatsApp-like layout */
:root {
  --sidebar-w: 320px;
  --primary: #0b84ff;
  --bg: #f3f4f6;

  --bg: #0f1724;
  /* deep navy */
  --card: #0b1220;
  --accent: #06b6d4;
  /* teal */
  --muted: #94a3b8;
  --glass: rgba(255, 255, 255, 0.04);
  --success: #10b981;
}



* {
  box-sizing: border-box;
}

body,
html,
#app {
  height: 100%;
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial;
  /* background: var(--bg); */
  color: #111827;
  font-size: 14px
}

.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: #fff;
  border-right: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  z-index: 99;
}



.sidebar-header {
  padding: 10px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #eee;
  gap: 20px;

}

.search-bar {
  width: 100%;
  ;
}

.brand {
  font-weight: 700;
  font-size: 18px;
}

.user-info {
  font-size: 12px;
  color: #6b7280;
}

/* .search {
  padding: 10px;
  border-bottom: 1px solid #f3f4f6;
} */

.search input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
}

.groups {
  flex: 1;
  overflow: auto;
      flex: 1;
    overflow: auto;
    background-image: url(static/pattern_bg.webp);
    background-size: 50%;
}

.group {
  padding: 12px 16px;
  border-bottom: 1px solid #f3f4f6;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.group:hover {
  background: #f8fafc;
}

.group.selected {
  background: #eef2ff;
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid #eee;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

/* Chat area */
.chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.chat-header {
    padding: 12px 12px;
    background: #272847;
    border-bottom: 1px solid #FF9800;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 99;
}

button#logoutBtn {
  font-size: 20px;
  color: red;
  border: 1px solid #ddd;
  border-radius: 55px;
  width: 40px;
  height: 40px;
  background: #ffdfdf;
  text-align: center;
  display: flex;
  align-items: center;
  cursor: pointer;
}

#messages {
  display: block;
  z-index: 99;
}

.messages {
  flex: 1;
  overflow: auto;
  padding: 16px;
  display: flex;
  flex-direction: inherit;
  /* flex-direction: column-reverse; */
  gap: 10px;
  position: relative;
  /* background: #f7f5f3; */
  z-index: 0;
}

.messages::before {
  content: "";
  /* position: absolute; */
  position: fixed;
  inset: 0;
  background-image: url(static/chat-bg.png);
  /* background-size: cover; */
  opacity: 0.1;
  background-color: #ffd493;
}

.message {
  /* max-width: 70%; */
  /* max-width: fit-content;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.03);
  margin: 1% auto 1% 0; */

  background: #ffffff;
  margin-bottom: 10px;
  padding: 5px 10px;
  border-radius: 10px;
  width: fit-content;
  max-width: 100%;
}

.message.me {
    background: #ffe6c0;
  color: #000000;
  margin: 1% 0 1% auto;
}

.message.me .message {
  background: #2368b2;
}

.message .meta {
  font-size: 11px;
  color: #6b7280;
  margin-bottom: 0px;
}

.message.me .meta {
  font-size: 11px;
  color: #000000;
  margin-bottom: 0px;
}

.message img {
  max-width: 250px;
  max-height: 300px;
  display: block;
  border-radius: 8px;
  margin-top: 6px;
}

/* Composer */
.composer {
  display: flex;
  align-items: center;
  /* flex-direction: column; */
  gap: 8px;
  padding: 8px;
  border-top: 1px solid #ddd;
  margin: 10px;
  border-radius: 45px;
}

.composer input {
  flex: 1;
  padding: 10px 12px;
  border-radius: 20px;
  border: 1px solid #e5e7eb;
}


#recordAudioBtn,#recordVideoBtn{
  /* background: radial-gradient(#52c3df, transparent); */
}


video {
        max-width: 250px;
}

.composer button {
    background: var(--primary);
    color: #272847;
    border: none;
    padding: 5px 5px;
    border-radius: 12px;
    cursor: pointer;
}

#attachBtn {
  cursor: pointer;
  font-size: 30px;
  padding: 0px;
  color: #000;
}

.group-icon {
  height: 40px;
  width: 40px;
  background: #f7f5f3;
  border: 1px solid #ddd;
  border-radius: 35px;
  text-align: center;
  padding: 5px 0 0 0;
}

.group-user-icon {
  width: 25px;
  height: 25px;
}

input:focus-visible {
  outline: none;
  border: none;
}

.login-logo {
    width: 40%;
    margin: 0px auto 30px auto;
    display: block;
}

#authTitle {
  text-align: center;
  font-size: 22px;
  font-weight: 600;
  margin: 6px 0 15px 0;
}


.form-actions button {
  cursor: pointer;
  border: none;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 10px;
  background-color:  #252746;
  color: white;
  text-align: center;
  box-shadow: 0 8px 24px rgba(255, 120, 40, 0.14);
  transition: transform .12s ease, box-shadow .12s ease;
  width: 180px;
  display: block;
}

/* minimal styles for modal (add more to style.css if you want) */
.auth-modal {
  position: fixed;
  inset: 0;
  /* background: #fcf5eb; */
  background-image: url(static/login-bg.png);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.auth-box {
  width: 30%;
  position: relative;
  padding: 20px 20px;
  background: linear-gradient(180deg, rgb(255 255 255), rgb(255 255 255));
  border-radius: 16px;
  box-shadow: 0 10px 30px rgb(2 6 23 / 11%);

}

.auth-box:before {
    width: 148px;
    height: 148px;
    content: " ";
    position: absolute;
    top: -40px;
    right: -40px;
    background-image: url(static/login-sap.svg);
        z-index: -1;
}

.auth-box:after {
    width: 243px;
    height: 240px;
    content: " ";
    position: absolute;
    bottom: -68px;
    left: -46px;
     background-image: url(static/login-sap.svg);
         z-index: -1;
}

.auth-box #closeAuth {
  position: absolute;
  right: 8px;
  top: 8px;
  background: none;
  border: none;
  font-size: 18px;
}

.hidden {
  display: none !important;
}

.form-row {
  margin-bottom: 10px;
}

.form-row label {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
  color: #333;
  font-weight: 500;
}

.form-row input {
  /* width: 100%;
  padding: 14px 14px;
  border-radius: 14px;
  border: 1px solid #ddd; */

  width: 100%;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid rgba(120, 120, 120, 0.12);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(250, 250, 250, 0.99));
  font-size: 14px;
  outline: none;
  transition: box-shadow .18s ease, border-color .18s ease, transform .08s ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.form-row input::placeholder {
  color: #c9c9c9
}

/* focus style */
.form-row input:focus {
    border-color: rgb(37 39 70);
    box-shadow: 0 6px 20px rgb(37 39 70 / 10%);
    transform: translateY(-1px);
}

.form-actions {
  display: flex;
  gap: 8px;
  margin-top: 30px;
  align-items: center;
  justify-content: center;
}



.small-btn {
  background: #ef4444;
  font-size: 13px;
  border: none;
  color: white;
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  transition: 0.3s;
}

.small-btn:hover {
  opacity: 0.95;
}

.group {
  padding: 12px 16px;
  border-bottom: 1px solid #f3f4f6;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.group.selected {
  background: #eef2ff;
}

.view-members-btn {
  border: none;
  font-size: 12px;
  cursor: pointer;
  transition: 0.3s;
  background: #00b894;
  color: #fff;
  border-radius: 29px;
  padding: 5px 5px;
}

.delete-group-btn {
  border: none;
  border-radius: 29px;
  padding: 5px 5px;
  font-size: 12px;
  cursor: pointer;
  transition: 0.3s;
  background: #ff4d4d;
  color: white;
}

.composer {
  background: #ffffff;
  border: 1px solid #e1e1e1;
  display: flex;
  align-items: center;
  padding: 5px 20px;
  gap: 8px;
  z-index: 9;
  margin: 0 10px 10px 10px;
}

.composer input[type="text"],
.composer input[type="email"],
#messageInput {
  flex: 1;
  border: 1px solid #ffffff;
  border-radius: 20px;
  padding: 8px 12px;
}

.composer button {
    border: none;
    background: none;
    font-size: 17px;
    cursor: pointer;
}

/* #recordAudioBtn {
    border: 1px solid #FF5722;
    padding: 4px 5px 5px 5px;
    font-size: 13px;
    color: #272847;
    border-radius: 5px;
} */

#sendBtn {
  color: #0b84ff;
  font-weight: bold;
}

.app-logo {
  width: 35%;
}

/* /////////////////////////////////////////////////// */

#newGroupBtn {
  display: inline-block;
      border: 1px solid rgb(233 159 34) !important;
      background-color: rgb(37 39 70) !important;
      color: rgb(255, 255, 255) !important;
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  transition: 0.3s;
}

.group-main-item:hover {
    background: rgb(255 243 225);
  /* transform: translateY(-2px); */
}

.group-main-item {
  background: rgba(255, 255, 255, 0.6);
  margin: 8px 0;
  padding: 12px 15px;
  /* border-radius: 10px; */
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.search-group {
  margin: 5px;
}

.Group-Members-modal {
  position: fixed;
  inset: 0;
  background: #0000006b;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #ddd;
  padding: 0 0 15px 0;

  h3 {
    margin: 0px;

  }
}

.Group-Members-auth-box {
  width: 30%;
  position: relative;
  padding: 15px 15px;
  background: linear-gradient(180deg, rgb(255 255 255), rgb(255 255 255));
  border-radius: 16px;
  box-shadow: 0 10px 30px rgb(2 6 23 / 11%);
}

.close-btn {
  background: #f2f3f5;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
}

.close-footer-btn {
  background: #f1f3f5;
  border: none;
  border-radius: 6px;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 500;
}

#addMemberConfirm {
  background: rgb(11, 132, 255);
  color: rgb(255, 255, 255);
  border: none;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-block;
}


input#addMemberSearch {
  width: 100%;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid rgba(120, 120, 120, 0.12);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(250, 250, 250, 0.99));
  font-size: 14px;
  outline: none;
  transition: box-shadow .18s ease, border-color .18s ease, transform .08s ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  margin: 5% 0 0% 0;
}

input#addMemberSearch::placeholder {
  color: #c9c9c9
}

/* focus style */
input#addMemberSearch:focus {
  border-color: rgba(255, 122, 26, 0.95);
  box-shadow: 0 6px 20px rgba(255, 122, 26, 0.12);
  transform: translateY(-1px);
}

.search input:focus {
  width: 100%;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
}

.selected-group-name {
background: #ffffff00;
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 99;
    color: white;
}

.user-id {
padding: 2px 0 2px 10px;
    background: #a6a7b43d;
    color: #272847;
        border-bottom: 1px solid #ff9e005c;
    border-top: 1px solid #ff9e005c;
  h5 {
    margin: 0;
  }

  p {
            margin: 0;
        color: #ff9d00;
        font-weight: 600;
  }


}

#mentionPopup {
  position: fixed !important;
  display: block;
  z-index: 9999;
  background: rgb(255, 255, 255);
  border: 1px solid rgb(221, 221, 221);
  border-radius: 6px;
  max-height: 200px !important;
  overflow: hidden !important;
  left: 25% !important;
  top: auto !important;
  bottom: 8% !important;
  min-width: min-content !important;
}

/* /////////////////////// login page /////////////////////////*/

/* Reaction / hover bar */
.message-wrapper {
  position: relative;
  margin: 6px 0;
}

.message-bubble {
  position: relative;
  /* z-index: 1; */
}

.hover-reaction-bar {
  position: absolute;
  top: -30px;
  left: 8px;
  display: flex;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
  transform: translateY(6px);
  opacity: 0;
  pointer-events: none;
  transition: all 0.12s ease;
  z-index: 999;
}

.message-wrapper:hover .hover-reaction-bar,
.hover-reaction-bar.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.hover-reaction-bar .hover-react-emoji {
  background: transparent;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  border-radius: 50%;
}

.hover-react-emoji.react-clicked {
  transform: scale(1.25);
  transition: transform .12s ease;
}

/* reactions container */
.reactions-container {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 6px;
}

.reaction-item {
  transition: all .12s ease;
  border: 1px solid rgba(0, 0, 0, 0.04);
  background: #fff;
}

.reaction-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.06);
}

/* highlight when current user reacted */
.reaction-active {
  box-shadow: 0 0 0 2px rgba(11, 132, 255, 0.12);
  border-color: rgba(11, 132, 255, 0.18);
}

.react-clicked {
  transform: scale(1.18);
  transition: transform .12s ease;
}


/* Reaction bar (hidden by default; shown on message hover) */
.reaction-bar {
  display: none;
  position: absolute;
  left:0;
  transform: translateX(-50%);
  top: 0px;
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  border-radius: 22px;
  padding: 6px 8px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  z-index: 9999;
  display: flex;
  gap: 6px;
  align-items: center;
  pointer-events: auto;
  font-size: 18px;
}

/* Reaction button (emoji) */
.reaction-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 18px;
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: #fff;
  font-size: 18px;
}

.reaction-btn:hover {
  background: rgba(255, 255, 255, 0.06);
}

/* Reaction count badge next to emoji */
.reaction-count {
  font-size: 12px;
  margin-left: 6px;
  background: rgba(0, 0, 0, 0.25);
  padding: 2px 6px;
  border-radius: 12px;
  color: #fff;
}

/* Container for reactions under message (static, always visible small chips) */
.reaction-row {
  margin-top: 6px;
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 14px;
}

/* Reaction chip style when shown under message */
.reaction-chip {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 4px 8px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.06);
  color: #111;
  border: 1px solid rgba(0, 0, 0, 0.04);
  font-size: 13px;
}

.reaction-chip .count {
  font-weight: 600;
  margin-left: 6px;
  font-size: 12px;
  color: #333;
}

.message-bubble.message.me.add_remove_box,
.message-bubble.message.add_remove_box {
  margin: 0px auto;
  background: #ffffff91;
  font-size: 10px;
  border: 1px solid #e3e3e3;
  display: flex;
  align-items: center;
  gap: 10px;

}

.message-bubble.message.add_remove_box,
.message-bubble.message.add_remove_box {
  margin: 0px auto;
  background: #ffffff91;
  font-size: 10px;
  border: 1px solid #e3e3e3;
  display: flex;
  align-items: center;
  gap: 10px;

}

.message-bubble.message.add_remove_box div.meta-controls {
  display: none !important;
}

.group-menu-btn {
  color: #6b7280;
  background: transparent;
  border: none;
}

.group-menu-dropdown .group-menu-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 6px;
}

.group-main-item {
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.group-main-item.selected {
  background:#fff3e1;
}



.msg-menu.me-menu {

  position: absolute !important;
  right: 0px !important;
  top: 22px !important;
  min-width: 140px !important;
  background: rgb(255, 255, 255) !important;
  color: rgb(0, 0, 0) !important;
  border-radius: 8px;
  box-shadow: rgba(0, 0, 0, 0.22) 0px 6px 18px !important;
  z-index: 9999 !important;
  padding: 6px 4px !important;
  font-size: 13px !important;
}

.me-reply {
    border-left: 3px solid #ff9900;
    font-size: 13px;
    color: #000000;
    background: #ffc875;
    padding: 4px 7px 7px 7px;
    border-radius: 5px;
    position: relative;
    left: -7px;
}

.you-reply {
border-left: 3px solid #acacac;
    font-size: 13px;
    color: #000000;
    background: #f4f4f4;
    padding: 4px 7px 7px 7px;
    border-radius: 5px;
    position: relative;
    left: -7px;
}

.body-text {
    font-size: 13px;
    font-weight: 500;
    padding: 3px 0 5px 0;
}


/* place static chips below the message */
.reactions-wrapper {
  display: flex;
  flex-direction: column;
  align-items: flex-end; /* chips align to right of message bubble */
  position: relative;    /* used as anchor for absolute bar */
  margin-top: 6px;
}

/* floating emoji bar (positioned absolute; we'll compute coords in JS) */
.reaction-bar {
  display: none;
  position: absolute;
  z-index: 9999;
  gap: 6px;
  padding: 6px;
  border-radius: 20px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.14);
  background: #ffffff;
  align-items: center;
  transition: opacity .12s ease;
  pointer-events: auto;
}

/* small button styles inside bar */
.reaction-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 18px;
  padding: 4px;
  line-height: 1;
}
.reaction-btn:focus {
  outline: 2px solid rgba(11,132,255,0.18);
  border-radius: 8px;
}

/* static chips (shown under message) */
.reaction-row {
  display: none; /* visible when chips exist */
  gap: 6px;
  margin-top: 6px;
  align-items: center;
}
.reaction-chip {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 4px 8px;
  border-radius: 16px;
  border: 1px solid #eee;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
}


.message-bubble.message.me div.reactions-wrapper > div.reaction-bar {
    left: -50px;
}

.message-bubble.message div.reactions-wrapper > div.reaction-bar {
    left: 100px;
}


.message-bubble.message div.reactions-wrapper {
  align-items: self-start;
}

/* ===== Document container ===== */
.message-wrapper a[href*=".pdf"],
.message-wrapper a[href*=".PDF"],
.message-wrapper a[href*=".doc"],
.message-wrapper a[href*=".docx"] {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: #111b21;
  border-radius: 8px;
  color: #e9edef;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

/* File icon */
.message-wrapper a[href*=".pdf"]::before,
.message-wrapper a[href*=".PDF"]::before,
.message-wrapper a[href*=".doc"]::before,
.message-wrapper a[href*=".docx"]::before {
  content: "📄";
  font-size: 22px;
  flex-shrink: 0;
}

/* Replace "Download" text with cleaner label */
.message-wrapper a[href*="Download"] {
  font-size: 0;
}

.message-wrapper a[href*="Download"]::after {
  content: "Download document";
  font-size: 14px;
}

.active{
                flex: 1 1 0%;
      padding: 8px 0;
      border-radius: 6px;
      border: 1px solid rgb(233 159 34) !important;
      background-color: rgb(37 39 70) !important;
      color: rgb(255, 255, 255) !important;
      cursor: pointer;
      font-size: 13px;
}
.staffbtn{
  flex: 1;
      padding: 8px 0;
      border-radius: 6px;
      border: 1px solid #ddd;
      background-color: #fff;
      color: #111;
      cursor: pointer;
      font-size: 13px;
}

.usertoken-btn{
  flex: 1;
      padding: 8px 0;
      border-radius: 6px;
      border: 1px solid #ddd;
      background-color: #fff;
      color: #111;
      cursor: pointer;
      font-size: 13px;
}

.join-token-btn{
  flex: 1;
      padding: 8px 0;
      border-radius: 6px;
      border: 1px solid #ddd;
      background-color: #fff;
      color: #111;
      cursor: pointer;
      font-size: 13px;
}


.stopcolor{
  color: red;
}