/* Input area */
.claudian-input-container {
  position: relative;
  padding: 12px 0 0 0;
}

/* Input wrapper (border container) - flex column so textarea expands when no chips */
/* Height calculation: context row (36px) + textarea min (60px) + toolbar (38px) + border (2px) = 136px */
.claudian-input-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 140px;
  border: 1px solid var(--background-modifier-border);
  border-radius: 6px;
  background: var(--background-primary);
}

/* Context row (file chip start, selection indicator end) - inside input wrapper at top */
/* Collapsed by default; expanded via .has-content class; textarea fills remaining space */
.claudian-context-row {
  display: none;
  align-items: flex-start;
  justify-content: flex-start;
  flex-shrink: 0;
  padding: 6px 10px 0 10px;
  gap: 8px;
}

/* Show context row when it has visible content */
.claudian-context-row.has-content {
  display: flex;
}

/* Nav row (tab badges start, header icons end) - above input wrapper */
.claudian-input-nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0 8px 0;
  min-height: 0;
}

/* Header mode: hide nav row above input (content moved to header) */
.claudian-container--header-mode .claudian-input-nav-row {
  display: none;
}

/* Selection indicator (shown when text is selected in editor) */
/* Match file chip height (24px): chip has 16px remove button + 6px padding + 2px border */
/* Indicator: 12px text + 10px padding (5+5) + 2px border = 24px */
.claudian-selection-indicator,
.claudian-browser-selection-indicator,
.claudian-canvas-indicator {
  color: #7abaff;
  font-size: 12px;
  line-height: 1;
  opacity: 0.9;
  pointer-events: none;
  white-space: nowrap;
  padding: 5px 6px;
  border: 1px solid transparent;
  border-radius: 4px;
  margin-inline-start: auto;
  flex-shrink: 0;
  order: 4;
  max-width: min(100%, clamp(220px, 64vw, 560px));
  overflow: hidden;
  text-overflow: ellipsis;
}

.claudian-input {
  width: 100%;
  flex: 1 1 0;
  min-height: 60px;
  /* max-height dynamically set by JS: max(150px, 55% of view height) */
  resize: none;
  padding: 8px 10px 10px 10px;
  border: none !important;
  border-radius: 6px;
  background: transparent !important;
  color: var(--text-normal);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.4;
  box-shadow: none !important;
  overflow-y: auto;
  unicode-bidi: plaintext; /* Proper BiDi text handling for mixed RTL/LTR */
}

.claudian-input:hover,
.claudian-input:focus {
  outline: none !important;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
}

.claudian-input::placeholder {
  color: var(--text-muted);
}

/* Input toolbar */
.claudian-input-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-shrink: 0;
  padding: 4px 6px 6px 6px;
}

/* File indicator (attached files) */
.claudian-file-indicator {
  display: none;
  flex-wrap: wrap;
  gap: 6px;
}

.claudian-file-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px 3px 8px;
  background: var(--background-primary);
  border: 1px solid var(--background-modifier-border);
  border-radius: 12px;
  font-size: 12px;
  line-height: 1;
  max-width: 200px;
  cursor: pointer;
}

.claudian-file-chip-icon {
  display: flex;
  align-items: center;
  color: var(--text-muted);
  flex-shrink: 0;
}

.claudian-file-chip-icon svg {
  width: 12px;
  height: 12px;
}

.claudian-file-chip-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-normal);
}

.claudian-file-chip-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1;
  transition: background 0.15s ease, color 0.15s ease;
}

.claudian-file-chip-remove:hover {
  background: var(--background-modifier-hover);
  color: var(--text-normal);
}

.claudian-file-chip:hover {
  background: var(--background-modifier-hover);
}

/* Message Queue Indicator (shown below flavor text in thinking indicator) */
.claudian-queue-indicator {
  display: none;
  font-size: 12px;
  color: var(--text-muted);
  font-style: normal;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Light blue border when instruction mode is active */
.claudian-input-instruction-mode {
  border-color: #60a5fa !important;
  box-shadow: 0 0 0 1px #60a5fa;
}

/* Pink border when bash mode is active */
.claudian-input-bang-bash-mode {
  border-color: #f472b6 !important;
  box-shadow: 0 0 0 1px #f472b6;
}

/* Monospace input while in bash mode */
.claudian-input-wrapper.claudian-input-bang-bash-mode .claudian-input {
  font-family: var(--font-monospace);
}
