/* Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Inter", sans-serif;
}

:root {
  --primary-color: #0085ff;
  --secondary-color: #ff8a00;
  --sidebar-bg: #0a2342;
  --outgoing-msg-bg: #0085ff;
  --incoming-msg-bg: #f1f1f1;
  --active-bg: #eaf3fc;
  --text-primary: #333;
  --text-secondary: #666;
  --text-light: #999;
  --border-color: #eee;
  --hover-bg: #f5f5f5;
  --shadow-color: rgba(0, 0, 0, 0.1);
  --white: #fff;
  --red: #ff3b30;
  --green: #34c759;
}
/* Dark Mode and Light Mode Toggle */
body.light-mode {
  --primary-color: #0085ff;
  --secondary-color: #ff8a00;
  --sidebar-bg: #0a2342;
  --outgoing-msg-bg: #0085ff;
  --incoming-msg-bg: #f1f1f1;
  --active-bg: #eaf3fc;
  --text-primary: #333;
  --text-secondary: #666;
  --text-light: #999;
  --border-color: #eee;
  --hover-bg: #f5f5f5;
  --shadow-color: rgba(0, 0, 0, 0.1);
  --white: #fff;
  --red: #ff3b30;
  --green: #34c759;
}

body.dark-mode {
  --primary-color: #3b82f6;
  --secondary-color: #f97316;
  --sidebar-bg: #111827;
  --outgoing-msg-bg: #3b82f6;
  --incoming-msg-bg: #374151;
  --active-bg: #1e293b;
  --text-primary: #f3f4f6;
  --text-secondary: #d1d5db;
  --text-light: #9ca3af;
  --border-color: #1f2937;
  --hover-bg: #1f2937;
  --shadow-color: rgba(0, 0, 0, 0.3);
  --white: #111827;
  --red: #ef4444;
  --green: #10b981;
}

body {
  background-color: var(--white);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
}

.app-container {
  display: flex;
  height: 100vh;
  position: relative;
}

.logo-img {
  width: 2rem;
  height: 2rem;
  margin-right: 0.5rem;
}

/* Sidebar */
.sidebar {
  /* width: 4.5rem; */
  background-color: #051440;
  color: var(--white);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem 0;
  position: fixed;
  height: 100%;
  z-index: 10;
}

.sidebar-icons {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  /* margin-bottom: 1.3rem; */
  /* margin-top: 2rem; */
}

.sidebar-icon {
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

.sidebar-icon:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.sidebar-icon.active {
  background-color: rgba(255, 255, 255, 0.2);
}

.sidebar-bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.user-avatar1 {
  width: 2.5rem;
  height: 2.5rem;
  background-color: #ccc;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: 3rem;
  display: flex;
  flex-direction: column;
  height: 100%;
  width: calc(100% - 4.5rem);
}

/* Top Navigation */
.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 2px 4px var(--shadow-color);
  width: 97%;
  position: fixed;
  top: 0;
  background: var(--white);
  z-index: 5;
}

.logo {
  display: flex;
  align-items: center;
}

.logo-image {
  display: flex;
  align-items: center;
}

.logo-saga {
  color: var(--primary-color);
  font-weight: bold;
  font-size: 1.25rem;
}

