body {
  padding: 80px 0;
}

/* Premium Chat Container */
.dm-chat-container {
  display: flex;
  height: calc(100vh - 70px);
  background: #f5f7fa;
  overflow: hidden;
}

/* Enhanced Sidebar */
.dm-chat-sidebar {
  width: 380px;
  background: white;
  border-right: 1px solid #e8ecef;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid #e8ecef;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #87D3F8;
}

.header-title {
  display: flex;
  align-items: center;
  gap: 12px;
  color: white;
}

.header-title i {
  font-size: 24px;
}

.header-title h4 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
}

.btn-sent {
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 20px;
  color: white;
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.3s ease;
}

.btn-sent:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

/* Enhanced Search */
.chat-search {
  padding: 16px;
  border-bottom: 1px solid #e8ecef;
}

.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 16px;
  color: #999;
  font-size: 14px;
}

.search-input {
  width: 100%;
  padding: 12px 40px 12px 44px;
  border: 2px solid #e8ecef;
  border-radius: 25px;
  font-size: 14px;
  transition: all 0.3s ease;
  background: #f8f9fa;
}

.search-input:focus {
  outline: none;
  border-color: #667eea;
  background: white;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.clear-search {
  position: absolute;
  right: 12px;
  width: 24px;
  height: 24px;
  border: none;
  background: #e0e0e0;
  border-radius: 50%;
  color: #64748B;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.clear-search:hover {
  background: #ccc;
  transform: scale(1.1);
}

/* Filter Tabs */
.chat-filter-tabs {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid #e8ecef;
  background: #fafbfc;
}

.filter-tab {
  flex: 1;
  padding: 8px 12px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #64748B;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.3s ease;
}

.filter-tab:hover {
  background: white;
  color: #667eea;
  transform: translateY(-2px);

}

.filter-tab.active {
  background: #2296f3;
  color: white;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* Rooms List */
.rooms-list-container {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.chat-list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  color: inherit;
  border-left: 3px solid transparent;
  position: relative;
}

.chat-list-item:hover {
  background: #f8f9fa;
}

.chat-list-item.active {
  background: linear-gradient(90deg, rgba(102, 126, 234, 0.08) 0%, transparent 100%);
  border-left-color: #07c8f9;
}

.chat-list-item.unread {
  background: rgba(102, 126, 234, 0.03);
}

/* .chat-avatar-wrapper {
  position: relative;
  flex-shrink: 0;
} */

/* .chat-avatar,
.user-avatar,
.message-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #f0f0f0;
}

.chat-avatar-placeholder,
.user-avatar-placeholder,
.message-avatar-placeholder {
  background: #87D3F8 ;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  transform: translateY(-2px);
} */

.message-avatar {
  width: 32px;
  height: 32px;
  font-size: 14px;
}

.online-indicator {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  background: #10b981;
  border: 3px solid white;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

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

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.chat-name {
  font-weight: 700;
  font-size: 15px;
  color: #667eea;
}

.chat-time {
  font-size: 12px;
  color: #999;
  font-weight: 600;
}

.chat-preview {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.last-message {
  font-size: 13px;
  color: #64748B;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.last-message i {
  margin-right: 4px;
  font-size: 11px;
}

.last-message i.read {
  color: #667eea;
}

.unread-badge {
  background: linear-gradient(90deg, #07c8f9 0%, #0d41e1 100%);
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  min-width: 20px;
  text-align: center;
}

/* Premium Chat Main */
.dm-chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: white;
  position: relative;
}

.mobile-back-btn {
  display: none;
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(102, 126, 234, 0.1);
  border-radius: 50%;
  color: #667eea;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

/* Premium Chat Header */
.dm-chat-header {
  padding: 16px 24px;
  border-bottom: 1px solid #e8ecef;
  display: flex;
  align-items: center;
  gap: 16px;
  background: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  z-index: 10;
}

.header-user-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: -11px;
}

.user-name-link {
  text-decoration: none;
  color: inherit;
}

.user-name {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: #667eea;
  transition: color 0.3s ease;
}

.user-name-link:hover .user-name {
  color: #667eea;
}

.user-status {
  font-size: 13px;
  color: #999;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.online-dot {
  color: #10b981;
  font-size: 8px;
}

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

.header-action-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: #f8f9fa;
  border-radius: 50%;
  color: #64748B;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  text-decoration: none;
}

.header-action-btn:hover {
  background: linear-gradient(90deg, #07c8f9 0%, #0d41e1 100%);
  color: white;
  transform: scale(1.1);
}

/* Messages Area */
.dm-messages-area {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background: #f8f9fa;
  position: relative;
  scroll-behavior: smooth;
}

.date-divider {
  text-align: center;
  margin: 24px 0;
  position: relative;
}

.date-divider span {
  background: white;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 12px;
  color: #999;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* Premium Message Bubbles */
.message-wrapper {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  animation: fadeInUp 0.3s ease;
}

.message-sent {
  justify-content: flex-end;
}

.message-received {
  justify-content: flex-start;
}

.message-avatar-wrapper {
  flex-shrink: 0;
}

.message-content-wrapper {
  max-width: 65%;
  position: relative;
}

.message-bubble {
  padding: 12px 16px;
  border-radius: 18px;
  position: relative;
  word-wrap: break-word;
  color: #64748B;
}

.message-sent .message-bubble {
  background: #87D3F8;
  color: white;
  border-bottom-right-radius: 4px;
  margin-left: auto;
  border: 1px solid #AFDBF5;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);

}

.message-received .message-bubble {
  background: white;
  color: #87D3F8;
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.message-text {
  line-height: 1.5;
  font-size: 14px;
  color: #64748B;
}

.message-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 11px;
  opacity: 0.7;
}

.message-status i {
  font-size: 12px;
}

.message-status i.read {
  color: white;
}

/* Message Actions */
.message-actions {
  display: none;
  gap: 4px;
  margin-top: 6px;
}

.message-wrapper:hover .message-actions {
  display: flex;
}

.message-action-btn {
  padding: 6px 10px;
  border: none;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 12px;
  color: #64748B;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.3s ease;
}

.message-action-btn:hover {
  background: #667eea;
  color: white;
}

/* Scroll to Bottom Button */
.scroll-to-bottom {
  position: absolute;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border: none;
  background: white;
  border-radius: 50%;
  color: #667eea;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
}

.scroll-to-bottom:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

/* Typing Indicator */
.typing-indicator-container {
  padding: 0 24px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f8f9fa;
}

.typing-avatar {
  flex-shrink: 0;
}

.typing-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.typing-avatar-placeholder {
  background: linear-gradient(90deg, #07c8f9 0%, #0d41e1 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
}

.typing-bubble {
  background: white;
  padding: 12px 16px;
  border-radius: 18px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

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

.typing-dots span {
  width: 8px;
  height: 8px;
  background: #667eea;
  border-radius: 50%;
  animation: bounce 1.4s infinite;
}

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

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

@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-8px); }
}

/* Premium Input Area */
.dm-input-area {
  padding: 1rem 1.5rem;
  border-top: 1px solid #e2e8f0;
  background: white;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.03);
  flex-shrink: 0;
  min-height: 76px; /* Фиксированная минимальная высота */

  .typing-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    font-size: 0.875rem;
    color: #718096;

    .typing-dots {
      display: flex;
      gap: 3px;

      span {
        width: 6px;
        height: 6px;
        background: #cbd5e0;
        border-radius: 50%;
        animation: typingBounce 1.4s infinite;

        &:nth-child(2) {
          animation-delay: 0.2s;
        }

        &:nth-child(3) {
          animation-delay: 0.4s;
        }
      }
    }
  }

  .input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;

    .attachment-btn {
      width: 40px;
      height: 40px;
      border-radius: 50%;
      border: 1px solid #e2e8f0;
      background: white;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: all 0.2s ease;
      flex-shrink: 0;

      &:hover {
        background: #f7fafc;
        border-color: #667eea;
        color: #667eea;
        transform: rotate(90deg);
      }
    }

    .input-container {
      flex: 1;
      position: relative;

      .message-textarea {
        width: 100%;
        min-height: 44px;
        max-height: 120px;
        padding: 0.75rem 3rem 0.75rem 1rem;
        border: 1px solid #e2e8f0;
        border-radius: 22px;
        font-size: 0.938rem;
        resize: none;
        transition: all 0.2s ease;
        font-family: inherit;
        line-height: 1.5;

        &:focus {
          outline: none;
          border-color: #2296f3;
          box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
        }

        &::placeholder {
          color: #a0aec0;
        }
      }

      .emoji-btn {
        position: absolute;
        right: 1rem;
        bottom: 0.75rem;
        width: 28px;
        height: 40px;
        border: none;
        background: transparent;
        cursor: pointer;
        font-size: 1.25rem;
        transition: transform 0.2s ease;

        &:hover {
          transform: scale(1.15);
        }
      }
    }

    

    .send-btn {
      width: 44px;
      height: 44px;
      border-radius: 50%;
      border: none;
      background: #2296f3;
      color: white;
      display: flex;
      margin-bottom: 10px;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: all 0.2s ease;
      flex-shrink: 0;
      box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);

      &:hover:not(:disabled) {
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
      }

      &:disabled {
        opacity: 0.5;
        cursor: not-allowed;
      }
    }
  }
}

/* Основной контейнер для элемента списка */
.chat-list-item-wrapper {
  display: flex;
  align-items: center;
  padding: 10px;
  border-bottom: 1px solid #eee;
  transition: background 0.2s;
  position: relative;
}

.chat-list-item-wrapper:hover {
  background-color: #f8f9fa;
}

.chat-list-item-wrapper.active {
  background-color: #e9ecef;
}

/* Ссылка-аватар */
.chat-avatar-link {
  z-index: 2; /* Чтобы аватар был поверх ссылки чата */
  text-decoration: none;
  margin-right: 12px;
}

/* Кликабельная область чата */
.chat-info-clickable-area {
  flex: 1; /* Занимает всё оставшееся место */
  text-decoration: none;
  color: inherit;
  display: block;
}

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