/* FILE: css/input.css */
#input-area {
  padding: var(--space-3);
  padding-bottom: max(var(--space-3), env(safe-area-inset-bottom));
  border-top: 1px solid var(--border-subtle);
  background: linear-gradient(180deg, rgba(10, 10, 15, 0.6), rgba(10, 10, 15, 0.92));
  flex-shrink: 0;
  width: 100%;
  box-sizing: border-box;
}

#toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 0 var(--space-2) var(--space-2);
  animation: fadeIn 0.18s ease;
}

.toolbar-actions {
  display: inline-flex;
  gap: var(--space-1);
  align-items: center;
}

.toolbar-action {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.toolbar-action:hover,
.toolbar-action.active {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.toolbar-hints {
  color: var(--text-tertiary);
  font-size: var(--font-size-xs);
}

#input-container {
  display: flex;
  align-items: end;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-2);
  border-radius: var(--radius-xl);
  background: var(--bg-glass);
  border: 1px solid var(--border-input);
  box-shadow: var(--shadow-md);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  box-sizing: border-box;
}

#input-container:focus-within {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-glow);
}

#voice-btn,
#send-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  transition: all var(--transition-fast);
}

#voice-btn {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.02);
}

#voice-btn:hover {
  color: var(--accent-primary);
  background: rgba(108, 99, 255, 0.08);
}

#voice-btn.recording {
  color: white;
  background: rgba(255, 82, 82, 0.18);
  box-shadow: 0 0 0 8px rgba(255, 82, 82, 0.08);
}

#voice-btn.recording::after {
  content: '';
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  background: var(--accent-danger);
  animation: pulse 1.2s ease-in-out infinite;
}

#voice-btn svg,
#send-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  position: relative;
  z-index: 1;
}

#send-btn {
  color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.03);
}

#send-btn.enabled {
  background: linear-gradient(135deg, var(--accent-primary), #7f77ff);
  color: white;
  box-shadow: var(--shadow-glow);
}

#send-btn.enabled:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 30px rgba(108, 99, 255, 0.45);
}

#send-btn.stop-state {
  background: rgba(255, 82, 82, 0.18);
  color: var(--accent-danger);
  border: 1px solid rgba(255, 82, 82, 0.35);
  box-shadow: none;
}

#message-input {
  flex: 1;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 16px;
  line-height: 1.6;
  min-height: 44px;
  max-height: 120px;
  overflow-y: auto;
  padding: 10px 0 8px;
  box-sizing: border-box;
}

#message-input::placeholder {
  color: var(--text-tertiary);
}

#input-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-2) 0;
  min-height: 22px;
}

#input-status {
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
}

#char-counter {
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
  margin-left: auto;
}

#char-counter.warn {
  color: var(--accent-warning);
}

#char-counter.danger {
  color: var(--accent-danger);
}

.emoji-panel {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 0;
  width: 220px;
  padding: var(--space-3);
  border-radius: var(--radius-lg);
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-lg);
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--space-2);
  z-index: var(--z-panel);
}

.emoji-btn {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  font-size: 18px;
  display: grid;
  place-items: center;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.emoji-btn:hover {
  background: var(--bg-hover);
  transform: translateY(-1px);
}

.format-popover {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 84px;
  display: inline-flex;
  gap: var(--space-1);
  padding: var(--space-2);
  border-radius: var(--radius-md);
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-md);
  z-index: var(--z-panel);
}

.format-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.format-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
