/* ========== INPUT AREA ========== */

/* Drag & Drop Overlay */
#chatView.drop-active::after {
  content: 'Drop images here';
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 167, 111, 0.08);
  border: 2px dashed var(--primary);
  border-radius: var(--radius);
  color: var(--primary);
  font-size: 0.9375rem;
  font-weight: 600;
  pointer-events: none;
  backdrop-filter: blur(2px);
}

.thread-panel.drop-active::after {
  content: 'Drop to thread';
  position: absolute;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 167, 111, 0.08);
  border: 2px dashed var(--primary);
  border-radius: var(--radius);
  color: var(--primary);
  font-size: 0.9375rem;
  font-weight: 600;
  pointer-events: none;
  backdrop-filter: blur(2px);
}

/* Reply Preview */
.reply-preview {
  padding: 12px 24px;
  background: var(--bg-paper);
  border-top: 1px dashed var(--divider);
  display: none;
  align-items: center;
  gap: 16px;
}

.reply-preview.active { display: flex; }

.reply-content {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg-neutral);
  border-radius: var(--radius);
  border-left: 3px solid var(--primary);
}

.reply-name { font-size: 0.75rem; font-weight: 600; color: var(--primary); }
.reply-text { font-size: 0.8125rem; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reply-close { background: none; border: none; color: var(--text-disabled); cursor: pointer; padding: 4px; }

/* Input Wrapper */
.input-area {
  padding: 16px 24px 24px;
  background: var(--bg-paper);
}

.input-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  background: var(--bg-neutral);
  padding: 10px 16px;
  border-radius: calc(var(--radius) * 2);
  transition: var(--transition);
}

.input-wrapper:focus-within {
  background: var(--bg-paper);
  box-shadow: 0 0 0 2px var(--primary);
}

.input-actions { display: flex; gap: 4px; }

.input-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.input-btn:hover { background: rgba(0,167,111,0.08); color: var(--primary); }
.input-btn.recording { color: var(--error); animation: pulse 1s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

.msg-input {
  flex: 1;
  border: none;
  background: none;
  color: var(--text-primary);
  font-size: 0.875rem;
  resize: none;
  max-height: 120px;
  line-height: 1.5;
  font-family: inherit;
  padding-bottom: 10px;
}

.msg-input:focus { outline: none; }
.msg-input::placeholder { color: var(--text-disabled); }

.send-btn {
  width: 44px;
  height: 44px;
  border: none;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  border-radius: calc(var(--radius) * 1.5);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  box-shadow: var(--shadow-primary);
}

.send-btn:hover { transform: scale(1.05); box-shadow: var(--shadow-z16); }
.send-btn:disabled { background: var(--grey-400); cursor: not-allowed; transform: none; box-shadow: none; }

/* ========== MEDIA PREVIEW ========== */
.media-preview {
  padding: 12px 24px;
  background: var(--bg-paper);
  border-top: 1px dashed var(--divider);
  display: none;
  align-items: center;
  gap: 12px;
  position: relative;
}

.media-preview.active { display: flex; }

.media-preview-content {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-neutral);
  border-radius: var(--radius);
  border-left: 3px solid var(--info);
}

.media-preview-thumb {
  width: 56px;
  height: 56px;
  border-radius: var(--radius);
  overflow: hidden;
  flex-shrink: 0;
}

.media-preview-thumb img,
.media-preview-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.media-preview-file-icon {
  width: 100%;
  height: 100%;
  background: var(--bg-paper);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--text-disabled);
}

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

.media-preview-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.media-preview-size {
  font-size: 0.6875rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Multi-file preview: stack rows vertically */
.media-preview.multi-active {
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}

.media-preview.multi-active > .media-preview-content + .media-preview-content {
  border-top: 1px solid var(--divider);
}

.media-preview.multi-active > .reply-close {
  position: absolute;
  top: 8px;
  right: 12px;
}

/* Per-row remove button (shown for multi-file rows) */
.media-preview-remove-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  font-size: 0.75rem;
  opacity: 0.5;
  transition: opacity 0.15s ease, color 0.15s ease;
  flex-shrink: 0;
}

.media-preview-remove-btn:hover {
  opacity: 1;
  color: var(--error, #ef4444);
}

/* ========== FILE MESSAGE BUBBLE ========== */
.msg-file {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(145, 158, 171, 0.08);
  border-radius: var(--radius);
  margin-bottom: 6px;
}

.msg-file i { font-size: 1.25rem; color: var(--info); }
.message-wrapper.sent .msg-file { background: rgba(255,255,255,0.12); }
.message-wrapper.sent .msg-file i { color: rgba(255,255,255,0.8); }
.msg-file-info { flex: 1; min-width: 0; }
.msg-file-name { font-size: 0.8125rem; font-weight: 500; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-file-size { font-size: 0.6875rem; opacity: 0.7; }
