.messages-content {
  margin-top: 60px;
  height: calc(100vh - 60px);
  overflow: hidden;
}

.messages-container {
  display: flex;
  height: 100%;
  max-width: 1200px;
  margin: 0 auto;
  border: 1px solid #1a1a1a;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* Enhanced Chat List */
.chat-list {
  width: 350px;
  background-color: #000000;
  border-right: 1px solid #1a1a1a;
  display: flex;
  flex-direction: column;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px;
  border-bottom: 1px solid #1a1a1a;
  background-color: #0a0a0a;
}

.chat-header h2 {
  font-size: 24px;
  font-weight: 600;
  color: #ffffff;
}

.new-message-btn {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 20px;
  cursor: pointer;
  padding: 10px;
  border-radius: 50%;
  transition: all 0.3s ease;
  min-width: 40px;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.new-message-btn:hover {
  background-color: #1a1a1a;
  transform: scale(1.1);
}

.new-message-btn:active {
  transform: scale(0.95);
}

.chat-search {
  position: relative;
  padding: 20px 24px;
  border-bottom: 1px solid #1a1a1a;
  background-color: #0a0a0a;
}

.chat-search i {
  position: absolute;
  left: 40px;
  top: 50%;
  transform: translateY(-50%);
  color: #666;
  font-size: 14px;
  font-weight: 300;
}

.chat-search input {
  width: 100%;
  padding: 12px 16px 12px 40px;
  background-color: #1a1a1a;
  border: 1px solid #333;
  border-radius: 12px;
  color: #ffffff;
  font-size: 14px;
  transition: all 0.3s ease;
  min-height: 44px;
}

.chat-search input:focus {
  outline: none;
  border-color: #ffffff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
}

.chat-search input::placeholder {
  color: #666;
}

.chat-items {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.chat-items::-webkit-scrollbar {
  display: none;
}

.chat-item {
  display: flex;
  align-items: center;
  padding: 16px 24px;
  cursor: pointer;
  transition: all 0.3s ease;
  border-bottom: 1px solid #0a0a0a;
  position: relative;
}

.chat-item:hover {
  background-color: #0a0a0a;
}

.chat-item:active {
  background-color: #1a1a1a;
  transform: scale(0.98);
}

.chat-item.active {
  background-color: #1a1a1a;
  border-left: 3px solid #ffffff;
}

.chat-avatar {
  position: relative;
  margin-right: 16px;
  flex-shrink: 0;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.chat-avatar:hover {
  transform: scale(1.05);
}

.chat-avatar img {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #1a1a1a;
  transition: border-color 0.3s ease;
}

.chat-avatar:hover img {
  border-color: #333;
}

.online-indicator {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  background-color: #4caf50;
  border: 2px solid #000000;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(76, 175, 80, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
  }
}

.chat-info {
  flex: 1;
  min-width: 0;
}

.chat-name {
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 4px;
  color: #ffffff;
  cursor: pointer;
  transition: color 0.3s ease;
}

.chat-name:hover {
  color: #ccc;
}

.chat-preview {
  font-size: 14px;
  color: #666;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.chat-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.chat-time {
  font-size: 12px;
  color: #666;
  font-weight: 500;
}

.unread-count {
  background-color: #ffffff;
  color: #000000;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 12px;
  min-width: 20px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(255, 255, 255, 0.2);
  animation: bounce 0.5s ease-in-out;
}

@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-3px);
  }
  60% {
    transform: translateY(-2px);
  }
}

/* Enhanced Chat Window */
.chat-window {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: #000000;
}

.chat-window-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #1a1a1a;
  background-color: #0a0a0a;
}

.chat-user-info {
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: transform 0.2s ease;
  padding: 4px;
  border-radius: 12px;
}

.chat-user-info:hover {
  background-color: rgba(255, 255, 255, 0.05);
  transform: scale(1.02);
}

.chat-user-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #1a1a1a;
  transition: border-color 0.3s ease;
}

.chat-user-info:hover .chat-user-avatar {
  border-color: #333;
}

.chat-user-details h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 2px;
  color: #ffffff;
  transition: color 0.3s ease;
}

.chat-user-info:hover .chat-user-details h3 {
  color: #ccc;
}

.user-status {
  font-size: 12px;
  color: #4caf50;
  font-weight: 500;
}

.chat-actions {
  display: flex;
  gap: 12px;
}

