body.dark-theme {
  --primary-bg: #181f29;           /* Main background */
  --primary-text: #eaf1fb;         /* Main text */
  --sidebar-bg: #1b2230;           /* Sidebar background */
  --panel-bg: #202735;             /* Chat panel, cards, info panels */
  --border-color: #273043;         /* Subtle but visible */
  --accent: #2563eb;               /* Brand blue */
  --accent-hover: #5691ff;
  --secondary-text: #a7b5cc;       /* For muted info, dates, meta */
  --highlight-bg: #222d3d;         /* For "selected" and header areas */
  --card-shadow: 0 2px 24px #1020403a;
}

/* Section backgrounds */
body.dark-theme .container,
body.dark-theme .sidebar,
body.dark-theme .sidebar-header,
body.dark-theme .filter-bar,
body.dark-theme #sessionList,
body.dark-theme .nav-bar {
  background: var(--sidebar-bg) !important;
  color: var(--primary-text) !important;
  border-color: var(--border-color) !important;
}

body.dark-theme .tab-bar-pro {
  background-color: #202735 !important;
}


body.dark-theme .chat-box {
  background-color: #1b2230 !important;
}

body.time-date  {
  color :white !important;
}




body.dark-theme .user-info-section,
body.dark-theme .profile-modal-content,
body.dark-theme .edit-modal,
body.dark-theme #notification-toast,
body.dark-theme .main-content-panel {
  background: var(--panel-bg) !important;
  color: var(--primary-text) !important;
  border-color: var(--border-color) !important;
  box-shadow: var(--card-shadow);
}

body.dark-theme .session-item,
body.dark-theme .user-card{
  background: var(--panel-bg) !important;
  color: var(--primary-text) !important;
  border-color: var(--border-color) !important;
}

body.dark-theme .modern-user-card{
  border-color: lightgray !important;
}

body.dark-theme .session-item.selected,
body.dark-theme .modern-user-card.selected {
  background: var(--highlight-bg) !important;
  border-left: 1px solid var(--accent) !important;
  color: var(--primary-text) !important;
}

body.input-group input[type="text"] {
  border: 1px solid #181f29 !important;
}

body.dark-theme input,
body.dark-theme select,
body.dark-theme textarea {
  background: #1b2230 !important;
  color: var(--primary-text) !important;
  border-color: var(--border-color) !important;
}

body.session-name {
  color:white !important;
}

body.dark-theme input:focus, 
body.dark-theme select:focus, 
body.dark-theme textarea:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 6px var(--accent)33;
}




body.dark-theme .tab-pro {
  background: var(--panel-bg) !important;
  color: var(--accent) !important;
  border-color: var(--border-color) !important;
}

body.dark-theme .tab-pro.active {
  background: var(--accent) !important;
  color: #fff !important;
}

body.dark-theme .empty-state,
body.dark-theme .session-info,
body.dark-theme .msg-meta,
body.dark-theme .msg-time,
body.dark-theme .session-item .session-info {
  color: var(--secondary-text) !important;
}

body.dark-theme .modern-user-email{
  color: #ffffff !important;
}

body.input-group {
  background: #181f29 !important;
}

body.chat-area {
  background: #181f29 !important;
}

body.input-bg {
  background: #181f29 !important;
}

body.dark-theme .chat-msg,
body.dark-theme .message-bubble,
body.dark-theme .profile-modal-content {
  background: #2563eb !important;
  color: var(--primary-text) !important;
  box-shadow: var(--card-shadow);
}

body.dark-theme .msg-menu {
  color: white !important;
  background-color: #303030 !important;
}

body.dark-theme .edit-modal{
  background: #000000 !important;
  color: var(--primary-text) !important;
  box-shadow: var(--card-shadow);
}

body.dark-theme .message-row.self .message-bubble {
    background: #303030 !important;
    color: #ffffff !important;
}

body.dark-theme .msg-meta,
body.dark-theme .msg-time {
  color: var(--secondary-text) !important;
}

body.dark-theme .modern-user-extra {
  background: #202735 !important;
  color: var(--primary-text) !important;
}

body.dark-theme .modern-user-name {
  color: var(--accent) !important;
}

/* Borders, scrollbars */
body.dark-theme ::-webkit-scrollbar-thumb {
  background: #303030 !important;
}
body.dark-theme ::-webkit-scrollbar {
  background: #1a2232 !important;
}

/* Modal backgrounds */
body.dark-theme .swal2-popup,
body.dark-theme #chat-fullscreen-image-overlay,
body.dark-theme #chat-preview-fullscreen-overlay {
  background: #21283a !important;
  color: var(--primary-text) !important;
}

/* Emoji, icon, and flag visibility */
body.dark-theme .emoji-picker span,
body.dark-theme .nav-item img,
body.dark-theme .country-flag img {
  filter: brightness(1.2) !important;
}

/* Section headers */
body.dark-theme .sidebar-header h3,
body.dark-theme .modern-user-name,
body.dark-theme .profile-modal h2 {
  color: var(--accent) !important;
}

body.dark-theme .save-btn {
  background: var(--accent) !important;
  color: #fff !important;
}

body.dark-theme .save-btn:hover {
  background: var(--accent-hover) !important;
}

body.dark-theme .user-card strong {
  color: var(--accent) !important;
}

body.dark-theme .profile-avatar,
body.dark-theme .sidebar-admin-avatar {
  background: var(--accent) !important;
  color: #fff !important;
}


* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family:"Segoe UI", Arial, sans-serif !important;
  background-color: #f5f8fa;
  color: #222e3a;
  height: 100vh;
  display: flex;
  overflow: hidden;
}

.container {
  display: flex;
  width: 100%;
  height: 100vh;
  box-shadow: inset 0 0 8px rgba(40, 70, 180, 0.06);
}

.sidebar {
  width: 350px;
  background-color: #f7fafd;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow-y: auto;
  border-right: 1px solid #e5e5e5;
  margin-left: 50px;
}

