/* Messages Page Styles */
.messages-container {
  display: grid;
  grid-template-columns: 320px 1fr;
  height: calc(100vh - 72px);
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.conversations-list {
  border-right: 1px solid var(--border-light);
  overflow-y: auto;
}

.conversations-header {
  padding: 20px 16px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.conversations-header h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.conversation-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  transition: background 0.2s;
  border-bottom: 1px solid var(--border-light);
}

.conversation-item:hover,
.conversation-item.active {
  background: var(--bg-gray);
}

.conversation-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: white;
  flex-shrink: 0;
}

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

.conversation-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.conversation-preview {
  font-size: 0.8rem;
  color: var(--text-light);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-time {
  font-size: 0.75rem;
  color: var(--text-light);
  flex-shrink: 0;
}

.unread-badge {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
}

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

.chat-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-header .conversation-avatar {
  width: 36px;
  height: 36px;
  font-size: 0.85rem;
}

.chat-header .conversation-name {
  font-size: 0.95rem;
  margin: 0;
}

.messages-wrapper {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.message {
  display: flex;
  gap: 8px;
  max-width: 75%;
}

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

.message .message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: white;
  flex-shrink: 0;
}

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

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

.message-content {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.9rem;
  line-height: 1.5;
  background: var(--bg-gray);
  color: var(--text-primary);
  border-top-left-radius: 4px;
}

.message-own .message-content {
  background: var(--primary);
  color: white;
  border-top-left-radius: 14px;
  border-top-right-radius: 4px;
}

.message-time {
  font-size: 0.7rem;
  color: var(--text-light);
  margin-top: 2px;
}

.message-own .message-time {
  text-align: right;
}

.message-input-area {
  padding: 16px 20px;
  border-top: 1px solid var(--border-light);
}

.message-input-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-gray);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 4px 4px 4px 16px;
}

.message-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px 0;
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
}

.btn-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}

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

/* Modal */
.new-conversation-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.new-conversation-modal.open {
  display: flex;
}

.new-conversation-modal .modal-content {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  width: 480px;
  max-width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
}

.new-conversation-modal .modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.new-conversation-modal .modal-header h3 {
  margin: 0;
  font-size: 1.1rem;
}

.modal-actions {
  padding: 16px 24px;
  border-top: 1px solid var(--border-light);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.btn-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--bg-gray);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
}

.empty-state i {
  font-size: 3rem;
  margin-bottom: 16px;
  display: block;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-white);
  color: var(--text-primary);
  font-size: 0.9rem;
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}