.chat-action-btn {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 18px;
  cursor: pointer;
  padding: 10px;
  border-radius: 50%;
  transition: all 0.3s ease;
  min-width: 40px;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-action-btn i {
  font-weight: 300;
}

.chat-action-btn:hover {
  background-color: #1a1a1a;
  transform: scale(1.1);
}

.chat-action-btn:active {
  transform: scale(0.95);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.chat-messages::-webkit-scrollbar {
  display: none;
}

.message {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  max-width: 75%;
  animation: messageSlideIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.message.sent {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid #1a1a1a;
  cursor: pointer;
  transition: all 0.3s ease;
}

.message-avatar:hover {
  transform: scale(1.1);
  border-color: #333;
}

.message-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.message.sent .message-content {
  align-items: flex-end;
}

.message-bubble {
  background-color: #1a1a1a;
  color: #ffffff;
  padding: 14px 18px;
  border-radius: 20px;
  font-size: 14px;
  line-height: 1.4;
  word-wrap: break-word;
  max-width: 100%;
  position: relative;
  border: 1px solid #333;
  transition: all 0.3s ease;
  cursor: pointer;
}

.message-bubble:hover {
  background-color: #222;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.message.sent .message-bubble {
  background-color: #ffffff;
  color: #000000;
  border-color: #ffffff;
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

.message.sent .message-bubble:hover {
  background-color: #f0f0f0;
  box-shadow: 0 6px 16px rgba(255, 255, 255, 0.3);
}

.message-time {
  font-size: 11px;
  color: #666;
  padding: 0 6px;
  font-weight: 500;
}

/* Enhanced Chat Input */
.chat-input-container {
  padding: 24px;
  border-top: 1px solid #1a1a1a;
  background-color: #0a0a0a;
}

.chat-input {
  display: flex;
  align-items: center;
  gap: 12px;
  background-color: #1a1a1a;
  border: 1px solid #333;
  border-radius: 24px;
  padding: 12px 20px;
  transition: all 0.3s ease;
  min-height: 48px;
}

.chat-input:focus-within {
  border-color: #ffffff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
  background-color: #222;
}

.attachment-btn,
.emoji-btn,
.send-btn {
  background: none;
  border: none;
  color: #666;
  font-size: 18px;
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  transition: all 0.3s ease;
  min-width: 32px;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.attachment-btn i,
.emoji-btn i,
.send-btn i {
  font-weight: 300;
}

.attachment-btn:hover,
.emoji-btn:hover {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.1);
  transform: scale(1.1);
}

.attachment-btn:active,
.emoji-btn:active {
  transform: scale(0.95);
}

.send-btn {
  color: #ffffff;
}

.send-btn:hover {
  color: #ccc;
  background-color: rgba(255, 255, 255, 0.1);
  transform: scale(1.1);
}

.send-btn:active {
  transform: scale(0.95);
}

.chat-input input {
  flex: 1;
  background: none;
  border: none;
  color: #ffffff;
  font-size: 14px;
  outline: none;
  padding: 4px 0;
  font-family: "Baloo Thambi 2", cursive;
}

.chat-input input::placeholder {
  color: #666;
}

/* Mobile Navigation */
.mobile-chat-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background-color: rgba(0, 0, 0, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid #1a1a1a;
  z-index: 1003;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.mobile-nav-back {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 20px;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: all 0.3s ease;
  min-width: 40px;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-nav-back i {
  font-weight: 300;
}

.mobile-nav-back:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.mobile-nav-back:active {
  transform: scale(0.9);
}

.mobile-nav-title {
  font-size: 18px;
  font-weight: 600;
  color: #ffffff;
  flex: 1;
  text-align: center;
  cursor: pointer;
  transition: color 0.3s ease;
}

.mobile-nav-title:hover {
  color: #ccc;
}

.mobile-nav-actions {
  display: flex;
  gap: 8px;
}

/* Desktop only navbar */
.desktop-only {
  display: block;
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
  .desktop-only {
    display: none;
  }

  .mobile-chat-nav {
    display: flex !important;
  }

  .messages-content {
    height: 100vh;
    margin-top: 0;
  }

  .messages-container {
    flex-direction: column;
    border-radius: 0;
    border: none;
    height: 100vh;
    position: relative;
  }

  .chat-list {
    width: 100%;
    height: 100vh;
    border-right: none;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1000;
    transform: translateX(0);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  }

  .chat-list.hidden {
    transform: translateX(-100%);
  }

  .chat-window {
    width: 100%;
    height: 100vh;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 999;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  }

  .chat-window.active {
    transform: translateX(0);
  }

  .chat-header {
    padding: 20px;
    padding-top: 80px;
  }

  .chat-header h2 {
    font-size: 22px;
  }

  .chat-search {
    padding: 16px 20px;
  }

  .chat-search i {
    left: 36px;
  }

  .chat-search input {
    padding: 10px 14px 10px 36px;
    min-height: 40px;
  }

  .chat-item {
    padding: 14px 20px;
  }

  .chat-avatar img {
    width: 48px;
    height: 48px;
  }

  .online-indicator {
    width: 12px;
    height: 12px;
  }

  .chat-name {
    font-size: 15px;
  }

  .chat-preview {
    font-size: 13px;
  }

  .chat-window-header {
    padding: 16px 20px;
    padding-top: 76px;
    position: relative;
  }

  .chat-user-avatar {
    width: 40px;
    height: 40px;
  }

  .chat-user-details h3 {
    font-size: 15px;
  }

  .user-status {
    font-size: 11px;
  }

  .chat-actions {
    gap: 8px;
  }

  .chat-action-btn {
    font-size: 16px;
    padding: 8px;
    min-width: 36px;
    min-height: 36px;
  }

  .chat-messages {
    padding: 20px;
    gap: 14px;
    height: calc(100vh - 200px);
    padding-bottom: 100px;
  }

  .message {
    max-width: 85%;
    gap: 10px;
  }

  .message-avatar {
    width: 28px;
    height: 28px;
  }

  .message-bubble {
    padding: 12px 16px;
    font-size: 13px;
    border-radius: 18px;
  }

  .message-time {
    font-size: 10px;
    padding: 0 4px;
  }

  .chat-input-container {
    padding: 20px;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(10, 10, 10, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid #1a1a1a;
    z-index: 1001;
  }

  .chat-input {
    padding: 10px 16px;
    min-height: 44px;
    border-radius: 22px;
  }

  .attachment-btn,
  .emoji-btn,
  .send-btn {
    font-size: 16px;
    min-width: 28px;
    min-height: 28px;
  }

  .chat-input input {
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .mobile-chat-nav {
    padding: 0 12px;
  }

  .mobile-nav-title {
    font-size: 16px;
  }

  .chat-header {
    padding: 16px;
    padding-top: 76px;
  }

  .chat-header h2 {
    font-size: 20px;
  }

  .chat-search {
    padding: 14px 16px;
  }

  .chat-item {
    padding: 12px 16px;
  }

  .chat-avatar img {
    width: 44px;
    height: 44px;
  }

  .chat-name {
    font-size: 14px;
  }

  .chat-preview {
    font-size: 12px;
  }

  .chat-window-header {
    padding: 14px 16px;
    padding-top: 74px;
  }

  .chat-user-avatar {
    width: 36px;
    height: 36px;
  }

  .chat-user-details h3 {
    font-size: 14px;
  }

  .chat-messages {
    padding: 16px;
    gap: 12px;
  }

  .message-avatar {
    width: 24px;
    height: 24px;
  }

  .message-bubble {
    padding: 10px 14px;
    font-size: 12px;
    border-radius: 16px;
  }

  .chat-input-container {
    padding: 16px;
  }

  .chat-input {
    padding: 8px 14px;
    min-height: 40px;
    border-radius: 20px;
    gap: 10px;
  }

  .attachment-btn,
  .emoji-btn,
  .send-btn {
    font-size: 14px;
    min-width: 24px;
    min-height: 24px;
  }

  .chat-input input {
    font-size: 12px;
  }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
  .chat-item,
  .new-message-btn,
  .chat-action-btn,
  .attachment-btn,
  .emoji-btn,
  .send-btn,
  .mobile-nav-back,
  .chat-user-info,
  .chat-avatar,
  .message-avatar,
  .message-bubble {
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.1);
  }

  .chat-item:active {
    transform: scale(0.98);
    background-color: #1a1a1a;
  }

  .new-message-btn:active,
  .chat-action-btn:active {
    transform: scale(0.9);
  }

  .attachment-btn:active,
  .emoji-btn:active,
  .send-btn:active {
    transform: scale(0.85);
  }

  .mobile-nav-back:active {
    transform: scale(0.85);
  }

  .chat-user-info:active {
    transform: scale(0.98);
  }

  .chat-avatar:active {
    transform: scale(0.95);
  }

  .message-avatar:active {
    transform: scale(0.9);
  }

  .message-bubble:active {
    transform: scale(0.98);
  }
}

/* Enhanced typing indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  background-color: #1a1a1a;
  border-radius: 18px;
  margin: 8px 0;
  animation: fadeIn 0.3s ease-out;
}

.typing-dots {
  display: flex;
  gap: 4px;
}

.typing-dot {
  width: 6px;
  height: 6px;
  background-color: #666;
  border-radius: 50%;
  animation: typingDot 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) {
  animation-delay: -0.32s;
}

.typing-dot:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes typingDot {
  0%,
  80%,
  100% {
    transform: scale(0);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