.sidebar-header {
  padding: 15px;
  border-bottom: 1px solid #cbcbcb;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-header h3 {
  font-size: 1.3rem;
  font-weight: 700;
  color: #5700a9;
}

.sidebar-header span {
  font-size: 1.2rem;
}

.search-bar {
  padding: 10px;
  background-color: #fff;
  border-bottom: 1px solid #bebebe;
  position: relative;
  background: #fff;
}

.search-bar input {
  width: 100%;
  padding: 10px 10px 10px 30px;
  /* border-radius: 10px; */
  border: 2px solid #ffffff;
  background-color: #fff;
  color: #1a2441;
  font-size: .9rem;
  transition: all 0.3s;
}

.search-bar input:focus {
  border-color: #1748b2;
  box-shadow: 0 0 8px #2563eb33;
  outline: none;
}

.search-bar::before {
  content: "🔍";
  position: absolute;
  top: 50%;
  left: 20px;
  transform: translateY(-50%);
  font-size: 1.5rem;
}

#sessionList {
  background-color: #f6f6ff;
  flex: 1;
  overflow-y: auto;
}

.session-item {
  background-color: #fff;
  color: #2563eb;
  padding: 12px 14px;
  margin-bottom: 3px;
  /* border-radius: 10px; */
  cursor: pointer;
  border-left: 4px solid transparent;
  transition: all 0.18s;
  /* box-shadow: 0 1px 4px rgba(37, 99, 235, 0.07); */
  font-size: 1rem;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  border: 1px solid #e6e6e6;
}

.session-avatar {
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  background: #e3ecfa;
  color: #2563eb;
  border-radius: 50%;
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  letter-spacing: 1px;
  margin-right: 10px;
  user-select: none;
}


.session-item:hover {
  background-color: #eaf1ff;
  border-left-color: #2563eb;
  color: #1748b2;
}

.session-item.selected {
  background-color: #2563eb18;
  color: #1748b2;
  border-left-color: #2563eb;
  font-weight: bold;
  box-shadow: 0 0 6px #2563eb22;
}

.chat-area {
  flex: 1;
  display: flex;
  flex-direction: row;
  /* background-color: #f7fafd; */
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.chat-box {
    min-height: 0;
    height: 85vh;
    background: #ffffff00;
    /* border-right: 1px solid #cbcbcb; */
    /* border-left: 1px solid #e5e5e5; */
    /* box-shadow: 0 3px 14px #2563eb08; */
    padding: 15px 15px 25px 15px;
    overflow-y: scroll;
    scrollbar-gutter: stable;
    color: #27324c;
    font-size: .8rem;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
}


/* Professional scrollbar only for chat-box */
.chat-box::-webkit-scrollbar {
  width: 10px;
  background: #f0f4fa;
  border-radius: 12px;
}

.chat-box::-webkit-scrollbar-thumb {
  background: #c7d2ea;
  border-radius: 12px;
}

.chat-box::-webkit-scrollbar-thumb:hover {
  background: #b0bee3;
}

.chat-msg {
  margin-bottom: 18px;
  padding: 12px 16px;
  border-radius: 8px;
  background: linear-gradient(90deg, #eaf1ff 85%, #f7fafd 100%);
  border-left: 4px solid #2563eb;
  color: #23334d;
  box-shadow: 0 2px 8px #2563eb0d;
  transition: box-shadow 0.15s;
}

/* Modern Chat UI */
.message-row {
  display: flex;
  align-items: flex-end;
  margin-bottom: 16px;
}

.message-row.self {
  justify-content: flex-end;
}


.message-row.user .message-bubble {
  background: #2563eb;
  color: #fff;
  align-self: flex-end;
}

.message-bubble .msg-meta {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  font-size: 0.6em;
  color: #000000;
  margin-top: 6px;
  gap: 8px;
}

.message-row.self .msg-meta {
  color: #cde1fa;
}

.message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f7fafd;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1em;
  color: #2563eb;
  margin-right: 9px;
  flex-shrink: 0;
  box-shadow: 0 2px 7px #2563eb10;
  border: 2px solid #eaf1ff;
}

.message-row.self .message-avatar {
  margin-left: 9px;
  margin-right: 0;
  background: #2563eb;
  color: #fff;
  border: 2px solid #d0e6fa;
}


.chat-msg {
  position: relative;
}

.chat-msg .msg-actions {
  display: none;
  position: absolute;
  top: 7px;
  right: 11px;
  z-index: 4;
}

.chat-msg:hover .msg-actions {
  display: flex;
  gap: 6px;
}

.msg-actions button {
  background: none;
  border: none;
  color: #888;
  font-size: 1.05rem;
  padding: 2px 4px;
  cursor: pointer;
  transition: color 0.18s;
  border-radius: 4px;
}

.msg-actions button:hover {
  background: #f7f7f7;
  color: #d73737;
}

.chat-msg.editing {
  background: #fff7e0;
  border-left: 4px solid #f9783a;
}

.edit-input-wrap {
  display: flex;
  gap: 6px;
  align-items: center;
}

.edit-input-wrap input {
  flex: 1;
  font-size: 1rem;
  padding: 7px 8px;
  border-radius: 5px;
  border: 1px solid #c9d6ee;
}

.edit-input-wrap button {
  background: #1cc8ae;
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 5px;
  font-size: 0.97rem;
  cursor: pointer;
  transition: background 0.2s;
}

.edit-input-wrap button.cancel-btn {
  background: #eee;
  color: #666;
}

.edit-input-wrap button:hover:not(.cancel-btn) {
  background: #2563eb;
}


.chat-msg b {
  color: #1748b2;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.chat-msg:hover {
  box-shadow: 0 4px 18px #2563eb16;
}

.input-group {
  padding-top: 10px;
  padding-bottom: 0px;
  /* background: #ffffff; */
  margin: 0;
  /* border-radius: 0 0 12px 12px; */
  border-top: 1px solid #e1e1e1;
  border-bottom: 1px solid #e1e1e1;
}

.input-group input[type="text"] {
  background: transparent;
  border-radius: 8px;
  padding: 12px 16px;
}

.input-group input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 6px #2563eb33;
}



