/* ==========================================================================
   CHAT.CSS — 1-to-1 Private Chat Component Styles
   ========================================================================== */

/* Chat Container */
.chat-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg-darkest);
}

.chat-empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  text-align: center;
  padding: 2rem;
}

.chat-empty-icon {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-lg);
  background: var(--bg-glass-card);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.chat-empty-icon svg {
  width: 36px;
  height: 36px;
  stroke: var(--primary);
  fill: none;
  stroke-width: 1.8;
}

/* Active Chat Header */
.chat-header {
  height: var(--header-height);
  padding: 0 1.25rem;
  background: var(--bg-dark);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 5;
}

.chat-header-user {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.chat-header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* Chat Messages Area */
.chat-messages {
  flex: 1;
  padding: 1.25rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

/* Message Bubble Items */
.message-row {
  display: flex;
  flex-direction: column;
  max-width: 75%;
}

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

.message-row.received {
  align-self: flex-start;
  align-items: flex-start;
}

.message-bubble {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  line-height: 1.45;
  word-break: break-word;
  position: relative;
  box-shadow: var(--shadow-sm);
}

.message-row.sent .message-bubble {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.message-row.received .message-bubble {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  border-bottom-left-radius: 4px;
}

/* Message Meta: Timestamp & Read Status */
.message-meta {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  margin-top: 0.25rem;
  color: var(--text-dim);
}

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

.message-status-icon {
  width: 14px;
  height: 14px;
  display: inline-flex;
}

.message-status-icon svg {
  width: 14px;
  height: 14px;
  stroke: var(--primary);
  fill: none;
  stroke-width: 2;
}

.message-status-icon.read svg {
  stroke: var(--accent-cyan);
}

.msg-delete-btn {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  transition: all var(--transition-fast);
  z-index: 5;
}

.message-row.sent:hover .msg-delete-btn {
  display: flex;
}

.msg-delete-btn:hover {
  background: #dc2626;
  transform: scale(1.15);
}

/* Typing Indicator Component */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.85rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  align-self: flex-start;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--text-muted);
  animation: typingBounce 1.4s infinite ease-in-out both;
}

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

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* Chat Input Bar */
.chat-input-area {
  padding: 0.85rem 1.25rem;
  background: var(--bg-dark);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.chat-input-wrapper {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.chat-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-full);
  background: var(--bg-darkest);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  outline: none;
  transition: border-color var(--transition-fast);
}

.chat-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 12px var(--primary-glow);
}

.send-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #ffffff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition-fast);
  box-shadow: 0 4px 12px var(--primary-glow);
}

.send-btn:hover {
  transform: scale(1.06);
}

.send-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: #ffffff;
  stroke-width: 2.2;
}

/* Mobile Back Button */
.mobile-back-btn {
  display: none;
}

@media (max-width: 768px) {
  .mobile-back-btn {
    display: inline-flex;
    margin-right: 0.5rem;
  }
}
