/* Floating Chat Window */
.floating-chat {
  position: fixed;
  bottom: 0;
  right: 20px;
  width: 400px;
  max-width: 90vw;
  min-width: 300px;
  height: 500px;
  min-height: 300px;
  max-height: 80vh;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px 12px 0 0;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transition: none;
  overflow: hidden;
}

/* Custom resize handle */
.resize-handle {
  position: absolute;
  top: 0;
  left: 0;
  width: 20px;
  height: 20px;
  cursor: nw-resize;
  z-index: 10;
}

.resize-handle::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  width: 12px;
  height: 12px;
  background: linear-gradient(135deg, transparent 50%, var(--accent-primary) 50%);
  opacity: 0.5;
  border-radius: 8px 0 0 0;
}

.floating-chat.minimized {
  height: 48px !important;
  min-height: 48px;
  cursor: pointer;
}

.floating-chat.minimized .chat-content-floating {
  display: none;
}

.floating-chat.minimized .resize-handle {
  display: none;
}

/* Chat Header */
.chat-header-floating {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
  padding: 0.75em 1em;
  border-radius: 12px 12px 0 0;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: move;
  user-select: none;
  height: 48px;
  flex-shrink: 0;
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 0.75em;
  flex: 1;
}

.chat-floating-avatar {
  width: 32px;
  height: 32px;
  border-radius: 6px;
}

.chat-floating-title {
  color: var(--accent-primary);
  font-weight: 600;
  font-size: 0.95em;
}

.chat-unread-badge {
  background: var(--accent-danger);
  color: white;
  font-size: 0.75em;
  font-weight: bold;
  padding: 0.2em 0.5em;
  border-radius: 12px;
  min-width: 20px;
  text-align: center;
}

.chat-header-controls {
  display: flex;
  gap: 0.5em;
}

.chat-minimize-btn,
.chat-maximize-btn {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border-color);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border-radius: 4px;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.chat-minimize-btn:hover,
.chat-maximize-btn:hover {
  background: var(--border-color);
  color: var(--accent-primary);
}

/* Content area */
.chat-content-floating {
  display: flex;
  flex-direction: column;
  height: calc(100% - 48px);
  padding: 1em;
  gap: 0.75em;
}

/* Search input */
.chat-content-floating .chat-search {
  flex: 0 0 auto;
}

/* Messages area */
.chat-content-floating .chat-messages {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1em;
  background-color: rgba(22, 26, 36, 0.5);
  min-height: 0;
}

/* Input container at bottom */
.chat-content-floating .chat-input-container {
  flex: 0 0 auto;
  display: flex;
  gap: 0.75em;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .floating-chat {
    width: 100%;
    right: 0;
    left: 0;
    border-radius: 12px 12px 0 0;
  }
  
  .floating-chat:not(.minimized) {
    height: 70vh;
  }
}
.loading-more {
  text-align: center;
  padding: 1em;
  color: var(--text-muted);
  font-size: 0.9em;
  font-style: italic;
}