/* =========================================================
   SHADOW - AUTH (Login)
   Works with your login.html (auth-body / auth-wrap / auth-*)
   ========================================================= */

:root{
  /* global */
  --bg: #f6f7fb;
  --panel: #ffffff;
  --line: rgba(15, 23, 42, .08);
  --muted: #667085;
  --text: #0f172a;

  /* auth */
  --auth-bg: #f5f6fb;
  --auth-card-bg: #ffffff;
  --auth-shadow: 0 10px 30px rgba(0,0,0,.06);
  --auth-icon-bg: #f1f3f5;
  --auth-btn: #111111;
  --auth-btn-hover: #000000;

  /* chat */
  --pill: #eef2f6;
  --bubble-left: #0b0b0b;
  --bubble-left-text: #ffffff;

  --bubble-right: #eef2f6;
  --bubble-right-text: #0f172a;

  --send-btn: #0b0b0b;
  --send-btn-hover: #000000;

  --online: #22c55e;
  --offline: #9aa0a6;
}

html, body { height: 100%; }

/* -------------------------
   AUTH PAGE
-------------------------- */
.auth-body{
  background: var(--auth-bg);
  color: var(--text);
}

.auth-wrap{
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 32px 0;
}

.auth-logo{
  height: 44px;
  width: auto;
  display: inline-block;
}

.auth-card{
  background: var(--auth-card-bg);
  border-radius: 12px;
  box-shadow: var(--auth-shadow);
}

.auth-title{
  font-weight: 600;
  letter-spacing: .2px;
}

/* Input group like screenshot */
.auth-input{
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.auth-icon{
  width: 52px;
  justify-content: center;
  background: var(--auth-icon-bg);
  border: 0;
  color: #6b7280;
}

.auth-field{
  border: 0;
  padding: 12px 14px;
  font-size: 14px;
  background: transparent;
}

.auth-field:focus{
  box-shadow: none;
  outline: none;
}

.auth-input:focus-within{
  border-color: rgba(17,17,17,.35);
  box-shadow: 0 0 0 3px rgba(17,17,17,.08);
}

/* Black submit button */
.auth-btn{
  background: var(--auth-btn);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 12px 14px;
  font-weight: 600;
}

.auth-btn:hover{
  background: var(--auth-btn-hover);
  color: #fff;
}

/* -------------------------
   AUTH ERROR STYLING
-------------------------- */
.auth-error {
  border: 1px solid #f03d3060;
  background: #f03d3014;
  color: #f03d30;
  border-radius: 10px;
  padding: 12px 12px;
}

.auth-error-inner {
  display: flex;
  gap: 10px;
  align-items: center;
}

.auth-error-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(220, 53, 69, 0.14);
  color: #f03d30;
  flex: 0 0 auto;
  font-size: 18px;
}

.auth-error-text {
  font-size: 14px;
  line-height: 1.35;
  font-weight: 600;
}

.auth-field.is-invalid,
.auth-input.is-invalid {
  border-color: rgba(220, 53, 69, 0.5) !important;
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.10);
}

/* =========================================================
   SHADOW CHAT UI (your existing chat styles kept)
   ========================================================= */

.chat-body{
  background: var(--bg);
  color: var(--text);
}

/* App layout */
.layout-wrapper{
  height: 100vh;
}

/* Left sidebar */
.chat-leftsidebar{
  width: 360px;
  max-width: 100%;
  background: #F3F6FA;
  border-right: 1px solid var(--line);
  overflow: hidden;
}

.sidebar-top{
  border-bottom: 1px solid var(--line);
}

.sidebar-logo{
  height: 28px;
  width: auto;
}

.sidebar-divider{
  height: 1px;
  background: var(--line);
  margin: 10px 0;
}

/* Search */
.search-pill{
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
}

.search-pill .input-group-text{
  background: transparent;
  border: 0;
  color: #98a2b3;
  padding-left: 14px;
}

.search-pill .form-control{
  border: 0;
  background: transparent;
  padding: 10px 12px;
  font-size: 14px;
}

.search-pill .form-control:focus{
  box-shadow: none;
}

/* Icon buttons */
.icon-btn{
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #667085;
}

.icon-btn:hover{
  background: #f2f4f7;
  color: #111;
}

.icon-btn i{
  font-size: 18px;
}

/* =========================
   Chat list
   ========================= */
.chat-user-list{
  padding: 6px;
  margin: 0;
}

.chat-user-list li{
  padding: 12px 14px;
  border-radius: 8px;
  cursor: pointer;
  margin: 6px 6px;
  background: transparent;
  transition: background .15s ease, transform .15s ease;
}

.chat-user-list li:hover{
  background: #f2f4f7;
}

.chat-user-list li.active{
  background: #e9effa;
}

/* avatar */
.chat-user-list .avatar-title{
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight: 800;
  font-size: 14px;
  color: #111;
  background: #e8edf5;
}

.chat-user-title{
  font-weight: 800;
  font-size: 14px;
  color: #111;
  line-height: 1.2;
}

.chat-user-last{
  color: #667085;
  font-size: 13px;
  line-height: 1.2;
  margin-top: 4px;
}

.chat-user-time{
  font-size: 12px;
  color: #98a2b3;
  line-height: 1.2;
  white-space: nowrap;
}

.chat-user-badge{
  font-size: 11px;
  background: #ff4d6d;
  border-radius: 999px;
  padding: 4px 8px;
  color: #fff;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width: 28px;
  margin-top: 6px;
}

