/*
 * core/composer.css — styles for the reusable Core Composer (core/composer.js).
 *
 * Visual twin of the chat two-row composer (.composer.composer-two-row in
 * app.css) but under an isolated `.ucx-composer` namespace + class-based
 * selectors (no shared IDs), so any number of instances can live on a page
 * without colliding with the chat composer or each other. Theme-aware via the
 * app-wide CSS custom properties (--text, --muted, --line, --primary, …).
 */

.ucx-composer {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
  padding: 5px;
  border: var(--line);
  border-radius: 20px;
  background: var(--strans);
  -webkit-backdrop-filter: var(--backdrop-2);
  backdrop-filter: var(--backdrop-2);
  isolation: isolate;
  box-sizing: border-box;
}

.ucx-composer * { box-sizing: border-box; }

.ucx-top {
  position: relative;
  display: flex;
  align-items: stretch;
}

.ucx-input {
  width: 100%;
  min-height: 25px;
  max-height: 200px;
  padding: 8px 10px;
  border-radius: 20px;
  border: var(--line);
  background: var(--muted);
  color: var(--text);
  font: inherit;
  line-height: 1.45;
  resize: none;
  outline: none;
  overflow-y: auto;
}

.ucx-input::placeholder { color: var(--text-muted); }
.ucx-input:focus { box-shadow: var(--ring); }

.ucx-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ucx-left,
.ucx-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

.ucx-right { justify-content: flex-end; }

.ucx-btn {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  color: var(--text);
  cursor: pointer;
  padding: 0;
}
.ucx-btn:hover { background: var(--strans); }
.ucx-btn:disabled { opacity: .5; cursor: default; }
.ucx-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; }

.ucx-send {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  border: 0;
  background: var(--primary);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.ucx-send:hover { filter: brightness(1.05); }
.ucx-send:disabled { opacity: .55; cursor: default; }
.ucx-send svg { width: 16px; height: 16px; fill: none; stroke: currentColor; }

.ucx-composer.is-busy .ucx-input { opacity: .6; pointer-events: none; }

/* Attachment tray — horizontal chips, mirrors the chat attachment cards. */
.ucx-attach-tray {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 2px;
}
.ucx-attach-tray[hidden] { display: none; }

.ucx-attach-card {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 220px;
  padding: 5px 8px;
  border: var(--line);
  border-radius: 12px;
  background: var(--muted);
}
.ucx-attach-thumb {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  overflow: hidden;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  background: var(--strans);
}
.ucx-attach-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ucx-attach-thumb svg { width: 16px; height: 16px; fill: none; stroke: currentColor; }
.ucx-attach-meta { display: flex; flex-direction: column; min-width: 0; }
.ucx-attach-name { font-size: 12px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ucx-attach-size { font-size: 11px; color: var(--text-muted); }
.ucx-attach-remove {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 0;
  background: var(--strans);
  color: var(--text);
  cursor: pointer;
  line-height: 1;
}
.ucx-attach-remove:hover { background: var(--line); }