.user-info-section {
  min-width: 250px;
  max-width: 250px;
  flex: 0 0 340px;
  /* overflow-y: auto; */
  margin-bottom: 0;
  background: #fff;
  box-shadow: 0 4px 16px #2563eb08;
  display: flex;
  flex-direction: column;
  scroll-behavior: smooth;
  /* width: 20px; */
}

/* Professional scrollbar only for user-info-section */
.user-info-section::-webkit-scrollbar {
  width: 10px;
  background: #f0f4fa;
  border-radius: 12px;
}

.user-info-section::-webkit-scrollbar-thumb {
  background: #c7d2ea;
  border-radius: 12px;
  border: 3px solid #fff;
}

.user-info-section::-webkit-scrollbar-thumb:hover {
  background: #b0bee3;
}

.user-info-section h3 {
  color: #2563eb;
  margin-bottom: 18px;
  font-size: 1.14rem;
  font-weight: 700;
}

.user-card {
  background: #f3f6fb;
  border-radius: 13px;
  border: 1.5px solid #e5e9ef;
  margin-bottom: 15px;
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.user-card:hover {
  border-color: #2563eb;
  box-shadow: 0 2px 14px #2563eb12;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.2rem;
  flex-shrink: 0;
  color: #fff;
  background: linear-gradient(135deg, #1e3264, #1fa363 80%);
  box-shadow: 0 2px 8px #14455522;
  position: relative;
  overflow: hidden;
}

.user-avatar[data-color="blue"] {
  background: linear-gradient(135deg, #2563eb, #1748b2 85%);
}

.user-avatar[data-color="green"] {
  background: linear-gradient(135deg, #159b5c, #134e3b 85%);
}

.user-avatar[data-color="purple"] {
  background: linear-gradient(135deg, #6c47bd, #311453 85%);
}

.user-avatar[data-color="orange"] {
  background: linear-gradient(135deg, #ff8c42, #c23616 85%);
}

.user-card strong {
  color: #1748b2;
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 1px;
  display: block;
}

.user-card .user-meta {
  font-size: 0.99rem;
  color: #5d6478;
  margin-bottom: 5px;
}

.user-card .user-meta-email {
  color: green;
  font-size: 0.7rem;
  padding-top: 5px;
}

.user-card a,
.user-card a:visited {
  color: #2563eb;
  font-size: 0.97rem;
  text-decoration: none;
}

.user-card a:hover {
  color: #1748b2;
  text-decoration: underline solid;
}

.user-card button {
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 7px;
  font-weight: 600;
  padding: 7px 13px;
  cursor: pointer;
  font-size: 0.99rem;
  margin-left: auto;
  margin-top: 0;
  transition: background 0.18s;
}

.user-card button:hover {
  background: #1748b2;
}

.error-message {
  color: #e53935;
  background-color: #fff0f0;
  padding: 10px;
  border-radius: 5px;
  margin: 10px 0;
  border-left: 3px solid #e53935;
}

.loading {
  color: #2563eb;
  text-align: center;
  padding: 20px;
}

.empty-state {
  text-align: center;
  color: #9db0d0;
  padding: 200px 20px 0px 20px;
}

.emoji-picker {
  position: absolute;
  bottom: 70px;
  right: 20px;
  background-color: #fff;
  border: 1.5px solid #e5e9ef;
  border-radius: 8px;
  padding: 10px;
  display: none;
  z-index: 1000;
  box-shadow: 0 4px 14px #2563eb13;
}

.emoji-picker span {
  cursor: pointer;
  font-size: 1.5rem;
  margin: 2px;
  padding: 5px;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.emoji-picker span:hover {
  background-color: #eaf1ff;
}

.edit-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  padding: 20px;
  border-radius: 12px;
  z-index: 9999;
  color: #1748b2;
  width: 320px;
  display: none;
  box-shadow: 0 0 20px #2563eb23;
  border: 1.5px solid #e5e9ef;
}

.edit-modal input {
  width: 100%;
  padding: 8px;
  margin: 6px 0;
  border: 1.5px solid #e5e9ef;
  border-radius: 6px;
  color: #000000;
}

.edit-modal button {
  margin-top: 10px;
  padding: 7px 14px;
  border: none;
  border-radius: 6px;
  background-color: #2563eb;
  color: #fff;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s;
}


.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(40, 70, 180, 0.13);
  z-index: 9998;
  display: none;
}

#modalBackdrop {
  backdrop-filter: blur(10px);
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(40, 70, 180, 0.13);
  z-index: 1500;
}

.session-info {
  font-size: 0.8rem;
  color: #878787;
  margin-top: 7px;
}

/* Hide scrollbars globally unless inside .chat-box or .user-info-section */
::-webkit-scrollbar {
  width: 0;
  background: transparent;
}

/* Responsive fixes */
@media (max-width: 900px) {
  .chat-area {
    flex-direction: column;
    gap: 16px;
    padding: 16px;
  }

  .user-info-section,
  .chat-box {
    max-width: 100%;
    min-width: 0;
    height: 260px;
    padding: 12px 6px 8px 8px;
  }
}

.chat-msg {
  margin-bottom: 12px;
  padding: 7px 12px;
  border-radius: 7px;
  background-color: #eaf1ff;
  border-left: 3px solid #2563eb;
  color: #23334d;
  font-size: 0.98rem;
  word-break: break-word;
}

.chat-msg b {
  color: #1748b2;
  font-weight: 600;
  font-size: 0.99rem;
}

.input-group {
  padding-bottom: 10px;
  /* background: #ffffff; */
  gap: 8px;
  border-block-end: 5px solid #6f6f6f;
}

.input-group input[type="text"] {
  flex: 1;
  padding: 7px 10px;
  border:none;
  outline: none;
  background-color: transparent;
  color: #000000;
  font-size: 0.9rem;
  min-width: 0;
  outline: none;
}

.input-group button,
#emojiBtn,
.user-card button {
  border-radius: 6px;
  font-size: 0.98rem;
  padding: 7px 12px;
  font-weight: 600;
  min-width: 36px;
  min-height: 36px;
  background-color: transparent;
  border: none;
}



/* #emojiBtn {
  background: #ffffff;
  color: #cacaca;
  padding: 7px 8px;
}

#emojiBtn:hover {
  background: #eaf1ff;
  border-color: #2563eb;
  color: #1748b2;
} */

.chat-msg img {
  max-width: 120px;
  max-height: 120px;
  border-radius: 6px;
  margin: 2px 0;
  cursor: pointer;
  box-shadow: 0 2px 8px #2563eb15;
}

.modern-user-card {
  /* background: #fff; */
  /* border-radius: 12px; */
  /* border: 1.5px solid #ecedf1; */
  padding: 15px 5px 25px 10px;
  display: flex;
  align-items: center;
  gap: 18px;
  position: relative;
  box-shadow: 0 3px 16px #2563eb08;
  transition: border-color 0.18s, box-shadow 0.18s;
  border-bottom: 1px solid #e1e1e1;
}


.modern-user-card:hover {
  border-color: #2563eb;
  box-shadow: 0 4px 18px #2563eb14;
}

.modern-avatar {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: #e5eefd;
  color: #2563eb;
  font-size: 1.19rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: none;
  box-shadow: 0 0 0 2px #e2eafe;
  letter-spacing: 1px;
}

.modern-user-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.modern-user-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: #1748b2;
  margin-bottom: 2px;
  /* overflow: hidden; */
  word-wrap: break-word;
  word-break: break-all;
  /* text-overflow: ellipsis; */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 160px;
  display: block;
}

.modern-user-email {
  font-size: 1rem;
  color: #7a8599;
  margin-bottom: 3px;
  word-break: break-all;
  word-wrap: break-word;
  word-break: break-all;
  /* text-overflow: ellipsis; */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 200px;
  display: block;
  font-weight: 600;
  width: 160px;
}

.modern-user-meta {
  margin-top: 2px;
  display: flex;
  align-items: center;
  font-size: 0.98rem;
}

.modern-map-link {
  display: inline-flex;
  align-items: center;
  gap: 0px;
  color: #ff8484;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.8rem;
  opacity: 1px;
  padding-bottom: 0px;
  transition: color 0.16s, border 0.16s;
}



.modern-map-link:hover {
  color: #1748b2;
  border-bottom: 1px solid #2563eb77;
}

.modern-map-link.disabled {
  color: #aaa;
  pointer-events: none;
  border-bottom: none;
  opacity: 0.7;
}

.modern-edit-btn {
  display: flex;
  margin-left: 115px;
  background: transparent;
  color: #1748b2;
  border: none;
  font-size: .9rem;
  outline: none;
  justify-content: end;
  margin-left: 80px;
  font-weight: 600;
}

.modern-edit-btn:hover {
color:#ff0000;
}

.modern-user-card:hover .modern-edit-btn,
.modern-edit-btn:focus {
  display: flex;
}

/* --- PRO QUOTE BUBBLE STYLES --- */
.message-row {
  display: flex;
  align-items: flex-end;
  margin-bottom: 22px;
}

.message-row.self {
  justify-content: flex-end;
}



.message-row.user .message-bubble {
  background: linear-gradient(96deg, #2563eb 90%, #5691ff 100%);
  color: #fff;
  box-shadow: 0 2px 22px #2563eb25;
}


.message-bubble .msg-meta {
  display: flex;
  align-items: center;
  gap: 0;
  font-size: 0.7em;
  color: #b0b0b0;
  opacity: 1;
  margin-top: 3px;
}

.message-row.self .msg-meta {
  color: #5e5e5e;
  opacity: 1;
}

.message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1em;
  margin-right: 10px;
  margin-left: 2px;
  box-shadow: 0 2px 7px #2563eb10;
  border: 2.5px solid #e5eefd;
  background: #dbeaff;
  /* Fallback, JS randomizes */
  color: #2563eb;
  text-transform: uppercase;
}

.message-row.self .message-avatar {
  margin-left: 10px;
  margin-right: 2px;
  background: #2563eb;
  color: #fff;
  border: 2.5px solid #b8d7fa;
}

/* For image messages */
.message-bubble img,
.message-row img {
  display: block;
  max-width: 200px !important;
  max-height: 200px !important;
  /* width: auto;
  height: auto; */
  border-radius: 5px;
  margin: 2px 0;
  box-shadow: 0 2px 8px #2563eb11;
  object-fit: cover;
  background: transparent !important;
  border: 1px solid rgb(190, 190, 190) !important;
  padding: 0 !important;
}
.message-bubble {
  padding: 10px 16px 6px 16px;
  border-radius: 14px;
  box-shadow: 0 1px 7px #2563eb12;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 60px;
}
.message-row {
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 14px;
}
.msg-meta {
  margin-top: 5px;
  margin-bottom: -3px;
  text-align: right;
  font-size: 0.92em;
  color: #a5b4d7;
  font-weight: 500;
}
.msg-menu {
  top: 6px !important;
  right: 4px !important;
}



.selected-user-card {
  border: 2px solid #2563eb !important;
  box-shadow: 0 0 10px #2563eb33;
}



/* --- MESSAGE BUBBLE CLEANUP --- */
.admin-message-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.user-message-row,
.bot-message-row {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 12px;
}

/* Admin bubble: White, blue text */
.admin-bubble {
  background: #fff;
  color: #2563eb;
  border-radius: 16px;
  padding: 10px 16px;
  max-width: 62vw;
  min-width: 44px;
  box-shadow: 0 1px 6px #2563eb15;
  font-size: 1rem;
  position: relative;
  word-break: break-word;
  border: 1.4px solid #e5eafe;
}

/* User/bot bubble: Blue, white text */
.user-bubble,
.bot-bubble {
  background: linear-gradient(94deg, #2563eb 90%, #529ff9 100%);
  color: #fff;
  border-radius: 16px;
  padding: 10px 16px;
  max-width: 62vw;
  min-width: 44px;
  box-shadow: 0 1px 6px #2563eb15;
  font-size: 1rem;
  position: relative;
  word-break: break-word;
  border: 1.4px solid #2563eb11;
}


/* Time in bottom right of bubble */
.msg-time {
  font-size: 0.82em;
  color: #a5b4d7;
  display: block;
  text-align: right;
  margin-top: 4px;
  margin-bottom: -4px;
}

/* WhatsApp-style date separator */
.chat-date-separator {
  text-align: center;
  color: #595959;
  font-size: 0.96em;
  font-weight: 600;
  margin: 22px 0 12px 0;
  letter-spacing: 0.08em;
  background: #f2f6ff;
  padding: 6px 20px;
  border-radius: 7px;
  display: inline-block;
  width: auto;
  min-width: 98px;
  box-shadow: 0 2px 6px #2563eb12;
}

/* Message row layout */
.message-row {
  display: flex;
  align-items: flex-end;
  margin-bottom: 20px;
}

.message-row.user,
.message-row.bot {
  justify-content: flex-start;
}

.message-row.agent,
.message-row.admin {
  justify-content: flex-end;
}

/* Avatars */
.message-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-weight: 700;
  font-size: 1.08rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 10px;
  background: #ffe5bb;
  /* default */
  color: #ffffff;
  flex-shrink: 0;
}

.message-row.bot .message-avatar {
  background: #fffac0;
  color: #674fa3;
}

.message-row.user .message-avatar {
  background: #ffffff;
  color: #fff;
}

.message-row.agent .message-avatar,
.message-row.admin .message-avatar {
  background: #ffe5bb;
  color: #ffffff;
}

/* Message bubble basics */
.message-bubble {
  max-width: 25vw;
  padding: 10px 15px 10px 15px;
  border-radius: 10px;
  min-width: 20px;
  font-size: .7rem;
  box-shadow: 0 1px 7px #2563eb12;
  display: flex;
  flex-direction: column;
  word-break: break-word;
  position: relative;
}



/* Time style inside the bubble (bottom right) */
.msg-time {
  font-size: 0.96em;
  color: #a3b5d7;
  margin-top: 8px;
  text-align: right;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* Date separator */
.date-separator {
  width: 100%;
  text-align: center;
  color: #5b6479;
  font-size: .7rem;
  font-weight: 600;
  background: #f7fafc;
  margin: 28px 0 16px 0;
  padding: 7px 0 6px 0;
  border-radius: 12px;
  letter-spacing: 0.03em;
  border: none;
}



#nav-bar {
  width: 50px;
  background-color: #f7fafd;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow-y: auto;
  border-right: 1px solid #e5e5e5;
}

.nav-bar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 68px;
  background: #fff;
  border-right: 1.5px solid #e9e9e9;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 1050;
  transition: width 0.27s cubic-bezier(0.4, 0.2, 0.3, 1);
  box-shadow: 2px 0 10px #0001;
}

.nav-bar.collapsed {
  width: 0;
  min-width: 0;
  overflow: hidden;
}

.nav-toggle {
  background: none;
  border: none;
  margin: 18px 0 20px 0;
  padding: 0;
  cursor: pointer;
  outline: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 1100;
}


.nav-toggle span {
  display: block;
  width: 30px;
  height: 4px;
  background: #1877f2;
  transition: 0.25s;
}

/* Nav menu styling */
.nav-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  flex: 1;
  flex-direction: column;
  align-items: center;
  gap: 26px;
}

.nav-logo {
  font-size: 1.5rem;
  margin-bottom: 28px;
  margin-top: 12px;
  padding-left: 8px;
}



.nav-item {
  font-size: 1.55rem;
  color: #c67a7a;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
  padding: 0px 0px 25px 0px;
  border-radius: 10px;
  width: 44px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 5px 0px 5px 0px;
  background: #fff;
  border-bottom: 1.5px solid #ecedf1;
  position: sticky;
  top: 0;
  z-index: 2;
}

.filter-dropdown {
  display: flex;
  align-items: center;
  font-size: .8rem;
  font-weight: 600;
  color: #222;
  cursor: pointer;
  padding: 10px 100px 10px 15px;
  border-radius: 10px;
  transition: background .18s;
}

.filter-dropdown:hover {
  background: #f2f6ff;
}

.dropdown-arrow {
  font-size: 0.9em;
  color: #9d9d9d;
  margin-left: 5px;
}

filter-btn,
.add-btn {
  background: none;
  border: none;
  font-size: .9rem;
  color: #2563eb;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  padding: 0 0 0 145px;
  transition: background 0.18s, color 0.18s;
  display: flex;
  align-items: center;
  gap: 5px;
}



.filter-btn:hover,
.add-btn:hover {
  background: #eaf1ff;
  color: #1748b2;
}

.add-btn {
  font-size: .9em;
  padding: 3px 13px;
  color: #000000;
  font-weight: bold;
}

.set {
  width: 0px;
}

.nav-set {
  font-size: 1.2rem;
  color: #787878;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
  margin: 0px 0px 10px 5px;
  border-radius: 10px;
  width: 44px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #fff;
  border: 1px solid #c5c5c5;
}

.nav-ai {
  font-size: 1.55rem;
  color: #a90000;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
  padding: 0px 0px 25px 5px;
  border-radius: 10px;
  width: 44px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.modern-user-extra {
  background: #f9fbfd;
  /* border-radius: 10px; */
  padding: 5px 5px 5px 15px;
  box-shadow: 0 1px 5px #2563eb0a;
  font-size: 1rem;
  margin-bottom: 10px;
  margin-top: 10px;
  width: 250px;
}

.modern-user-extra div {
  margin-bottom: 7px;
  font-weight: 500;
}

.modern-user-extra a {
  color: #2563eb;
  text-decoration: underline;
}

.user-avatar {
  position: relative;
  width: 55px;
  height: 55px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 2rem;
  background: #7492b3;
  color: #fff;
}

.flag-badge {
  position: absolute;
  right: -7px;
  bottom: -7px;
  background: #fff;
  border-radius: 5px;
  box-shadow: 0 1px 3px #0002;
  padding: 0;
}

.flag-badge img {
  width: 22px;
  height: 16px;
  display: block;
}

.filter-dropdown {
  position: relative;
  cursor: pointer;
  user-select: none;
}

.dropdown-menu {
  position: absolute;
  left: 0;
  top: 30px;
  min-width: 140px;
  background: #fff;
  border: 1px solid #ececec;
  box-shadow: 0 2px 14px #2221;
  border-radius: 8px;
  z-index: 2000;
  padding: 5px 0;
}

.dropdown-option {
  padding: 8px 16px;
  cursor: pointer;
  color: #222e3a;
  font-size: 1em;
  transition: background 0.17s;
}

.dropdown-option:hover {
  background: #f2f6ff;
  color: #2563eb;
}

.msg-menu {
  display: inline-block;
  vertical-align: top;
}

.msg-actions {
  display: none;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px #0002;
  padding: 5px 7px;
}

.msg-actions button {
  border: none;
  background: none;
  color: #2563eb;
  margin: 0 3px;
  font-size: 1.1em;
}

.msg-actions button:hover {
  color: #e53935;
}

.msg-actions {
  display: none;
  position: absolute;
  right: 0;
  top: 32px;
  background: #fff;
  box-shadow: 0 2px 12px #15193520;
  border-radius: 6px;
  z-index: 100;
  padding: 3px 0;
}

.msg-actions button {
  background: none;
  border: none;
  padding: 6px 14px;
  cursor: pointer;
  font-size: 1em;
  color: #222;
}

.msg-actions button:hover {
  background: #f5f5f5;
}

.nav-bar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 50px;
  /* Default width */
  background: #f7fafd;
  border-right: 1.5px solid #eee;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 1050;
  transition: width 0.3s cubic-bezier(0.4, 0.2, 0.3, 1);
  box-shadow: 2px 0 10px #0001;
}

.nav-bar.collapsed {
  width: 50px;
  /* Icon-only width */
}

.nav-bar .nav-toggle {
  background: none;
  border: none;
  margin: 13px 0 20px 0;
  padding: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-bar .nav-toggle span {
  display: block;
  width: 30px;
  height: 4px;
  background: #539eff;
  border-radius: 2px;
  transition: 0.3s;
}

.nav-menu {
  list-style: none;
  padding: 0;
  margin: 0;
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: start;
  gap: 18px;
}

.nav-item {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 5px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
}

.nav-item img {
  width: 30px;
  height: 30px;
}



.nav-settings {
  margin-bottom: 5px;
  margin-top: auto;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-settings img {
  width: 28px;
  height: 28px;
}

/* Show/hide labels if you add them later */
.nav-bar.collapsed .nav-item span,
.nav-bar.collapsed .nav-settings span {
  display: none;
}

.nav-sec {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 5px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
}

.nav-sec {
  font-size: 1.3rem;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
  padding: 30px 0 30px 0px;
  border-radius: 10px;
  width: 44px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.nav-settings .sidebar-admin-avatar {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #2563eb, #1748b2 85%);
  color: #fff;
  font-size: 1.2rem;
  font-weight: 700;
  border: 2px solid #eaf1ff;
  box-shadow: 0 2px 7px #2563eb10;
  margin-bottom: 0px;
  cursor: pointer;
}

/* Reduce dot size for clarity */
.country-flag {
  position: absolute;
  right: 2px;
  /* or -2px, whatever fits your padding */
  bottom: 2px;
  z-index: 2;
}

body.dark-theme .msg-reply-ref {
  margin-bottom: 2px;
  padding: 4px 8px;
  background: #303030 !important;  /* or any dark background */
  color: #eaf1fb !important;       /* or any light text */
  box-shadow: 0px 0px 6px 0px rgba(0, 0, 0, 0.16) inset !important;
  border-radius: 6px;
  font-size: 0.92em;
}


.delete-session-btn:hover {
  color: #b71c1c;
  transform: scale(1.2);
}

.profile-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.3rem;
  color: #fff;
  box-shadow: 0 1px 8px #15193533;
  background: linear-gradient(135deg, #2263ec, #3475e3 90%);
  margin: 0 15px;
  transition: box-shadow 0.2s, transform 0.2s;
}

.profile-avatar:hover {
  box-shadow: 0 4px 18px #2563eb42;
  transform: scale(1.07);
}

.profile-modal {
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-modal-content {
  background: #fff;
  border-radius: 16px;
  padding: 36px 32px 24px 32px;
  min-width: 320px;
  min-height: 300px;
  box-shadow: 0 10px 48px #2563eb17;
  position: relative;
}

.profile-modal-close {
  position: absolute;
  top: 14px;
  right: 22px;
  font-size: 2em;
  color: #aaa;
  cursor: pointer;
}

.profile-modal input {
  width: 100%;
  margin: 8px 0 20px 0;
  padding: 10px;
  border: 1px solid #e1e7ee;
  border-radius: 6px;
}

.save-btn {
  padding: 10px 20px;
  background: #2563eb;
  color: #fff;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: background 0.18s;
}

.save-btn:hover {
  background: #1877f2;
}

.modal-backdrop {
  position: fixed;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background: #2227;
  z-index: 999;
}


/* Message menu (3 dots) */
.msg-menu {
  position: absolute;
  top: 0px;
  right: 0px;
  font-size: 1.5em;
  color: #000000;
  width: 10px;
  height: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 4;
  background: #ffffff;
  padding: 13px;
  margin: -6px -4px -4px -4px !important;
  border-bottom-left-radius: 50%;
  border-top-right-radius: 35%;
}

.message-bubble:hover .msg-menu {
  opacity: 1;
}



/* The popup action menu */
.msg-actions {
  display: none;
  position: absolute;
  top: 20px;
  right: -60px;
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 2px 12px #2563eb22;
  z-index: 999;
  flex-direction: column;
  min-width: 80px;
  border: 1px solid #cfcfcf;
  overflow: hidden;
  padding: 4px 0;
}

.msg-actions button {
  width: 100%;
  border: none;
  background: none;
  color: #23334d;
  font-size: 0.9em;
  padding: 8px 5px;
  cursor: pointer;
  text-align: left;
}

.msg-actions button:hover {
  background: #f3f6fa;
  color: #2563eb;
}

#user-typing-indicator {
  display: flex;
  align-items: center;
  margin-bottom: 4px;
}

.typing-avatar {
  margin-top: 3px;
}

.typing-bubble {
  border-radius: 20px;
  padding: 5px;
  font-size: 10px;
  color: #4a4a4a;
  display: flex;
  align-items: center;
  box-shadow: 0 1px 3px #ccc2;
}

.typing-dots {
  display: inline-block;
  margin-left: 1px;
}

.typing-dots span {
  display: inline-block;
  font-size: 15px;
  animation: bounce 1.2s infinite;
  margin-left: 0px;
  color: #2563eb;
}

.typing-dots span:nth-child(1) {
  animation-delay: 0s;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes bounce {

  0%,
  80%,
  100% {
    transform: translateY(0);
  }

  40% {
    transform: translateY(-8px);
  }
}


/* === RESPONSIVE LAYOUT FIXES === */

/* Make sure html/body always fit viewport */
html,
body {
  width: 100vw;
  height: 100vh;
  min-width: 0;
  min-height: 0;
  overflow-x: hidden;
}

/* Stack panels vertically on small screens */
@media (max-width: 850px) {
  .container {
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    height: 100dvh;
  }

  .sidebar,
  .user-info-section,
  .chat-box {
    max-width: 100vw !important;
    min-width: 0 !important;
    width: 100vw !important;
    box-sizing: border-box;
    margin-left: 0;
    margin-right: 0;
    padding-left: 8px;
    padding-right: 8px;
  }

  .sidebar {
    order: 1;
    height: 60vw;
    min-height: 80px;
    border-right: none;
    border-bottom: 1px solid #e5e5e5;
    box-shadow: 0 2px 8px #2563eb07;
  }

  .chat-area {
    flex-direction: column;
    height: 100%;
    min-height: 0;
  }

  .chat-box {
    order: 2;
    min-height: 220px;
    max-height: 60vh;
    height: 36vh;
    padding: 10px 5px 20px 5px;
  }

  .user-info-section {
    order: 3;
    width: 100vw;
    max-width: 100vw;
    min-width: 0;
    margin-bottom: 0;
    margin-top: 8px;
    padding-left: 8px;
    padding-right: 8px;
    box-shadow: none;
  }

  .input-group {
    padding: 5px 0 !important;
  }
}

/* Mobile: Make everything 1 column, fit width, buttons big enough */
@media (max-width: 600px) {

  .container,
  .chat-area,
  .sidebar,
  .user-info-section,
  .chat-box {
    flex-direction: column !important;
    width: 100vw !important;
    max-width: 100vw !important;
    min-width: 0 !important;
  }

  .sidebar {
    position: relative;
    min-width: 0;
    width: 100vw;
    padding: 4px 6px;
    font-size: 1rem;
  }

  .nav-bar {
    width: 100vw !important;
    min-width: 0;
    left: 0;
    top: 0;
    flex-direction: row !important;
    height: 50px;
    z-index: 1002;
    box-shadow: 0 1px 8px #2563eb0b;
  }

  .nav-menu {
    flex-direction: row !important;
    gap: 10px;
    width: auto !important;
  }

  .nav-item,
  .nav-sec {
    font-size: 1.4rem;
    padding: 0 8px;
    width: 40px;
    height: 40px;
    margin: 0 2px;
  }

  
  .nav-settings {
    margin-bottom: 0;
    margin-top: 0;
    width: 40px;
    height: 40px;
  }

  .chat-box {
    height: 32vh !important;
    min-height: 110px !important;
    padding: 4px 2px 10px 2px;
  }

  .user-info-section {
    min-width: 0;
    width: 100vw !important;
    max-width: 100vw !important;
    font-size: 0.93rem;
    padding: 3px 2px 8px 2px;
  }

  .modern-user-card {
    gap: 8px;
    padding: 0 0 12px 0;
  }

  .modern-user-name,
  .modern-user-email {
    width: 92vw;
    max-width: 92vw;
    font-size: 0.98rem;
  }

  .input-group input[type="text"] {
    padding: 10px 7px;
    font-size: 0.96rem;
  }

  .input-group button,
  #emojiBtn {
    min-width: 32px;
    min-height: 32px;
    font-size: 1.15rem;
    padding: 8px;
  }
}

/* Fix modals on small screens */
@media (max-width: 600px) {

  .edit-modal,
  .profile-modal-content {
    width: 97vw !important;
    min-width: 0 !important;
    padding: 12px 6px 20px 6px !important;
    border-radius: 12px;
  }
}

/* Make emoji picker mobile-friendly */
@media (max-width: 600px) {
  .emoji-picker {
    right: 8px !important;
    left: auto !important;
    width: 98vw !important;
    min-width: 0 !important;
    padding: 8px 2px !important;
    border-radius: 8px;
  }
}

@media (max-width: 600px) {
  .input-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    padding: 6px 4px 4px 4px !important;
    position: fixed;
    bottom: 0;
    left: 0;
    z-index: 100;
    width: 100vw !important;
    border-top: 1px solid #e1e1e1;
    box-shadow: 0 -1px 12px #2563eb07;
  }

  .input-group input[type="text"] {
    flex: 1 1 0;
    min-width: 0;
    max-width: 100vw;
    font-size: 1rem;
    padding: 9px 8px;
    margin: 0;
  }

  .input-group button,
  #emojiBtn {
    min-width: 32px;
    min-height: 32px;
    font-size: 1.1rem;
    padding: 8px 6px;
    margin: 0 2px;
  }
}


@media (max-width: 700px) {
  .sidebar {
    display: block;
    width: 100vw !important;
    min-width: 0 !important;
    max-width: 100vw !important;
    position: relative;
    z-index: 200;
    background: #f7fafd;
    height: 180px;
  }

  .sidebar.mobile-hide {
    display: none !important;
  }

  .mobile-back-btn {
    display: flex;
    align-items: center;
    background: #fff;
    padding: 12px 0 4px 2px;
    z-index: 500;
    box-shadow: 0 2px 6px #2563eb11;
  }
}

@media (min-width: 701px) {
  #mobileBackBtn {
    display: none !important;
  }
}

.sidebar {
  transition: transform 0.28s cubic-bezier(.4, 0, .2, 1);
}

.sidebar.mobile-hide {
  transform: translateX(-110vw);
}

.sidebar {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.chat-svg {
  color: #8c8c8c;
  transition: color 0.3s;
  fill: currentColor;
}

/* On button hover, change svg color */
.text-bnt:hover .chat-svg {
  color: #1877f2;
  /* Your hover color */
}

.website-tabs {
  display: flex;
  justify-content: space-between;
  padding: 10px 10px 5px 10px;
  background: #fff;
  border-bottom: 1.5px solid #f3f3f3;
  margin-bottom: 0;
}

.website-tab {
  flex: 1;
  background: #f9f9f9;
  border: 1px solid #ebebeb;
  outline: none;
  font-weight: 600;
  color: #2563eb;
  font-size: .9em;
  border-radius: 10px 10px 0 0;
  margin: 0 5px;
  padding: 10px 5px 10px 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: background 0.17s, color 0.17s;
}

.website-tab.active,
.website-tab:hover {
  background: #2563eb;
  color: #fff;
}

/* --- Chrome-Style Tab Bar --- */
.tab-bar-pro {
  border-bottom: 1px solid #4646468a;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  background: #ffffff;
  box-shadow: 0 4px 18px 0 rgba(36, 56, 85, 0.04);
  margin-left: 50px;
  height: 35px; /* set the height for a crisp tab bar */
}


body, .container {
  padding-top: 18px;  /* match .tab-bar-pro height! */
}


/* Tab */
.tab-pro {
  display: flex;
  align-items: center;
  justify-content: flex-start; /* start, so favicon is always left */
  background: #fff;
  border: 1px solid #e1e5ee;
  border-bottom: none;
  border-radius: 5px 5px 0 0;
  margin-right: 6px;
  margin-top: 0;
  padding: 0 8px 0 8px; /* less horizontal padding, easier centering */
  min-width: 120px;
  font-size: 15px;
  height: 32px; /* slightly larger for emoji */
  position: relative;
  box-sizing: border-box;
  gap: 8px; /* space between favicon, label, and close */
}

.tab-pro:not(.active) {
  background: #f7f8fa;
  color: #7e8ca7;
  z-index: 1;
  box-shadow: none;
}

.tab-pro.active {
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 4px 16px 0 rgba(56,106,255,0.04);
  z-index: 10;
  margin-bottom: 0;
}
.main-content-panel {
  background: #fff;
  border-top: none !important;
  margin-top: 2px !important;
}


/* Favicon/icon */
.tab-pro .favicon {
  font-size: 20px;
  line-height: 1;
  margin-right: 6px;
  display: flex;
  align-items: center;
}

/* Close (X) button */
.tab-pro .tab-close {
  margin-left: 8px;
  font-size: 18px;
  color: inherit; /* Let it inherit tab color */
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  top: 0;
  right: 0;
  opacity: 0.75;
  padding: 0 2px;
  height: 22px;
  width: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tab-pro .tab-close:hover {
  color: #d43a3a !important;
  opacity: 1;
}

/* Add tab (+) button */
.tab-add-pro {
  margin-left: 3px;
  margin-right: 3px;
  font-size: 23px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 35px;
  width: 35px;
  padding: 0;
  background: none;
  border: none;
  color: white;
}

.tab-add-pro:hover {
  color: #1748b2;
}

.swal2-cancel-btn {
  background: #eee !important;
  color: #666 !important;
  border-radius: 8px !important;
  margin-left: 9px !important;
  font-weight: 600 !important;
}

body, .tab-bar-pro, .tab-pro, .tab-pro .favicon, .tab-pro .tab-close, .tab-add-pro {
  font-family: 'Segoe UI', Arial, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', sans-serif !important;
  font-size: 15px !important;   /* Adjust for visual harmony */
  line-height: 1.2 !important;
  vertical-align: middle;
}


/* === Fullscreen Image Preview Overlay === */
#chat-fullscreen-image-overlay {
  display: none;
  position: fixed;
  z-index: 2147483647;
  left: 0; top: 0; width: 100vw; height: 100vh;
  background: rgba(15,20,40,0.88);
  justify-content: center;
  align-items: center;
  cursor: zoom-out;
  transition: opacity .2s;
}
#chat-fullscreen-image-overlay img {
  max-width: 96vw;
  max-height: 96vh;
  border-radius: 16px;
  box-shadow: 0 6px 64px 0 #000a;
  background: #fff;
}
#chat-fullscreen-image-overlay.active {
  display: flex;
  opacity: 1;
}



.user-info-section.hide {
  display: none !important;
}

.chat-area.full-chat .user-info-section {
  display: none !important;
}
.chat-area.full-chat .input-bg {
  flex: 1 1 100%;
}

/* Default, for user (left) bubble */
.message-row.user .msg-menu {
  background: #2563eb;
  color: #fff;
}

/* For admin/agent/self (right) bubble */
.message-row.self .msg-menu {
  background: #fff;
  color: #2563eb;
}

/* Optionally: dark theme override */
body.dark-theme .message-row.user .msg-menu {
  background: #2563eb !important ;
  color: #fff;
}
body.dark-theme .message-row.self .msg-menu {
  background: #303030 !important;
  color: #fff !important;
}
#chatBox {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  height: 100%;
}

.input-bg {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.chat-box {
  flex: 1 1 0;
  overflow-y: auto;
  min-height: 0;
}


@media (max-width: 600px) {
  .input-group {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100vw;
    background: #fff;
    z-index: 100;
  }
  .chat-box {
    height: calc(100vh - 55px); /* Adjust to match input height */
  }
}