/* typing state */
.chat-user-last.typing{
  color: #111;
}
.chat-user-last.typing::before{
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #22c55e;
  display: inline-block;
  margin-right: 6px;
  transform: translateY(-1px);
}

/* Right chat */
.user-chat{
  background: var(--panel);
  min-width: 0;
}

/* Header */
.chat-header{
  background: var(--panel);
}

.chat-head-avatar .avatar-circle{
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: #eef2f6;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight: 800;
}

#chatTitle{
  font-weight: 800;
  font-size: 15px;
}

.chat-subtitle{
  font-size: 12px;
  color: #98a2b3;
}

.presence-dot{
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--offline);
  display: inline-block;
}

.chat-conversation{
  background: #fff;
  position: relative;
}

/* Date divider */
.day-divider{
  width: 100%;
  display:flex;
  align-items:center;
  justify-content:center;
  margin: 16px 0;
}

.day-divider span{
  font-size: 12px;
  color: #667085;
  background: #f2f4f7;
  padding: 4px 10px;
  border-radius: 8px;
}

/* Message spacing */
#messagesList li{
  margin-bottom: 18px;
}

.message-left,
.message-right{
  display:flex;
  gap: 10px;
  align-items: flex-end;
}

/* avatars */
.avatar-xs{
  width: 42px;
  height: 42px;
  border-radius: 999px;
  overflow: hidden;
}
.avatar-xs .avatar-title{
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight: 800;
  font-size: 14px;
  background: #e8edf5;
  color: #111;
}

.msg-avatar{
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #eef2f6;
  display:flex;
  align-items:center;
  justify-content:center;
  flex: 0 0 auto;
  color: #111;
  font-weight: 700;
  font-size: 12px;
}

/* bubbles */
.message-bubble{
  max-width: min(560px, 84%);
  border-radius: 10px;
  padding: 12px 14px;
  position: relative;
}

.message-left .message-bubble{
  background: var(--bubble-left);
  color: var(--bubble-left-text);
  border-top-left-radius: 4px;
}

.message-right{
  justify-content: flex-end;
}
.message-right .message-bubble{
  background: var(--bubble-right);
  color: var(--bubble-right-text);
  border-top-right-radius: 4px;
}

/* meta */
.message-meta{
  margin-top: 8px;
  display:flex;
  align-items:center;
  gap: 10px;
  justify-content:flex-end;
  font-size: 12px;
  color: rgba(255,255,255,.72);
}

.message-right .message-meta{
  color: #98a2b3;
}

/* attachment */
.message-attach img{
  max-width: 240px;
  border-radius: 10px;
  display:block;
}

/* highlight */
.msg-highlight{
  box-shadow: 0 0 0 3px rgba(59,130,246,.18) inset;
}

/* Input bar */
.chat-input-section{
  background: #fff;
}

.chat-input{
  background: #e9eef6;
  border: 0;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 14px;
}

.chat-input:focus{
  box-shadow: none;
  outline: none;
}

/* send button */
.send-btn{
  width: 44px;
  height: 44px;
  border-radius: 8px;
  border: 0;
  background: var(--send-btn);
  color: #fff;
  display:flex;
  align-items:center;
  justify-content:center;
}

.send-btn:hover{
  background: var(--send-btn-hover);
}

.send-btn i{
  font-size: 18px;
}

 

/* Highlight for message search */
.msg-highlight{
  background: #1d4ed8 !important;   /* dark blue */
  color: #ffffff !important;
}

/* Unread black bubble in chat list */
.chat-user-badge{
  font-size: 11px;
  background: #000000;
  border-radius: 999px;
  padding: 4px 9px;
  color: #fff;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width: 24px;
  margin-top: 6px;
}

/* Day divider (Today / Yesterday / date) */
.day-divider{
  width: 100%;
  display:flex;
  align-items:center;
  justify-content:center;
  margin: 16px 0;
}
.day-divider span{
  font-size: 12px;
  color: #667085;
  background: #f2f4f7;
  padding: 4px 10px;
  border-radius: 8px;
}

/* Mobile behaviour – list vs chat (WhatsApp style) */
@media (max-width: 991.98px){
  .layout-wrapper{ flex-direction: column; }
  .chat-leftsidebar{ width: 100%; height: 100%; }
  .user-chat{ display:none; }

  /* when inside a chat */
  .app-chat-open .chat-leftsidebar{ display:none; }
  .app-chat-open .user-chat{ display:flex; height: 100%; }
}

/* =========================
   MOBILE switch
   ========================= */
@media (max-width: 991.98px){
  .layout-wrapper{ flex-direction: column; }
  .chat-leftsidebar{ width: 100%; height: 100%; }
  .user-chat{ display:none; }

  .app-chat-open .chat-leftsidebar{ display:none; }
  .app-chat-open .user-chat{ display:flex; height: 100%; }
}

@media (max-width: 991.98px) {
  .layout-wrapper {
    flex-direction: column;
  }

  /* Default: ONLY list is visible */
  body:not(.app-chat-open) .chat-leftsidebar {
    display: block !important;
    width: 100%;
    height: 100%;
  }
  body:not(.app-chat-open) .user-chat {
    display: none !important;
  }

  /* When a chat is opened: ONLY chat is visible */
  body.app-chat-open .chat-leftsidebar {
    display: none !important;
  }
  body.app-chat-open .user-chat {
    display: flex !important;
    width: 100%;
    height: 100%;
  }
}