.logo-chat {
  color: var(--secondary-color);
  font-weight: bold;
  font-size: 1.25rem;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.search-container {
  position: relative;
}

.search-input {
  padding: 0.5rem 0.75rem 0.5rem 2rem;
  border: 1px solid #ddd;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  width: 12rem;
}

.search-container i {
  position: absolute;
  left: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  font-size: 0.875rem;
}

.nav-icon {
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.2s;
  position: relative;
}

.nav-icon:hover {
  background-color: var(--hover-bg);
}

.notification-badge {
  position: absolute;
  top: 0;
  right: 0;
  background-color: var(--red);
  color: var(--white);
  font-size: 0.7rem;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Center Navigation */
.center-nav {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding: 0 1rem;
  /* overflow-x: auto; */
  position: fixed;
  top: 4rem;
  width: 100%;
  background: var(--white);
  z-index: 4;
  font-size: 0.875rem;
  font-weight: 500;
}

.tabs {
  display: flex;
}

.tab {
  padding: 1rem;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  margin-left: 1%;
}

.tab:hover {
  color: var(--primary-color);
}

.tab.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

.new-items-dropdown {
  position: relative;
  display: inline-block;
  cursor: pointer;
  margin-left: 53%;
  background-color: #0085ff;
  padding: 0.5rem 0.5rem;
  border-radius: 2rem;
}



.dropdown-content {
  display: none; /* Start with the dropdown hidden */
  position: absolute;
  background-color: var(--white);
  min-width: 160px;
  box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.2);
  z-index: 2000; /* Ensure dropdown is above other elements */
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  overflow: hidden;
  overflow-y: auto;
  max-height: 15rem;
  right: 0; /* Align dropdown to the inside of the parent */
}

.new-items-dropdown:hover .dropdown-content,
.dropdown-content.show {
  display: block; /* Show dropdown on hover or when explicitly triggered */
}

.dropdown-item {
  padding: 0.75rem 1rem;
  cursor: pointer;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  /* z-index: ; */
}

.dropdown-item:hover {
  background-color: var(--hover-bg);
}

/* Collapse All Button */
.collapse-all-container {
  padding: 0.5rem 1rem;
  position: fixed;
  top: 7.5rem;
  width: 100%;
  background: var(--white);
  z-index: 3;
  border-bottom: 1px solid var(--border-color);
}

.collapse-all-button {
  background: none;
  border: none;
  font-size: 0.875rem;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.collapse-all-button:hover {
  color: var(--primary-color);
}

/* Chat Container */
.chat-container {
  display: flex;
  flex: 1;
  margin-top: 8rem; /* 10% from top as requested */
  height: calc(100% - 10rem);
}

/* Chat List */
.chat-list {
  width: 20rem;
  border-right: 1px solid var(--border-color);
  /* overflow-y: auto; */
  height: 100%;
}

.chat-section {
  margin-bottom: 1rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
}

.section-title {
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.section-more {
  cursor: pointer;
  position: relative;
}

.section-options {
  padding: 0.25rem;
  border-radius: 0.25rem;
}

.section-options:hover {
  background-color: var(--hover-bg);
}

.section-dropdown {
  position: absolute;
  right: 0;
  top: 100%;
  background-color: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  box-shadow: 0 4px 12px var(--shadow-color);
  z-index: 10;
  min-width: 10rem;
}

/* Editable input hidden by default */
.editable-input {
  font-size: 16px;
  padding: 2px 5px;
  width: auto;
  border: 1px solid #ccc;
  border-radius: 4px;
}

/* Optional: show input when editing */
.edit-mode .section-title {
  display: none;
}

.edit-mode .editable-input {
  display: inline-block;
}

.chat-items {
  display: flex;
  flex-direction: column;
}

.chat-item {
  display: flex;
  padding: 0.25rem 1rem;
  cursor: pointer;
  position: relative;
  align-items: center;
}

.chat-items.hidden {
  display: none !important;
}

.chat-item:hover {
  background-color: var(--hover-bg);
}

.chat-item.active {
  background-color: var(--active-bg);
}

.chat-item.unread::before {
  content: "";
  position: absolute;
  left: 0.25rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0.25rem;
  height: 0.25rem;
  background-color: var(--green);
  border-radius: 50%;
}

.chat-avatar {
  width: 2.5rem;
  height: 2.5rem;
  background-color: #ccc;
  border-radius: 50%;
  margin-right: 0.75rem;
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
}

.chat-profile {
  width: 2.5rem;
  height: 2.5rem;
  background-color: #ccc;
  border-radius: 50%;
  margin-right: 0.75rem;
  flex-shrink: 0;
}
.chat-details {
  flex: 1;
  min-width: 0;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px;
  border-radius: 5px;
}

.chat-header-1 {
  margin-bottom: 0.25rem;
  padding-bottom: 0.15rem;
}

.chat-name {
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-time {
  font-size: 0.75rem;
  color: var(--text-light);
  white-space: nowrap;
}

.chat-message {
  font-size: 0.654rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.25rem;
  max-width: 100%;
}

.chat-options {
  opacity: 0;
  transition: opacity 0.2s;
  position: relative;
  padding: 0.25rem;
}

.chat-item:hover .chat-options {
  opacity: 1;
}

.user-dropdown {
  position: absolute;
  right: 0;
  top: 100%;
  background-color: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  box-shadow: 0 4px 12px var(--shadow-color);
  z-index: 10;
  min-width: 10rem;
}

.see-more {
  text-align: center;
  padding: 1rem;
  color: var(--primary-color);
  font-size: 0.875rem;
  cursor: pointer;
}

.user-dropdown {
  position: absolute;
  background: #fff;
  border: 1px solid #ddd;
  padding: 8px;
  border-radius: 6px;
  /* z-index: 10; */
  width: 180px;
  z-index: 10;
  /* display: none; */
}

.nested-dropdown {
  position: absolute;
  background: #fff;
  border: 1px solid #ddd;
  padding: 8px;
  border-radius: 6px;
  z-index: 10;
  width: 180px;
}

.hidden {
  display: none;
}

.has-submenu {
  position: relative;
}

.has-submenu .nested-dropdown {
  top: 0;
  left: 100%;
  margin-left: 4px;
}

/* Chat Window */
.chat-window {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
}

.empty-state-text {
  margin-top: 1%;
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.empty-state h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: var(--text-secondary);
}

.active-chat {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  /* padding: 1rem; */
  /* border-bottom: 1px solid var(--border-color); */
}

.chat-user {
  display: flex;
  align-items: center;
  margin-left: 15%;
}

.back-button {
  display: none;
  margin-right: 0.5rem;
  cursor: pointer;
}

.user-info {
  margin-left: 0.75rem;
}

.user-name {
  font-weight: 500;
}

.user-status {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.chat-actions {
  display: flex;
  gap: 0.75rem;
  margin-right: 15%;
}

.action-icon {
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.2s;
}

.action-icon:hover {
  background-color: var(--hover-bg);
}

.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 0.5rem;
  margin-bottom: 0.1rem; /* Space for the input bar */
  margin-left: 15%;
  margin-right: 15%;
}

.message {
  display: flex;
  max-width: 70%;
}

.message.outgoing {
  align-self: flex-end;
}

.message.incoming {
  align-self: flex-start;
}

.message-content {
  padding: 0.75rem 1rem;
  border-radius: 1rem;
  position: relative;
}

.message.outgoing .message-content {
  background-color: var(--outgoing-msg-bg);
  color: var(--white);
  border-radius: 1rem 1rem 0rem 1rem; /* Top-left corner radius is 0 */
}

.message.incoming .message-content {
  background-color: var(--incoming-msg-bg);
  color: var(--text-primary);
  border-radius: 1rem 1rem 1rem 0rem; /* Top-right corner radius is 0 */
}

.message-time {
  font-size: 0.75rem;
  margin-top: 0.25rem;
  text-align: right;
}

.message.outgoing .message-time {
  color: rgba(255, 255, 255, 0.7);
}

.message.incoming .message-time {
  color: var(--text-light);
}

.message-input-container {
  padding: 1rem;
  /* border-top: 1px solid var(--border-color); */
  margin-left: 15%;
  margin-right: 15%;
}

.message-input-wrapper {
  display: flex;
  align-items: center;
  background-color: #f5f5f5;
  border-radius: 2rem;
  padding: 0.5rem 1rem;
}

.input-icon {
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  position: relative;
}

.input-icon:hover {
  color: var(--primary-color);
}

.input-icon.send {
  color: var(--primary-color);
}

.recording-indicator {
  position: absolute;
  bottom: -1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--red);
  color: var(--white);
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  white-space: nowrap;
}

.message-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0.5rem;
  outline: none;
  font-size: 0.875rem;
  resize: none;
  min-height: 40px;
  max-height: 120px;
  overflow-y: auto;
  word-wrap: break-word;
  line-height: 1.5;
}

.file-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

/* Modals */
.modal {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-content {
  background-color: var(--white);
  border-radius: 0.75rem;
  width: 100%;
  max-width: 30rem;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  cursor: pointer;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.modal-header {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.settings-title {
  margin-left: 0.5rem;
  color: var(--text-secondary);
}

.modal-body {
  padding: 1.5rem;
}

.settings-section {
  margin-bottom: 1.5rem;
}

.settings-section h3 {
  margin-bottom: 1rem;
  font-size: 1rem;
}

.settings-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.switch {
  position: relative;
  display: inline-block;
  width: 3rem;
  height: 1.5rem;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 1.1rem;
  width: 1.1rem;
  left: 0.2rem;
  bottom: 0.2rem;
  background-color: white;
  transition: .4s;
}

input:checked + .slider {
  background-color: var(--primary-color);
}

input:focus + .slider {
  box-shadow: 0 0 1px var(--primary-color);
}

input:checked + .slider:before {
  transform: translateX(1.5rem);
}

.slider.round {
  border-radius: 1.5rem;
}

.slider.round:before {
  border-radius: 50%;
}

.modal-footer {
  padding: 1rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
}

.save-button {
  padding: 0.5rem 1rem;
  background-color: var(--primary-color);
  color: var(--white);
  border: none;
  border-radius: 0.25rem;
  cursor: pointer;
  font-weight: 500;
}

.call-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1rem;
}

.call-avatar {
  width: 6rem;
  height: 6rem;
  background-color: #ccc;
  border-radius: 50%;
  margin-bottom: 1rem;
}

.call-name {
  font-size: 1.25rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.call-status {
  color: var(--text-secondary);
}

.call-actions {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  padding: 1.5rem;
}

.call-action {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background-color: #f5f5f5;
}

.call-action.end {
  background-color: var(--red);
  color: var(--white);
}

/* Help Panel */
.help-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 24rem;
  background-color: var(--white);
  box-shadow: -2px 0 10px var(--shadow-color);
  z-index: 50;
  display: flex;
  flex-direction: column;
}

.help-header {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.help-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

.help-section {
  margin-bottom: 1.5rem;
}

.help-section h3 {
  margin-bottom: 1rem;
  font-size: 1rem;
}

.help-section ul {
  list-style: none;
}

.help-section li {
  margin-bottom: 0.5rem;
}

.help-section a {
  color: var(--primary-color);
  text-decoration: none;
}

.help-section a:hover {
  text-decoration: underline;
}

/* Emoji Picker */
.emoji-picker {
  position: absolute;
  bottom: 4rem;
  left: 40rem;
  background-color: var(--white);
  border-radius: 0.5rem;
  box-shadow: 0 4px 12px var(--shadow-color);
  width: 16rem;
  z-index: 20;
}

.emoji-categories {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  padding: 0.5rem;
}

.emoji-category {
  padding: 0.5rem;
  cursor: pointer;
  border-radius: 0.25rem;
}

.emoji-category.active {
  background-color: var(--hover-bg);
}

.emoji-list {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  padding: 0.5rem;
  max-height: 12rem;
  overflow-y: auto;
}

.emoji {
  font-size: 1.25rem;
  padding: 0.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.25rem;
}

.emoji:hover {
  background-color: var(--hover-bg);
}

/* Notification Dropdown */
.notification-dropdown {
  position: absolute;
  top: 3.5rem;
  right: 1rem;
  background-color: var(--white);
  border-radius: 0.5rem;
  box-shadow: 0 4px 12px var(--shadow-color);
  width: 20rem;
  z-index: 20;
}

.dropdown-header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  font-weight: 500;
}

.dropdown-action {
  color: var(--primary-color);
  cursor: pointer;
  font-size: 0.75rem;
}

.notification-list {
  max-height: 20rem;
  overflow-y: auto;
}

.notification-item {
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
}

.notification-item:hover {
  background-color: var(--hover-bg);
}

.notification-item.unread {
  background-color: rgba(0, 133, 255, 0.05);
}

.notification-avatar {
  width: 2.5rem;
  height: 2.5rem;
  background-color: #ccc;
  border-radius: 50%;
  margin-right: 0.75rem;
}

.notification-content {
  flex: 1;
}

.notification-text {
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

.notification-time {
  font-size: 0.75rem;
  color: var(--text-light);
}

.dropdown-footer {
  padding: 0.75rem 1rem;
  text-align: center;
  border-top: 1px solid var(--border-color);
}

.dropdown-footer a {
  color: var(--primary-color);
  text-decoration: none;
  font-size: 0.875rem;
}

/* Utility Classes */
.hidden {
  display: none !important;
}

/* Dark Mode */
body.dark-mode {
  --primary-color: #3b82f6;
  --secondary-color: #f97316;
  --sidebar-bg: #111827;
  --outgoing-msg-bg: #3b82f6;
  --incoming-msg-bg: #374151;
  --active-bg: #1e293b;
  --text-primary: #f3f4f6;
  --text-secondary: #d1d5db;
  --text-light: #9ca3af;
  --border-color: #1f2937;
  --hover-bg: #1f2937;
  --shadow-color: rgba(0, 0, 0, 0.3);
  --white: #111827;
  --red: #ef4444;
  --green: #10b981;

  background-color: #111827;
}

/* New styles for the added features */

/* 1. User Info Panel */
.user-info-panel {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 300px;
  background-color: var(--white);
  border-left: 1px solid var(--border-color);
  box-shadow: -2px 0 10px var(--shadow-color);
  z-index: 20;
  display: flex;
  flex-direction: column;
}

.user-info-header {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.close-panel {
  cursor: pointer;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.close-panel:hover {
  background-color: var(--hover-bg);
}

.user-info-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.user-info-avatar {
  margin-bottom: 1rem;
}

.large-avatar {
  width: 6rem;
  height: 6rem;
  border-radius: 50%;
  object-fit: cover;
}

.user-info-name {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.user-info-status {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.user-info-details {
  width: 100%;
  margin-bottom: 1.5rem;
}

.info-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.info-label {
  font-weight: 500;
  color: var(--text-secondary);
}

.user-info-actions {
  display: flex;
  gap: 0.75rem;
  width: 100%;
}

.action-button {
  flex: 1;
  padding: 0.75rem;
  border: none;
  border-radius: 0.5rem;
  background-color: var(--hover-bg);
  color: var(--text-primary);
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.action-button.call {
  background-color: var(--primary-color);
  color: var(--white);
}

.action-button:hover {
  opacity: 0.9;
}

/* 2. Message Options Popup */
.message-options-popup {
  position: fixed;
  background-color: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  box-shadow: 0 4px 12px var(--shadow-color);
  z-index: 30;
  min-width: 10rem;
}

@media (max-width: 768px) {
  .message-options-popup {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    border-radius: 1rem 1rem 0 0;
    min-width: unset;
    width: 100%;
  }
}

.message-option {
  padding: 0.75rem 1rem;
  cursor: pointer;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
}

.message-option:hover {
  background-color: var(--hover-bg);
}

.nested-options {
  position: absolute;
  right: -10rem;
  top: 0;
  background-color: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  box-shadow: 0 4px 12px var(--shadow-color);
  min-width: 10rem;
}

.nested-option {
  padding: 0.75rem 1rem;
  cursor: pointer;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nested-option:hover {
  background-color: var(--hover-bg);
}

.emoji-reactions {
  position: absolute;
  right: -12rem;
  top: 0;
  background-color: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  box-shadow: 0 4px 12px var(--shadow-color);
  padding: 0.5rem;
  display: flex;
  gap: 0.5rem;
}

.reaction-emoji {
  font-size: 1.25rem;
  padding: 0.5rem;
  cursor: pointer;
  border-radius: 0.25rem;
}

.reaction-emoji:hover {
  background-color: var(--hover-bg);
}

.message-reactions {
  display: flex;
  gap: 0.25rem;
  margin-top: 0.5rem;
}

.message-reaction {
  font-size: 1rem;
  background-color: rgba(0, 0, 0, 0.1);
  padding: 0.25rem;
  border-radius: 0.25rem;
}

/* 3. Video Call Styles */
.video-call-content {
  max-width: 80vw;
  width: 80vw;
  height: 80vh;
  display: flex;
  flex-direction: column;
}

.video-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  position: relative;
  background-color: #000;
  border-radius: 0.75rem 0.75rem 0 0;
  overflow: hidden;
}

.video-container {
  width: 100%;
  height: 100%;
  position: relative;
}

.video-container video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-name {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  background-color: rgba(0, 0, 0, 0.5);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
}

.self-video {
  position: absolute;
  width: 20%;
  height: 20%;
  bottom: 1rem;
  right: 1rem;
  border: 2px solid white;
  border-radius: 0.5rem;
  overflow: hidden;
}

.video-call-controls {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  padding: 1.5rem;
  background-color: #f5f5f5;
  border-radius: 0 0 0.75rem 0.75rem;
}

/* 4. Group Creation Styles */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.form-group input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  font-size: 0.875rem;
}

.selected-members {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}

.selected-member {
  display: flex;
  align-items: center;
  background-color: var(--hover-bg);
  padding: 0.5rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
}

.remove-member {
  margin-left: 0.5rem;
  cursor: pointer;
  color: var(--text-light);
}

.remove-member:hover {
  color: var(--red);
}

.contact-list {
  max-height: 15rem;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
}

.contact-item {
  display: flex;
  align-items: center;
  padding: 0.75rem;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
}

.contact-item:hover {
  background-color: var(--hover-bg);
}

.contact-item:last-child {
  border-bottom: none;
}

.contact-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  margin-right: 0.75rem;
}

.contact-name {
  font-size: 0.875rem;
  font-weight: 500;
}

.cancel-button {
  padding: 0.5rem 1rem;
  background-color: var(--hover-bg);
  border: none;
  border-radius: 0.25rem;
  cursor: pointer;
  font-weight: 500;
  margin-right: 0.5rem;
}

.create-group-button {
  padding: 0.5rem 1rem;
  background-color: var(--primary-color);
  color: var(--white);
  border: none;
  border-radius: 0.25rem;
  cursor: pointer;
  font-weight: 500;
}

/* 5. Call History */
.call-history-container {
  flex: 0.3;
  /* display: flex; */
  flex-direction: column;
  border-right: 1px solid var(--border-color);
  overflow-y: auto;
  font-size: 14px;
}

.call-history-header {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.call-history-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.call-history-filters {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.filter-button {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  background: none;
  cursor: pointer;
  font-size: 0.875rem;
  white-space: nowrap;
}

.filter-button.active {
  background-color: var(--primary-color);
  color: var(--white);
  border-color: var(--primary-color);
}

.call-list {
  display: flex;
  flex-direction: column;
}

.call-item {
  display: flex;
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  align-items: center;
}

.call-item:hover {
  background-color: var(--hover-bg);
}

.call-item.missed .call-info {
  color: var(--red);
}

.call-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  margin-right: 1rem;
  flex-shrink: 0;
}

.call-details {
  flex: 1;
}

.call-name {
  font-weight: 500;
  margin-bottom: 0.25rem;
  font-size: 0.875rem;
  color: var(--text-primary);
  
}

.call-info {
  font-size: 0.875rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.call-actions {
  display: flex;
  gap: 0.5rem;
}

.call-button,
.video-call-button,
.info-button {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: none;
  background-color: var(--hover-bg);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.call-button {
  background-color: var(--primary-color);
  color: var(--white);
}

/* 8. Search Bar Styles */
.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 0 0 8px 8px;
  max-height: 300px;
  overflow-y: auto;
  z-index: 1100;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.search-result-item {
  padding: 10px 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-color);
}

.search-result-item:hover {
  background-color: var(--hover-bg);
}

.search-result-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  overflow: hidden;
}

.search-result-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.search-result-details {
  flex: 1;
}

.search-result-name {
  font-weight: 500;
  margin-bottom: 2px;
}

.search-result-text {
  font-size: 12px;
  color: var(--text-secondary);
}

.search-result-type {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 10px;
  background-color: var(--hover-bg);
}

/* 9. File Sharing Styles */
.file-preview-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.9);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.file-preview-content {
  max-width: 90%;
  max-height: 80%;
  position: relative;
}

.file-preview-content img,
.file-preview-content video {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
}

.file-preview-controls {
  position: absolute;
  bottom: -50px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 20px;
}

.file-preview-control {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.2);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.file-preview-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.2);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* 4. New Section Styles */
.selected-chats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}

.selected-chat-item {
  display: flex;
  align-items: center;
  background-color: var(--hover-bg);
  padding: 0.5rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
}

.selected-chat-avatar {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  margin-right: 0.5rem;
}

.remove-chat {
  margin-left: 0.5rem;
  cursor: pointer;
  color: var(--text-light);
}

.remove-chat:hover {
  color: var(--red);
}

.chat-selection-list {
  max-height: 15rem;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
}

.chat-selection-item {
  display: flex;
  align-items: center;
  padding: 0.75rem;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
}

.chat-selection-item:hover {
  background-color: var(--hover-bg);
}

.chat-selection-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  margin-right: 0.75rem;
}

.chat-selection-name {
  font-size: 0.875rem;
  font-weight: 500;
}

.drop-zone {
  border: 2px dashed var(--border-color);
  padding: 1.5rem;
  border-radius: 0.5rem;
  text-align: center;
  color: var(--text-secondary);
  margin-top: 1rem;
}

.drop-zone.active {
  border-color: var(--primary-color);
  background-color: rgba(0, 133, 255, 0.05);
}

.draggable-item {
  cursor: grab;
}

.draggable-item:active {
  cursor: grabbing;
}

/* 5. User Info View */
.username-in-message {
  font-weight: 600;
  color: var(--primary-color);
  cursor: pointer;
}

.username-in-message:hover {
  text-decoration: underline;
}

/* Group Members List */
.group-members {
  width: 100%;
  margin-top: 1rem;
}

.group-members h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.member-list {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
}

.member-item {
  display: flex;
  align-items: center;
  padding: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.member-item:last-child {
  border-bottom: none;
}

.member-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  margin-right: 0.75rem;
}

.member-name {
  flex: 1;
  font-size: 0.875rem;
}

.member-role {
  font-size: 0.75rem;
  color: var(--text-light);
}

/* Notification Settings */
.notification-settings {
  width: 100%;
  margin-top: 1rem;
  margin-bottom: 1rem;
}

.notification-settings h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

/* Shared Files */
.shared-files {
  width: 100%;
  margin-top: 1rem;
}

.shared-files h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.file-list {
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  overflow: hidden;
}

.file-item {
  display: flex;
  align-items: center;
  padding: 0.75rem;
  border-bottom: 1px solid var(--border-color);
  gap: 0.5rem;
}

.file-item:last-child {
  border-bottom: none;
}

/* Responsive Styles */
/* Mobile View (up to 576px) */
@media (max-width: 576px) {
  .chat-container {
    flex-direction: column;
  }

  .chat-list {
    width: 100% !important;
    height: auto;
    max-height: 100%;
  }

  .chat-window {
    width: 100%;
  }

  .active-chat {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    background-color: var(--white);
  }

  .messages-container {
    margin-left: 5%;
    margin-right: 5%;
  }

  .message-input-container {
    margin-left: 5%;
    margin-right: 5%;
  }

  .chat-user {
    margin-left: 5%;
  }

  .chat-actions {
    margin-right: 5%;
  }

  .user-info-panel {
    width: 100%;
  }

  .call-history-container {
    width: 100%;
  }

  .search-input {
    width: 8rem;
  }

  .center-nav {
    padding: 0 0.5rem;
  }

  .tab {
    padding: 1rem 0.5rem;
  }

  .collapse-all-container {
    padding: 0.5rem;
  }
}

/* Tablet View (577px to 768px) */
@media (min-width: 577px) and (max-width: 768px) {
  .chat-list {
    width: 40%;
  }

  .messages-container {
    margin-left: 10%;
    margin-right: 10%;
  }

  .message-input-container {
    margin-left: 10%;
    margin-right: 10%;
  }

  .user-info-panel {
    width: 50%;
  }

  .message-options-popup {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    border-radius: 1rem 1rem 0 0;
  }

  .nested-options,
  .emoji-reactions {
    position: static;
    margin-top: 0.5rem;
    margin-left: 1.5rem;
    box-shadow: none;
    border: none;
  }
}

/* Laptop View (769px to 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  .chat-list {
    width: 30%;
  }

  .messages-container {
    margin-left: 10%;
    margin-right: 10%;
  }

  .message-input-container {
    margin-left: 10%;
    margin-right: 10%;
  }
}

/* Desktop View (1025px and above) */
@media (min-width: 1025px) {
  .chat-list {
    width: 20rem;
  }

  .messages-container {
    margin-left: 15%;
    margin-right: 15%;
  }

  .message-input-container {
    margin-left: 15%;
    margin-right: 15%;
  }
}

/* Fix for modals on mobile */
@media (max-width: 768px) {
  .modal-content {
    width: 95%;
    max-width: 95%;
  }

  .video-call-content {
    width: 95vw;
    max-width: 95vw;
  }
}